xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ syscall(int, char *, size_t);
char *getcwd(char *buf, size_t size) {
  return syscall(183, buf, size) < 0 ? NULL : buf;
}


x86 assembly (clang, -O0):
<getcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0xb7,%edi
call   1030 <syscall@plt>
cmp    $0x0,%rax
jge    1147 <getcwd+0x37>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    114f <getcwd+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    $0xb7,%edi
mov    %rbx,%rsi
call   1030 <syscall@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmovns %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getcwd(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i64 @syscall(i32 183, i8* %5, i64 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %12
10: ; preds = %2
%11 = load i8*, i8** %3
br label %12
12: ; preds = %10, %9
%13 = phi i8* [ null, %9 ], [ %11, %10 ]
ret i8* %13
}

LLVM IR (-O2):
define i8* @getcwd(i8* %0, i64 %1) {
%3 = tail call i64 @syscall(i32 183, i8* %0, i64 %1)
%4 = icmp slt i64 %3, 0
%5 = select i1 %4, i8* null, i8* %0
ret i8* %5
}
int mkstemp(char *template) {}


x86 assembly (clang, -O0):
<mkstemp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mkstemp(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
unsigned long fwrite(unsigned char *, int, unsigned long, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void save(FILE *fh, unsigned char *ptr, unsigned long sz) {
  if (fwrite(ptr, 1, sz, fh) != sz) {
    fprintf(stderr, "Write error!\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
cmp    -0x18(%rbp),%rax
je     1183 <save+0x53>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1050 <fwrite@plt>
cmp    %rbx,%rax
jne    114b <save+0x1b>
pop    %rbx
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"Write error!\0A\00"
define void @save(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32*, i32** %4
%10 = call i64 @fwrite(i8* %7, i32 1, i64 %8, i32* %9)
%11 = load i64, i64* %6
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"Write error!\0A\00"
define void @save(i32* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @fwrite(i8* %1, i32 1, i64 %2, i32* %0)
%5 = icmp eq i64 %4, %2
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int time(int /*<<< orphan*/ *);
void days_since_beginning() {
  time_t seconds;
  seconds = time(NULL);
  printf("Days since January 1, 1970 = %d\n", seconds / 3600 / 24);
}


x86 assembly (clang, -O0):
<days_since_beginning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<days_since_beginning>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
movslq %eax,%rsi
imul   $0xffffffffc22e4507,%rsi,%rax
shr    $0x20,%rax
add    %eax,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0x10,%esi
add    %eax,%esi
lea    0xeb7(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Days since January 1, 1970 = %d\0A\00"
define void @days_since_beginning() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sdiv i32 %3, 3600
%5 = sdiv i32 %4, 24
%6 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Days since January 1, 1970 = %d\0A\00"
define void @days_since_beginning() {
%1 = tail call i32 @time(i32* null)
%2 = sdiv i32 %1, 86400
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, int /*<<< orphan*/ *, int);
void kiss_write_char(int fd, uint8_t c) { write(fd, &c, 1); }


x86 assembly (clang, -O0):
<kiss_write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kiss_write_char>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @kiss_write_char(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 = call i32 @write(i32 %5, i32* %4, i32 1)
ret void
}

LLVM IR (-O2):
define void @kiss_write_char(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 1)
ret void
}
void RTSpinlockDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSpinlockDestroy() {
ret void
}
void CameraDMADisable(unsigned long ulBase) {
  (*((volatile unsigned long *)(ulBase + 0x00000044))) &= ~0x00000100;
}


x86 assembly (clang, -O0):
<CameraDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%rcx
and    $0xfffffffffffffeff,%rcx
mov    %rcx,0x44(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CameraDMADisable>:
andq   $0xfffffffffffffeff,0x44(%rdi)
ff
ret

LLVM IR (-O0):
define void @CameraDMADisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 68
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -257
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @CameraDMADisable(i64 %0) {
%2 = add i64 %0, 68
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -257
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void listprint(char **list, int count) {
  int i = 0;
  for (i = 0; i < count; i++) {
    printf("Titel: %s\n", list[i]);
  }
}


x86 assembly (clang, -O0):
<listprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <listprint+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <listprint+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listprint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <listprint+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <listprint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Titel: %s\0A\00"
define void @listprint(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Titel: %s\0A\00"
define void @listprint(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int pow(double, double);
double normHill(double x, double n, double k) {
  return (pow(x, n) / (pow(x, n) + pow(k, n)) * (1 + pow(k, n)));
}


x86 assembly (clang, -O0):
<normHill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
mov    %eax,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
mov    %eax,-0x24(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
mov    -0x24(%rbp),%ecx
mov    %eax,%edx
mov    -0x20(%rbp),%eax
add    %edx,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    $0x1,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normHill>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <pow@plt>
mov    %eax,%ebx
movsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1030 <pow@plt>
mov    %eax,%ebp
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1030 <pow@plt>
mov    %eax,%ecx
add    %ebp,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1030 <pow@plt>
add    $0x1,%eax
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @normHill(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = call i32 @pow(double %7, double %8)
%10 = load double, double* %4
%11 = load double, double* %5
%12 = call i32 @pow(double %10, double %11)
%13 = load double, double* %6
%14 = load double, double* %5
%15 = call i32 @pow(double %13, double %14)
%16 = add nsw i32 %12, %15
%17 = sdiv i32 %9, %16
%18 = load double, double* %6
%19 = load double, double* %5
%20 = call i32 @pow(double %18, double %19)
%21 = add nsw i32 1, %20
%22 = mul nsw i32 %17, %21
%23 = sitofp i32 %22 to double
ret double %23
}

LLVM IR (-O2):
define double @normHill(double %0, double %1, double %2) {
%4 = tail call i32 @pow(double %0, double %1)
%5 = tail call i32 @pow(double %0, double %1)
%6 = tail call i32 @pow(double %2, double %1)
%7 = add nsw i32 %6, %5
%8 = sdiv i32 %4, %7
%9 = tail call i32 @pow(double %2, double %1)
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %10, %8
%12 = sitofp i32 %11 to double
ret double %12
}
void __bitmap_and(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__bitmap_and>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bitmap_and>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__bitmap_and = [13 x i8] c"__bitmap_and\00"
define void @__bitmap_and() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.__bitmap_and, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__bitmap_and = [13 x i8] c"__bitmap_and\00"
define void @__bitmap_and() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.__bitmap_and, i64 0, i64 0))
ret void
}
int _get_zero_arr_size_char(const char *orig_x, unsigned int orig_offset) {
  const char *_gres_x = orig_x;
  unsigned int _gres = 0;
  if (_gres_x != 0) {
    _gres = orig_offset;
    _gres_x += orig_offset - 1;
    while (*_gres_x != 0) {
      _gres_x++;
      _gres++;
    }
  }
  return _gres;
}


x86 assembly (clang, -O0):
<_get_zero_arr_size_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116d <_get_zero_arr_size_char+0x6d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1168 <_get_zero_arr_size_char+0x68>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113e <_get_zero_arr_size_char+0x3e>
jmp    116d <_get_zero_arr_size_char+0x6d>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_zero_arr_size_char>:
test   %rdi,%rdi
je     112d <_get_zero_arr_size_char+0x2d>
mov    %esi,%eax
lea    -0x1(%rax),%ecx
cmpb   $0x0,(%rdi,%rcx,1)
je     112c <_get_zero_arr_size_char+0x2c>
add    %rdi,%rcx
add    $0x1,%rcx
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1120 <_get_zero_arr_size_char+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_get_zero_arr_size_char(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = add i32 %1, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %4, %10
%11 = phi i32 [ %14, %10 ], [ %1, %4 ]
%12 = phi i8* [ %13, %10 ], [ %7, %4 ]
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = add i32 %11, 1
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %10
17: ; preds = %10, %4, %2
%18 = phi i32 [ 0, %2 ], [ %1, %4 ], [ %14, %10 ]
ret i32 %18
}
unsigned int get_instruction(unsigned int address, unsigned int *table) {
  return table[address >> 1];
}


x86 assembly (clang, -O0):
<get_instruction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_instruction>:
shr    %edi
mov    (%rsi,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @get_instruction(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %3
%7 = lshr i32 %6, 1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_instruction(i32 %0, i32* nocapture %1) {
%3 = lshr i32 %0, 1
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall_cp(int, int, struct iovec const *, int);
ssize_t readv(int fd, const struct iovec *iov, int count) {
  return syscall_cp(145, fd, iov, count);
}


x86 assembly (clang, -O0):
<readv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x91,%edi
call   1030 <syscall_cp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readv>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x91,%edi
jmp    1030 <syscall_cp@plt>

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @readv(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.iovec*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.iovec* %1, %struct.iovec** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.iovec*, %struct.iovec** %5
%9 = load i32, i32* %6
%10 = call i32 @syscall_cp(i32 145, i32 %7, %struct.iovec* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @readv(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = tail call i32 @syscall_cp(i32 145, i32 %0, %struct.iovec* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void delay() {
  struct timespec t;
  t.tv_sec = 0;
  t.tv_nsec = 10000000;
  nanosleep(&t, NULL);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x989680,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0x989680,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @delay() {
%1 = alloca %struct.timespec
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
store i64 0, i64* %2
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
store i32 10000000, i32* %3
%4 = call i32 @nanosleep(%struct.timespec* %1, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @delay() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 10000000, i32* %4
%5 = call i32 @nanosleep(%struct.timespec* %1, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sha3_256(int /*<<< orphan*/ *, int,
                            int /*<<< orphan*/ const *, size_t const);
void SHA3_256(uint8_t *ret, uint8_t const *data, size_t const size) {
  sha3_256(ret, 32, data, size);
}


x86 assembly (clang, -O0):
<SHA3_256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x20,%esi
call   1030 <sha3_256@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA3_256>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x20,%esi
jmp    1030 <sha3_256@plt>

LLVM IR (-O0):
define void @SHA3_256(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i64, i64* %6
%10 = call i32 @sha3_256(i32* %7, i32 32, i32* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @SHA3_256(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32 @sha3_256(i32* %0, i32 32, i32* %1, i64 %2)
ret void
}
void sendReceive(int connection_fd, struct nodelist *noderoot,
                 struct pkglist *pkgroot, struct route *routes,
                 short node_role) {}


x86 assembly (clang, -O0):
<sendReceive>:
push   %rbp
mov    %rsp,%rbp
mov    %r8w,%ax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %ax,-0x22(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.nodelist = type opaque
%struct.pkglist = type opaque
%struct.route = type opaque
define void @sendReceive(i32 %0, %struct.nodelist* %1, %struct.pkglist* %2, %struct.route* %3, i16 signext %4) {
%6 = alloca i32
%7 = alloca %struct.nodelist*
%8 = alloca %struct.pkglist*
%9 = alloca %struct.route*
%10 = alloca i16
store i32 %0, i32* %6
store %struct.nodelist* %1, %struct.nodelist** %7
store %struct.pkglist* %2, %struct.pkglist** %8
store %struct.route* %3, %struct.route** %9
store i16 %4, i16* %10
ret void
}

LLVM IR (-O2):
%struct.nodelist = type opaque
%struct.pkglist = type opaque
%struct.route = type opaque
define void @sendReceive(i32 %0, %struct.nodelist* nocapture %1, %struct.pkglist* nocapture %2, %struct.route* nocapture %3, i16 signext %4) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ferror(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundcets_ferror(FILE *stream) {
  return ferror(stream);
}


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

x86 assembly (clang, -O2):
<softboundcets_ferror>:
jmp    1030 <ferror@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_ferror(i32* %0) {
%2 = tail call i32 @ferror(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *x_realloc(void *ptr, size_t size) {
  void *p = realloc(ptr, size);
  if (p == NULL) {
    perror("failed to reallocate memory");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<x_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <x_realloc+0x46>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_realloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <x_realloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"failed to reallocate memory\00"
@EXIT_FAILURE = global i32 0
define i8* @x_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [28 x i8] c"failed to reallocate memory\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @x_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *ltrim(char *);
char *rtrim(char *);
char *trim(char *s) {
  char *r, *t;
  t = ltrim(s);
  r = rtrim(t);
  free(t);
  return r;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ltrim@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <rtrim@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %r14
push   %rbx
push   %rax
call   1050 <ltrim@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <rtrim@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @trim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @ltrim(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i8* @rtrim(i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @trim(i8* %0) {
%2 = tail call i8* @ltrim(i8* %0)
%3 = tail call i8* @rtrim(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void frag_four() {
  printf("while (( i *= 2 ) < N);\n");
  int i = 1;
  while ((i *= 2) < 6)
    printf("Cos i wartosc i = %d \n", i);
}


x86 assembly (clang, -O0):
<frag_four>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x6,%eax
jge    1155 <frag_four+0x45>
mov    -0x4(%rbp),%esi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112d <frag_four+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frag_four>:
push   %rbx
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"while (( i *= 2 ) < N);\0A\00"
@.str.1 = [23 x i8] c"Cos i wartosc i = %d \0A\00"
define void @frag_four() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, 2
store i32 %5, i32* %1
%6 = icmp slt i32 %5, 6
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"Cos i wartosc i = %d \0A\00"
@str = [24 x i8] c"while (( i *= 2 ) < N);\00"
define void @frag_four() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 2)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 4)
ret void
}
/* Variables and functions */
scalar_t__ read_body();
scalar_t__ read_head();
scalar_t__ read_title();
int process_next_article() {
  return !(read_head() || read_title() || read_body());
}


x86 assembly (clang, -O0):
<process_next_article>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <read_head@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    117b <process_next_article+0x4b>
mov    $0x0,%al
call   1030 <read_title@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    117b <process_next_article+0x4b>
mov    $0x0,%al
call   1050 <read_body@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_next_article>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <read_head@plt>
test   %rax,%rax
jne    115c <process_next_article+0x2c>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <read_title@plt>
test   %rax,%rax
jne    115c <process_next_article+0x2c>
xor    %eax,%eax
call   1050 <read_body@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @process_next_article() {
%1 = call i64 (...) @read_head()
%2 = icmp ne i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = call i64 (...) @read_title()
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = call i64 (...) @read_body()
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ true, %3 ], [ true, %0 ], [ %8, %6 ]
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @process_next_article() {
%1 = tail call i64 (...) @read_head()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 (...) @read_title()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 (...) @read_body()
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 0, %3 ], [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long,
                           unsigned long, unsigned long, size_t);
int /*<<< orphan*/ stdout;
int do_trade(unsigned long buyer, unsigned long seller, unsigned long price,
             size_t size) {
  fprintf(stdout, "Buyer %lu Seller %lu, price %lu, size %zu\n", buyer, seller,
          price, size);
  return 0;
}


x86 assembly (clang, -O0):
<do_trade>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_trade>:
push   %rax
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [43 x i8] c"Buyer %lu Seller %lu, price %lu, size %zu\0A\00"
define i32 @do_trade(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i32, i32* @stdout
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %10, i64 %11, i64 %12, i64 %13)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [43 x i8] c"Buyer %lu Seller %lu, price %lu, size %zu\0A\00"
define i32 @do_trade(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1, i64 %2, i64 %3)
ret i32 0
}
/* Variables and functions */
double *calloc(int, size_t);
double *allocVect(int sz) {
  double *ret;
  ret = calloc(sizeof(double), (size_t)sz);
  return ret;
}


x86 assembly (clang, -O0):
<allocVect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rsi
mov    $0x8,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocVect>:
movslq %edi,%rsi
mov    $0x8,%edi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define double* @allocVect(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call double* @calloc(i32 8, i64 %5)
store double* %6, double** %3
%7 = load double*, double** %3
ret double* %7
}

LLVM IR (-O2):
define double* @allocVect(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call double* @calloc(i32 8, i64 %2)
ret double* %3
}
/* Variables and functions */
double p_gamma(double, double, double);
double q_gamma(double, double, double);
double f_erfc(double x) {
  return x >= 0.0 ? q_gamma(0.5, x * x, 1.14472988584940017 / 2.0)
                  : 1.0 + p_gamma(0.5, x * x, 1.14472988584940017 / 2.0);
}


x86 assembly (clang, -O0):
<f_erfc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1168 <f_erfc+0x48>
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xeb7(%rip),%xmm0
movsd  0xeb7(%rip),%xmm2
call   1040 <q_gamma@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    119b <f_erfc+0x7b>
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe8e(%rip),%xmm0
movsd  0xe8e(%rip),%xmm2
call   1030 <p_gamma@plt>
movaps %xmm0,%xmm1
movsd  0xe6e(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_erfc>:
push   %rax
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
mulsd  %xmm1,%xmm1
movsd  0xec7(%rip),%xmm0
movsd  0xec7(%rip),%xmm2
jae    1152 <f_erfc+0x32>
call   1030 <p_gamma@plt>
addsd  0xec0(%rip),%xmm0
pop    %rax
ret
pop    %rax
jmp    1040 <q_gamma@plt>

LLVM IR (-O0):
define double @f_erfc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = call double @q_gamma(double 5.000000e-01, double %8, double 0x3FE250D048E7A1BD)
br label %16
10: ; preds = %1
%11 = load double, double* %2
%12 = load double, double* %2
%13 = fmul double %11, %12
%14 = call double @p_gamma(double 5.000000e-01, double %13, double 0x3FE250D048E7A1BD)
%15 = fadd double 1.000000e+00, %14
br label %16
16: ; preds = %10, %5
%17 = phi double [ %9, %5 ], [ %15, %10 ]
ret double %17
}

LLVM IR (-O2):
define double @f_erfc(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = fmul double %0, %0
br i1 %2, label %6, label %4
4: ; preds = %1
%5 = tail call double @q_gamma(double 5.000000e-01, double %3, double 0x3FE250D048E7A1BD)
br label %9
6: ; preds = %1
%7 = tail call double @p_gamma(double 5.000000e-01, double %3, double 0x3FE250D048E7A1BD)
%8 = fadd double %7, 1.000000e+00
br label %9
9: ; preds = %6, %4
%10 = phi double [ %5, %4 ], [ %8, %6 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_dvector(double *v, long nl) { free((char *)(v + nl - 1)); }


x86 assembly (clang, -O0):
<free_dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dvector>:
lea    (%rdi,%rsi,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dvector(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
%5 = load double*, double** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds double, double* %5, i64 %6
%8 = getelementptr inbounds double, double* %7, i64 -1
%9 = bitcast double* %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @free_dvector(double* nocapture %0, i64 %1) {
%3 = getelementptr inbounds double, double* %0, i64 %1
%4 = getelementptr inbounds double, double* %3, i64 -1
%5 = bitcast double* %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void to_bigendian(uint8_t *buffer, uint32_t n) {
  buffer[0] = (n >> 24) & 0xff;
  buffer[1] = (n >> 16) & 0xff;
  buffer[2] = (n >> 8) & 0xff;
  buffer[3] = n & 0xff;
}


x86 assembly (clang, -O0):
<to_bigendian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_bigendian>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @to_bigendian(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = and i32 %20, 255
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 3
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
define void @to_bigendian(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
store i32 %3, i32* %0
%4 = lshr i32 %1, 16
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = and i32 %1, 255
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret void
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int cmp_blob(const void *x, const void *y) { return memcmp(x, y, 16 - 2); }


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

x86 assembly (clang, -O2):
<cmp_blob>:
mov    $0xe,%edx
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
define i32 @cmp_blob(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 = load i8*, i8** %4
%7 = call i32 @memcmp(i8* %5, i8* %6, i32 14)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cmp_blob(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 14)
ret i32 %3
}
/* Variables and functions */
int _f(int, int, double const, double const *);
double _I_31(const double omega, const double vertices_omegas[4]) {
  return _f(1, 3, omega, vertices_omegas) / 3;
}


x86 assembly (clang, -O0):
<_I_31>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <_f@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_I_31>:
push   %rax
mov    %rdi,%rdx
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <_f@plt>
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @_I_31(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = call i32 @_f(i32 1, i32 3, double %5, double* %6)
%8 = sdiv i32 %7, 3
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @_I_31(double %0, double* %1) {
%3 = tail call i32 @_f(i32 1, i32 3, double %0, double* %1)
%4 = sdiv i32 %3, 3
%5 = sitofp i32 %4 to double
ret double %5
}
/* Type definitions */
struct btf_type {
  int dummy;
};

/* Variables and functions */
scalar_t__ BTF_KIND_DATASEC;
scalar_t__ btf_kind(struct btf_type const *);
bool btf_is_datasec(const struct btf_type *t) {
  return btf_kind(t) == BTF_KIND_DATASEC;
}


x86 assembly (clang, -O0):
<btf_is_datasec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <btf_kind@plt>
mov    0x2eb4(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btf_is_datasec>:
push   %rax
call   1030 <btf_kind@plt>
mov    0x2ec3(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.btf_type = type { i32 }
@BTF_KIND_DATASEC = global i64 0
define i32 @btf_is_datasec(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = call i64 @btf_kind(%struct.btf_type* %3)
%5 = load i64, i64* @BTF_KIND_DATASEC
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
@BTF_KIND_DATASEC = global i64 0
define i32 @btf_is_datasec(%struct.btf_type* %0) {
%2 = tail call i64 @btf_kind(%struct.btf_type* %0)
%3 = load i64, i64* @BTF_KIND_DATASEC
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_REVOKED;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_REVOKED_it;
X509_REVOKED *d2i_X509_REVOKED(X509_REVOKED **a, const unsigned char **in,
                               long len) {
  return (X509_REVOKED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                       &X509_REVOKED_it);
}


x86 assembly (clang, -O0):
<d2i_X509_REVOKED>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_X509_REVOKED>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@X509_REVOKED_it = global i32 0
define i32* @d2i_X509_REVOKED(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @X509_REVOKED_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@X509_REVOKED_it = global i32 0
define i32* @d2i_X509_REVOKED(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @X509_REVOKED_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_add(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ t16_data_imm8_op();
void t16_add_imm8() { arm_arith_add(t16_data_imm8_op(), 0); }


x86 assembly (clang, -O0):
<t16_add_imm8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <t16_data_imm8_op@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <arm_arith_add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_add_imm8>:
push   %rax
xor    %eax,%eax
call   1030 <t16_data_imm8_op@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <arm_arith_add@plt>

LLVM IR (-O0):
define void @t16_add_imm8() {
%1 = call i32 (...) @t16_data_imm8_op()
%2 = call i32 @arm_arith_add(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @t16_add_imm8() {
%1 = tail call i32 (...) @t16_data_imm8_op()
%2 = tail call i32 @arm_arith_add(i32 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
unsigned pixie_get_mac_address(unsigned char macaddr[6]) {
  memset(macaddr, 0, 6);
  return -1;
  return -1;
}


x86 assembly (clang, -O0):
<pixie_get_mac_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <memset@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixie_get_mac_address>:
push   %rax
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <memset@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pixie_get_mac_address(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 6)
ret i32 -1
}