xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ clearerr(int /*<<< orphan*/ *);
void smp_sio_clearerr(FILE *fp) { clearerr(fp); }


x86 assembly (clang, -O0):
<smp_sio_clearerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <clearerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_sio_clearerr>:
jmp    1030 <clearerr@plt>

LLVM IR (-O0):
define void @smp_sio_clearerr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @clearerr(i32* %3)
ret void
}

LLVM IR (-O2):
define void @smp_sio_clearerr(i32* nocapture %0) {
%2 = tail call i32 @clearerr(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _quick_sort(int *, int /*<<< orphan*/, int);
void quick_sort(int *nums, int n) { _quick_sort(nums, 0, n - 1); }


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <_quick_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <_quick_sort@plt>

LLVM IR (-O0):
define void @quick_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @_quick_sort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @_quick_sort(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vprintf1(char *, long long, long long, int, ...);
void stdarg_test(void) {
  vprintf1("%d %d %d\n", 1, 2, 3);
  vprintf1("%f %d %f\n", 1.0, 2, 3.0);
  vprintf1("%l %l %d %f\n", 1234567891234LL, 987654321986LL, 3, 1234.0);
}


x86 assembly (clang, -O0):
<stdarg_test>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x0,%al
call   1030 <vprintf1@plt>
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x0,%al
call   1030 <vprintf1@plt>
lea    0xec7(%rip),%rdi
movabs $0x11f71fb0922,%rsi
movabs $0xe5f4c8f742,%rdx
mov    $0x3,%ecx
movsd  0xe8a(%rip),%xmm0
mov    $0x1,%al
call   1030 <vprintf1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdarg_test>:
push   %rax
lea    0xef0(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <vprintf1@plt>
lea    0xedd(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <vprintf1@plt>
lea    0xeca(%rip),%rdi
movabs $0x11f71fb0922,%rsi
movabs $0xe5f4c8f742,%rdx
movsd  0xe92(%rip),%xmm0
mov    $0x3,%ecx
mov    $0x1,%al
pop    %r8
jmp    1030 <vprintf1@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [10 x i8] c"%f %d %f\0A\00"
@.str.2 = [13 x i8] c"%l %l %d %f\0A\00"
define void @stdarg_test() {
%1 = call i32 (i8*, i64, i64, i32, ...) @vprintf1(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 1, i64 2, i32 3)
%2 = call i32 (i8*, i64, i64, i32, ...) @vprintf1(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 1, i64 2, i32 3)
%3 = call i32 (i8*, i64, i64, i32, ...) @vprintf1(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 1234567891234, i64 987654321986, i32 3, double 1.234000e+03)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [10 x i8] c"%f %d %f\0A\00"
@.str.2 = [13 x i8] c"%l %l %d %f\0A\00"
define void @stdarg_test() {
%1 = tail call i32 (i8*, i64, i64, i32, ...) @vprintf1(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 1, i64 2, i32 3)
%2 = tail call i32 (i8*, i64, i64, i32, ...) @vprintf1(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 1, i64 2, i32 3)
%3 = tail call i32 (i8*, i64, i64, i32, ...) @vprintf1(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 1234567891234, i64 987654321986, i32 3, double 1.234000e+03)
ret void
}
unsigned int string_length(char *string) {
  char *str = string;
  while (*str != '\0') {
    str++;
  }
  return str - string;
}


x86 assembly (clang, -O0):
<string_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <string_length+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <string_length+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <string_length+0x10>
ret

LLVM IR (-O0):
define i32 @string_length(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @string_length(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
int msb(unsigned int x) {
  x |= x >> 16;
  x |= x >> 8;
  x |= x >> 4;
  x |= x >> 2;
  x |= x >> 1;
  x ^= x >> 1;
  return x;
}


x86 assembly (clang, -O0):
<msb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msb>:
mov    %edi,%eax
shr    $0x10,%eax
or     %edi,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    %edx
or     %ecx,%edx
mov    %edx,%eax
shr    %eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @msb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 8
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = lshr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 2
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = lshr i32 %19, 1
%21 = load i32, i32* %2
%22 = or i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = lshr i32 %23, 1
%25 = load i32, i32* %2
%26 = xor i32 %25, %24
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @msb(i32 %0) {
%2 = lshr i32 %0, 16
%3 = or i32 %2, %0
%4 = lshr i32 %3, 8
%5 = or i32 %4, %3
%6 = lshr i32 %5, 4
%7 = or i32 %6, %5
%8 = lshr i32 %7, 2
%9 = or i32 %8, %7
%10 = lshr i32 %9, 1
%11 = or i32 %10, %9
%12 = lshr i32 %11, 1
%13 = xor i32 %12, %11
ret i32 %13
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
char const *GetConstructModuleName(struct constructHeader *);
const char *EnvDefgenericModule(void *theEnv, void *theDefgeneric) {
  return GetConstructModuleName((struct constructHeader *)theDefgeneric);
}


x86 assembly (clang, -O0):
<EnvDefgenericModule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <GetConstructModuleName@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnvDefgenericModule>:
mov    %rsi,%rdi
jmp    1030 <GetConstructModuleName@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvDefgenericModule(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.constructHeader*
%7 = call i8* @GetConstructModuleName(%struct.constructHeader* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvDefgenericModule(i8* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructModuleName(%struct.constructHeader* %3)
ret i8* %4
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
char *private_allocStringToString(char *s) {
  size_t len = strlen(s);
  char *t = malloc(sizeof(char) * (len + 1));
  strcpy(t, s);
  return t;
}


x86 assembly (clang, -O0):
<private_allocStringToString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<private_allocStringToString>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @private_allocStringToString(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i8* @malloc(i32 %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @private_allocStringToString(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 1
%5 = tail call i8* @malloc(i32 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
int HelpItem115(void) { return 0; }


x86 assembly (clang, -O0):
<HelpItem115>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HelpItem115>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @HelpItem115() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem115() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int f();
int main() {
  if (f() != 2)
    _exit(-1);
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
cmp    $0x2,%eax
je     1149 <main+0x29>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
cmp    $0x2,%eax
jne    1134 <main+0x14>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = icmp ne i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @_exit(i32 -1)
unreachable
6: ; preds = %0
%7 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @_exit(i32 -1)
unreachable
5: ; preds = %0
%6 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x72() {
  Assert_real((isdigit(114) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              575, ("isdigit should be 0 for r"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x72>:
push   %rbp
mov    %rsp,%rbp
mov    $0x72,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x23f,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x72>:
push   %rax
mov    $0x72,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x23f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for r\00"
define void @t_isdigit_0x72() {
%1 = call i64 @isdigit(i32 114)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for r\00"
define void @t_isdigit_0x72() {
%1 = tail call i64 @isdigit(i32 114)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(unsigned char *, char *, int);
int pdu_rest_is_zero(unsigned char *pdu, int len) {
  static char zero[4096];
  return !memcmp(pdu, zero, len);
}


x86 assembly (clang, -O0):
<pdu_rest_is_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0x2f13(%rip),%rsi
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_rest_is_zero>:
push   %rax
mov    %esi,%edx
lea    0x2f26(%rip),%rsi
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@pdu_rest_is_zero.zero = internal global [4096 x i8] zeroinitializer
define i32 @pdu_rest_is_zero(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @memcmp(i8* %5, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @pdu_rest_is_zero.zero, i64 0, i64 0), i32 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@pdu_rest_is_zero.zero = internal global [4096 x i8] zeroinitializer
define i32 @pdu_rest_is_zero(i8* %0, i32 %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @pdu_rest_is_zero.zero, i64 0, i64 0), i32 %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int fexcept_t;
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ fegetenv(int *);
int /*<<< orphan*/ feraiseexcept(int);
int /*<<< orphan*/ fesetenv(int /*<<< orphan*/ const *);
int feupdateenv(const fenv_t *__envp) {
  fexcept_t __fcsr;
  fegetenv(&__fcsr);
  fesetenv(__envp);
  feraiseexcept(__fcsr & FE_ALL_EXCEPT);
  return 0;
}


x86 assembly (clang, -O0):
<feupdateenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <fegetenv@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fesetenv@plt>
mov    -0xc(%rbp),%edi
mov    0x2e88(%rip),%rax
and    (%rax),%edi
call   1030 <feraiseexcept@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feupdateenv>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
call   1050 <fegetenv@plt>
mov    %rbx,%rdi
call   1040 <fesetenv@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
and    0xc(%rsp),%edi
call   1030 <feraiseexcept@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @feupdateenv(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @fegetenv(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fesetenv(i32* %5)
%7 = load i32, i32* %3
%8 = load i32, i32* @FE_ALL_EXCEPT
%9 = and i32 %7, %8
%10 = call i32 @feraiseexcept(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @feupdateenv(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fegetenv(i32* %2)
%5 = call i32 @fesetenv(i32* %0)
%6 = load i32, i32* %2
%7 = load i32, i32* @FE_ALL_EXCEPT
%8 = and i32 %7, %6
%9 = call i32 @feraiseexcept(i32 %8)
ret i32 0
}
int value_cmp_int(const void *pv1, const void *pv2) {
  int v1 = *(int *)pv1;
  int v2 = *(int *)pv2;
  return v1 - v2;
}


x86 assembly (clang, -O0):
<value_cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_cmp_int>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @value_cmp_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @value_cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
unsigned int inc_seq_num(unsigned int seq) {
  seq++;
  if (seq == 0)
    seq = 1;
  return (seq);
}


x86 assembly (clang, -O0):
<inc_seq_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1121 <inc_seq_num+0x21>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_seq_num>:
inc    %edi
mov    $0x1,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @inc_seq_num(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @inc_seq_num(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 1, i32 %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prog) {
  fprintf(stderr, "%s: N\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s: N\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s: N\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
double SIM_power_transreson(width, nchannel, stack)
double width;
int nchannel;
int stack;
{
  double restrans;
  restrans = (nchannel) ? (9723 * 0.0875) : (22400 * 0.0875);
  return (stack * restrans / width);
}


x86 assembly (clang, -O0):
<SIM_power_transreson>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
movsd  0xee6(%rip),%xmm0
movsd  0xee6(%rip),%xmm1
movsd  %xmm1,-0x28(%rbp)
cmp    $0x0,%eax
movsd  %xmm0,-0x20(%rbp)
jne    113f <SIM_power_transreson+0x3f>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_power_transreson>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
cvtsi2sd %esi,%xmm1
lea    0xeee(%rip),%rcx
mulsd  (%rcx,%rax,8),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @SIM_power_transreson(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store double %0, double* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, double 0x408A961999999999, double 0x409E9FFFFFFFFFFF
store double %11, double* %7
%12 = load i32, i32* %6
%13 = sitofp i32 %12 to double
%14 = load double, double* %7
%15 = fmul double %13, %14
%16 = load double, double* %4
%17 = fdiv double %15, %16
ret double %17
}

LLVM IR (-O2):
define double @SIM_power_transreson(double %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, double 0x409E9FFFFFFFFFFF, double 0x408A961999999999
%6 = sitofp i32 %2 to double
%7 = fmul double %5, %6
%8 = fdiv double %7, %0
ret double %8
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_number_of_quaddobl_polynomials(int *length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(382, length, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_number_of_quaddobl_polynomials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x17e,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_number_of_quaddobl_polynomials>:
mov    %rdi,%rsi
mov    $0x17e,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_number_of_quaddobl_polynomials(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 382, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_number_of_quaddobl_polynomials(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 382, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
extern void sig_handler(int signum) {
  printf("Called with signal %d\n", signum);
  sleep(signum);
  printf("done handling signal %d\n", signum);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <sleep@plt>
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <sleep@plt>
lea    0xed8(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Called with signal %d\0A\00"
@.str.1 = [25 x i8] c"done handling signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @sleep(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Called with signal %d\0A\00"
@.str.1 = [25 x i8] c"done handling signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void RTLockValidatorClassForSrcPos(void) {}


x86 assembly (clang, -O0):
<RTLockValidatorClassForSrcPos>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTLockValidatorClassForSrcPos>:
ret

LLVM IR (-O0):
define void @RTLockValidatorClassForSrcPos() {
ret void
}

LLVM IR (-O2):
define void @RTLockValidatorClassForSrcPos() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
print_read_timeout() { printf("Read request timed out\n"); }


x86 assembly (clang, -O0):
<print_read_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_read_timeout>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Read request timed out\0A\00"
define i32 @print_read_timeout() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [23 x i8] c"Read request timed out\00"
define i32 @print_read_timeout() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
unsigned long long __make_mantissa_base10(const char *tagp) {
  unsigned long long r = 0;
  while (tagp) {
    char tmp = *tagp;
    if (tmp >= '0' && tmp <= '9')
      r = (r * 10u) + tmp - '0';
    else
      return 0;
    ++tagp;
  }
  return r;
}


x86 assembly (clang, -O0):
<__make_mantissa_base10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1176 <__make_mantissa_base10+0x76>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x30,%eax
jl     1158 <__make_mantissa_base10+0x58>
movsbl -0x19(%rbp),%eax
cmp    $0x39,%eax
jg     1158 <__make_mantissa_base10+0x58>
imul   $0xa,-0x18(%rbp),%rax
movsbq -0x19(%rbp),%rcx
add    %rcx,%rax
sub    $0x30,%rax
mov    %rax,-0x18(%rbp)
jmp    1165 <__make_mantissa_base10+0x65>
movq   $0x0,-0x8(%rbp)
jmp    117e <__make_mantissa_base10+0x7e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <__make_mantissa_base10+0x10>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__make_mantissa_base10>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %rdi,%rdi
je     1133 <__make_mantissa_base10+0x33>
movsbq (%rdi),%rcx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
lea    (%rax,%rax,4),%rax
lea    (%rcx,%rax,2),%rax
add    $0xffffffffffffffd0,%rax
cmp    $0xa,%dl
jb     1110 <__make_mantissa_base10+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @__make_mantissa_base10(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8
store i8* %0, i8** %3
store i64 0, i64* %4
br label %6
6: ; preds = %27, %1
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
store i8 %11, i8* %5
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 48
br i1 %14, label %15, label %26
15: ; preds = %9
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 57
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i64, i64* %4
%21 = mul i64 %20, 10
%22 = load i8, i8* %5
%23 = sext i8 %22 to i64
%24 = add i64 %21, %23
%25 = sub i64 %24, 48
store i64 %25, i64* %4
br label %27
26: ; preds = %15, %9
store i64 0, i64* %2
br label %32
27: ; preds = %19
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
br label %6
30: ; preds = %6
%31 = load i64, i64* %4
store i64 %31, i64* %2
br label %32
32: ; preds = %30, %26
%33 = load i64, i64* %2
ret i64 %33
}

LLVM IR (-O2):
define i64 @__make_mantissa_base10(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %14, %6 ]
%4 = phi i64 [ 0, %1 ], [ %13, %6 ]
%5 = icmp eq i8* %3, null
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = load i8, i8* %3
%8 = add i8 %7, -48
%9 = icmp ult i8 %8, 10
%10 = mul i64 %4, 10
%11 = sext i8 %7 to i64
%12 = add i64 %10, -48
%13 = add i64 %12, %11
%14 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %9, label %2, label %15
15: ; preds = %2, %6
%16 = phi i64 [ 0, %6 ], [ %4, %2 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ free(long *);
void destroi_long(void *data) {
  long *info = (long *)data;
  if (info != NULL) {
    free(info);
  }
}


x86 assembly (clang, -O0):
<destroi_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1138 <destroi_long+0x28>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroi_long>:
test   %rdi,%rdi
je     111a <destroi_long+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @destroi_long(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = icmp ne i64* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64*, i64** %3
%10 = call i32 @free(i64* %9)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @destroi_long(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i64*
%5 = tail call i32 @free(i64* %4)
br label %6
6: ; preds = %3, %1
ret void
}
double acos(double x) { return 4; }


x86 assembly (clang, -O0):
<acos>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<acos>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @acos(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @acos(double %0) {
ret double 4.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hellow\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"hellow\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"hellow\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
const void *check_cptr_ATTRvoid(const void *v) { return v; }


x86 assembly (clang, -O0):
<check_cptr_ATTRvoid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_cptr_ATTRvoid>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @check_cptr_ATTRvoid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @check_cptr_ATTRvoid(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t usys_ntohl(uint32_t n) { return ntohl(n); }


x86 assembly (clang, -O0):
<usys_ntohl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usys_ntohl>:
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @usys_ntohl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ntohl(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @usys_ntohl(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
ret i32 %2
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};
typedef int int64_t;

/* Variables and functions */
int64_t to_usec(struct timespec *ts) {
  return ts->tv_sec * 1000000 + (ts->tv_nsec / 1000);
}


x86 assembly (clang, -O0):
<to_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_usec>:
imul   $0xf4240,(%rdi),%ecx
movslq 0x4(%rdi),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @to_usec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @to_usec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000
%8 = add nsw i32 %7, %4
ret i32 %8
}
void dec_zcache_eph_zpages(unsigned zpages) {}


x86 assembly (clang, -O0):
<dec_zcache_eph_zpages>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_zcache_eph_zpages>:
ret

LLVM IR (-O0):
define void @dec_zcache_eph_zpages(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @dec_zcache_eph_zpages(i32 %0) {
ret void
}
int Compare(const void *element1, const void *element2) {
  return *(int *)element1 - *(int *)element2;
}


x86 assembly (clang, -O0):
<Compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Compare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @Compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @Compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
char getPieceAt(char *board, int row, int col) {
  if (row >= 0 && col >= 0 && row < 8 && col < 8)
    return board[row * 8 + col];
  else
    return -1;
}


x86 assembly (clang, -O0):
<getPieceAt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1151 <getPieceAt+0x51>
cmpl   $0x0,-0x18(%rbp)
jl     1151 <getPieceAt+0x51>
cmpl   $0x8,-0x14(%rbp)
jge    1151 <getPieceAt+0x51>
cmpl   $0x8,-0x18(%rbp)
jge    1151 <getPieceAt+0x51>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
jmp    1155 <getPieceAt+0x55>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPieceAt>:
mov    $0xff,%al
cmp    $0x7,%edx
jg     1118 <getPieceAt+0x18>
cmp    $0x7,%esi
jg     1118 <getPieceAt+0x18>
mov    %edx,%ecx
or     %esi,%ecx
js     1118 <getPieceAt+0x18>
lea    (%rdx,%rsi,8),%eax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
define signext i8 @getPieceAt(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %28
10: ; preds = %3
%11 = load i32, i32* %7
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %28
13: ; preds = %10
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 8
br i1 %15, label %16, label %28
16: ; preds = %13
%17 = load i32, i32* %7
%18 = icmp slt i32 %17, 8
br i1 %18, label %19, label %28
19: ; preds = %16
%20 = load i8*, i8** %5
%21 = load i32, i32* %6
%22 = mul nsw i32 %21, 8
%23 = load i32, i32* %7
%24 = add nsw i32 %22, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %20, i64 %25
%27 = load i8, i8* %26
store i8 %27, i8* %4
br label %29
28: ; preds = %16, %13, %10, %3
store i8 -1, i8* %4
br label %29
29: ; preds = %28, %19
%30 = load i8, i8* %4
ret i8 %30
}

LLVM IR (-O2):
define signext i8 @getPieceAt(i8* nocapture %0, i32 %1, i32 %2) {
%4 = or i32 %2, %1
%5 = icmp sgt i32 %4, -1
%6 = icmp slt i32 %1, 8
%7 = and i1 %6, %5
%8 = icmp slt i32 %2, 8
%9 = and i1 %8, %7
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = shl nsw i32 %1, 3
%12 = add nsw i32 %11, %2
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
br label %16
16: ; preds = %3, %10
%17 = phi i8 [ %15, %10 ], [ -1, %3 ]
ret i8 %17
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
struct TreeNode *des(char **);
struct TreeNode *deserialize(char *data) {
  return des(&data);
}


x86 assembly (clang, -O0):
<deserialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <des@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deserialize>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <des@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @deserialize(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call %struct.TreeNode* @des(i8** %2)
ret %struct.TreeNode* %3
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @deserialize(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call %struct.TreeNode* @des(i8** %2)
ret %struct.TreeNode* %3
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  long long tv_usec;
};

/* Variables and functions */
void double_to_tv(double val, struct timeval *tv) {
  long long secs = (long long)val;
  long long usecs = (long long)((val - secs) * 1000000);
  tv->tv_sec = secs;
  tv->tv_usec = usecs;
}


x86 assembly (clang, -O0):
<double_to_tv>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdq -0x18(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_tv>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xeea(%rip),%xmm0
cvttsd2si %xmm0,%rcx
mov    %rax,(%rdi)
mov    %rcx,0x8(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @double_to_tv(double %0, %struct.timeval* %1) {
%3 = alloca double
%4 = alloca %struct.timeval*
%5 = alloca i64
%6 = alloca i64
store double %0, double* %3
store %struct.timeval* %1, %struct.timeval** %4
%7 = load double, double* %3
%8 = fptosi double %7 to i64
store i64 %8, i64* %5
%9 = load double, double* %3
%10 = load i64, i64* %5
%11 = sitofp i64 %10 to double
%12 = fsub double %9, %11
%13 = fmul double %12, 1.000000e+06
%14 = fptosi double %13 to i64
store i64 %14, i64* %6
%15 = load i64, i64* %5
%16 = load %struct.timeval*, %struct.timeval** %4
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 0
store i64 %15, i64* %17
%18 = load i64, i64* %6
%19 = load %struct.timeval*, %struct.timeval** %4
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %19, i32 0, i32 1
store i64 %18, i64* %20
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @double_to_tv(double %0, %struct.timeval* nocapture writeonly %1) {
%3 = fptosi double %0 to i64
%4 = sitofp i64 %3 to double
%5 = fsub double %0, %4
%6 = fmul double %5, 1.000000e+06
%7 = fptosi double %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
store i64 %3, i64* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
store i64 %7, i64* %9
ret void
}
int model_header(fd, message)
int fd;
char *message;
{}


x86 assembly (clang, -O0):
<model_header>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<model_header>:
ret

LLVM IR (-O0):
define i32 @model_header(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @model_header(i32 %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int do_help(char **argv) {
  printf("\n   usage: %s  ip  port  [0-4]  [-l | -s]\n\n", argv[0]);
}


x86 assembly (clang, -O0):
<do_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_help>:
mov    (%rdi),%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"\0A usage: %s ip port [0-4] [-l | -s]\0A\0A\00"
define i32 @do_help(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = load i8**, i8*** %3
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [44 x i8] c"\0A usage: %s ip port [0-4] [-l | -s]\0A\0A\00"
define i32 @do_help(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_process_priority(void *bus, int64_t priority, void **ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_process_priority>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_process_priority>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_process_priority(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_process_priority(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ laserxt_init();
int /*<<< orphan*/ xt_init();
void xt_laserxt_init() {
  xt_init();
  laserxt_init();
}


x86 assembly (clang, -O0):
<xt_laserxt_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <xt_init@plt>
mov    $0x0,%al
call   1030 <laserxt_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xt_laserxt_init>:
push   %rax
xor    %eax,%eax
call   1040 <xt_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <laserxt_init@plt>

LLVM IR (-O0):
define void @xt_laserxt_init() {
%1 = call i32 (...) @xt_init()
%2 = call i32 (...) @laserxt_init()
ret void
}

LLVM IR (-O2):
define void @xt_laserxt_init() {
%1 = tail call i32 (...) @xt_init()
%2 = tail call i32 (...) @laserxt_init()
ret void
}
long ksp_get_major_version(void) { return 0; }


x86 assembly (clang, -O0):
<ksp_get_major_version>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ksp_get_major_version>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @ksp_get_major_version() {
ret i64 0
}

LLVM IR (-O2):
define i64 @ksp_get_major_version() {
ret i64 0
}