xunge/DecIR huggingface dataset:
int cmp_double_asc(const void *x, const void *y) {
  if (*(double *)x < *(double *)y) {
    return -1;
  } else if (*(double *)x > *(double *)y) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp_double_asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <cmp_double_asc+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <cmp_double_asc+0x60>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1154 <cmp_double_asc+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1160 <cmp_double_asc+0x60>
jmp    1159 <cmp_double_asc+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_double_asc>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_double_asc(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp olt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %25
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp ogt double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 1, i32* %3
br label %25
23: ; preds = %14
br label %24
24: ; preds = %23
store i32 0, i32* %3
br label %25
25: ; preds = %24, %22, %13
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @cmp_double_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int usage(const char *argv0) {
  printf("%s:%d:%s\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/nibaozhu/mycode/refs/heads/master/src/test/"
         "test_client.c",
         35, __func__);
  return printf("%s [address] [port]\n", argv0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x23,%edx
lea    0xf67(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
lea    0xee8(%rip),%rsi
lea    0xf74(%rip),%rcx
mov    $0x23,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf67(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s:%d:%s\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nibaozhu/mycode/refs/heads/master/src/test/test_client.c\00"
@__func__.usage = [6 x i8] c"usage\00"
@.str.2 = [21 x i8] c"%s [address] [port]\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.usage, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s:%d:%s\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nibaozhu/mycode/refs/heads/master/src/test/test_client.c\00"
@__func__.usage = [6 x i8] c"usage\00"
@.str.2 = [21 x i8] c"%s [address] [port]\0A\00"
define i32 @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.usage, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret i32 %3
}
/* Variables and functions */
int dotproduct(int *, int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int firstvec[] = {1, 1, 1};
  int secondvec[] = {1, 1, 2};
  int dimention = 3;
  printf("%d\n", dotproduct(&firstvec[0], &secondvec[0], 3));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xec9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec7(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x3,-0x1c(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x3,%edx
call   1030 <dotproduct@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x20(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x18(%rsp)
mov    0xed4(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xec1(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x18(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x3,%edx
call   1030 <dotproduct@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.firstvec = [3 x i32] [i32 1, i32 1, i32 1]
@__const.main.secondvec = [3 x i32] [i32 1, i32 1, i32 2]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = alloca i32
%4 = bitcast [3 x i32]* %1 to i8*
%5 = bitcast [3 x i32]* %2 to i8*
store i32 3, i32* %3
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%8 = call i32 @dotproduct(i32* %6, i32* %7, i32 3)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.firstvec = [3 x i32] [i32 1, i32 1, i32 1]
@__const.main.secondvec = [3 x i32] [i32 1, i32 1, i32 2]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = call i32 @dotproduct(i32* %5, i32* %6, i32 3)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
unsigned char dxl_read_byte(unsigned char, int);
unsigned char getCWComplianceMargin(unsigned char id) {
  return dxl_read_byte(id, (26));
}


x86 assembly (clang, -O0):
<getCWComplianceMargin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1a,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_byte@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCWComplianceMargin>:
mov    $0x1a,%esi
jmp    1030 <dxl_read_byte@plt>

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

LLVM IR (-O2):
define zeroext i8 @getCWComplianceMargin(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_byte(i8 zeroext %0, i32 26)
ret i8 %2
}
int test_imm_81int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x81 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_81int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x81,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_81int64_midword_mem>:
testb  $0x81,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_81int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 129
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_81int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8454144
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xe4() {
  Assert_real((isalnum(228) == 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_isalnum.c",
              1145, ("isalnum should be 0 for 0xe4"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xe4>:
push   %rax
mov    $0xe4,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x479,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xe4\00"
define void @t_isalnum_0xe4() {
%1 = call i64 @isalnum(i32 228)
%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 1145, i8* getelementptr inbounds ([29 x i8], [29 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xe4\00"
define void @t_isalnum_0xe4() {
%1 = tail call i64 @isalnum(i32 228)
%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 1145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool is_symbol(int c) {
  switch (c) {
  case '+':
  case '-':
  case '*':
  case '/':
  case '%':
  case '$':
  case '~':
  case ',':
  case '(':
  case ')':
  case '[':
  case ']':
  case '^':
  case ';':
  case ':':
  case '|':
  case '&':
  case '=':
  case '!':
  case '<':
  case '>':
    return true;
  default:
    return false;
  }
}


x86 assembly (clang, -O0):
<is_symbol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffdf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5d,%eax
ja     113c <is_symbol+0x3c>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1143 <is_symbol+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_symbol>:
add    $0xffffffdf,%edi
cmp    $0x5d,%edi
ja     111e <is_symbol+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_symbol(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 43, label %5
i32 45, label %5
i32 42, label %5
i32 47, label %5
i32 37, label %5
i32 36, label %5
i32 126, label %5
i32 44, label %5
i32 40, label %5
i32 41, label %5
i32 91, label %5
i32 93, label %5
i32 94, label %5
i32 59, label %5
i32 58, label %5
i32 124, label %5
i32 38, label %5
i32 61, label %5
i32 33, label %5
i32 60, label %5
i32 62, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_symbol(i32 %0) {
switch i32 %0, label %2 [
i32 43, label %3
i32 45, label %3
i32 42, label %3
i32 47, label %3
i32 37, label %3
i32 36, label %3
i32 126, label %3
i32 44, label %3
i32 40, label %3
i32 41, label %3
i32 91, label %3
i32 93, label %3
i32 94, label %3
i32 59, label %3
i32 58, label %3
i32 124, label %3
i32 38, label %3
i32 61, label %3
i32 33, label %3
i32 60, label %3
i32 62, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int rand();
uint64_t rand64() {
  uint64_t x = 0;
  for (int i = 0; i < 8; i++) {
    x <<= 8;
    x |= rand() & 0xff;
  }
  return x;
}


x86 assembly (clang, -O0):
<rand64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1159 <rand64+0x49>
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <rand64+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand64>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
shl    $0x18,%ebx
movzbl %bpl,%ecx
shl    $0x10,%ecx
or     %ebx,%ecx
shl    $0x8,%eax
movzwl %ax,%ebx
or     %ecx,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
movzbl %al,%eax
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand64() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 8
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
%8 = shl i32 %7, 8
store i32 %8, i32* %1
%9 = call i32 (...) @rand()
%10 = and i32 %9, 255
%11 = load i32, i32* %1
%12 = or i32 %11, %10
store i32 %12, i32* %1
br label %13
13: ; preds = %6
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @rand64() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 (...) @rand()
%3 = tail call i32 (...) @rand()
%4 = tail call i32 (...) @rand()
%5 = tail call i32 (...) @rand()
%6 = tail call i32 (...) @rand()
%7 = tail call i32 (...) @rand()
%8 = shl i32 %5, 24
%9 = shl i32 %6, 16
%10 = and i32 %9, 16711680
%11 = or i32 %8, %10
%12 = shl i32 %7, 8
%13 = and i32 %12, 65280
%14 = or i32 %11, %13
%15 = tail call i32 (...) @rand()
%16 = and i32 %15, 255
%17 = or i32 %16, %14
ret i32 %17
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *__libc_calloc(size_t nmemb, size_t size) { return calloc(nmemb, size); }


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

x86 assembly (clang, -O2):
<__libc_calloc>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @__libc_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i8* @calloc(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @__libc_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
int test_imm_CBuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xCB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CBuint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xcb,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CBuint64_lowword_mem>:
testb  $0xcb,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CBuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 203
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_CBuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 203
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int f() {
  int var = 7;
  if ((var / 7) == 1)
    return var / 7;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x1,%eax
jne    1132 <f+0x32>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1139 <f+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @f() {
ret i32 1
}
/* Variables and functions */
size_t aesgcm_calc_ghash_cnt(size_t capacity) {
  return (capacity + 15) / 16 + 2;
}


x86 assembly (clang, -O0):
<aesgcm_calc_ghash_cnt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xf,%rax
shr    $0x4,%rax
add    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aesgcm_calc_ghash_cnt>:
lea    0xf(%rdi),%rax
shr    $0x4,%rax
add    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @aesgcm_calc_ghash_cnt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 15
%5 = udiv i64 %4, 16
%6 = add i64 %5, 2
ret i64 %6
}

LLVM IR (-O2):
define i64 @aesgcm_calc_ghash_cnt(i64 %0) {
%2 = add i64 %0, 15
%3 = lshr i64 %2, 4
%4 = add nuw nsw i64 %3, 2
ret i64 %4
}
/* Type definitions */
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
int32_t mult32u16(int32_t x, uint16_t y) {
  int32_t z;
  z = ((int32_t)y * (uint16_t)x) >> 16;
  z += ((int32_t)(x >> 16) * y);
  return z;
}


x86 assembly (clang, -O0):
<mult32u16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult32u16>:
mov    %esi,%eax
imul   %edi,%eax
sar    $0x10,%eax
sar    $0x10,%edi
imul   %esi,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @mult32u16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = ashr i32 %8, 16
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = ashr i32 %10, 16
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %5
%15 = add nsw i32 %14, %13
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @mult32u16(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = ashr i32 %3, 16
%5 = ashr i32 %0, 16
%6 = mul nsw i32 %5, %1
%7 = add nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ finish();
GS_step4() { finish(); }


x86 assembly (clang, -O0):
<GS_step4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <finish@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GS_step4>:
xor    %eax,%eax
jmp    1030 <finish@plt>

LLVM IR (-O0):
define i32 @GS_step4() {
%1 = alloca i32
%2 = call i32 (...) @finish()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @GS_step4() {
%1 = tail call i32 (...) @finish()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ b();
int main(int argc, char *argv[]) {
  a();
  b();
  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)
mov    $0x0,%al
call   1040 <a@plt>
mov    $0x0,%al
call   1030 <b@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <a@plt>
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @a()
%7 = call i32 (...) @b()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @a()
%4 = tail call i32 (...) @b()
ret i32 0
}
/* Variables and functions */
int strlen(char *);
char *strndup(char *, int);
void strndup_2_Bad() {
  char s1[] = "Hello Infer!";
  int len = strlen(s1);
  s1[5] = '\0';
  char *s2 = strndup(s1, len);
  for (int i = 0; i < len; i++) {
    s2[i] = 'a';
  }
}


x86 assembly (clang, -O0):
<strndup_2_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xd(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
movb   $0x0,-0x8(%rbp)
lea    -0xd(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <strndup@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1192 <strndup_2_Bad+0x72>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x61,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    116c <strndup_2_Bad+0x4c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup_2_Bad>:
sub    $0x18,%rsp
movabs $0x217265666e4920,%rax
mov    %rax,0xd(%rsp)
movabs $0x6e49206f6c6c6548,%rax
20 49 6e
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <strlen@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.strndup_2_Bad.s1 = [13 x i8] c"Hello Infer!\00"
define void @strndup_2_Bad() {
%1 = alloca [13 x i8]
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = bitcast [13 x i8]* %1 to i8*
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %2
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 5
store i8 0, i8* %8
%9 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%10 = load i32, i32* %2
%11 = call i8* @strndup(i8* %9, i32 %10)
store i8* %11, i8** %3
store i32 0, i32* %4
br label %12
12: ; preds = %21, %0
%13 = load i32, i32* %4
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 97, i8* %20
br label %21
21: ; preds = %16
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %12
24: ; preds = %12
ret void
}

LLVM IR (-O2):
@__const.strndup_2_Bad.s1 = [13 x i8] c"Hello Infer!\00"
define void @strndup_2_Bad() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
ret void
}
/* Variables and functions */
float pow2f(int /*<<< orphan*/);
int /*<<< orphan*/ pow3f(float);
float pow7f(float x) { return pow2f(pow3f(x)) * x; }


x86 assembly (clang, -O0):
<pow7f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <pow3f@plt>
mov    %eax,%edi
call   1030 <pow2f@plt>
mulss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow7f>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1040 <pow3f@plt>
mov    %eax,%edi
call   1030 <pow2f@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @pow7f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @pow3f(float %3)
%5 = call float @pow2f(i32 %4)
%6 = load float, float* %2
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @pow7f(float %0) {
%2 = tail call i32 @pow3f(float %0)
%3 = tail call float @pow2f(i32 %2)
%4 = fmul float %3, %0
ret float %4
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int isVerified(char password[]) {
  int ok = 0;
  char buffer[10];
  strcpy(buffer, password);
  if (strcmp(buffer, "qwerty123") == 0)
    ok = 1;
  return ok;
}


x86 assembly (clang, -O0):
<isVerified>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x16(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x16(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1161 <isVerified+0x41>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isVerified>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"qwerty123\00"
define i32 @isVerified(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [10 x i8]
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %3
br label %12
12: ; preds = %11, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [10 x i8] c"qwerty123\00"
define i32 @isVerified(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int ppp_get_codes_per_row(const int codelength) {
  const int _len_to_codes[] = {
      -1, -1, 11, 8, 7, 5, 5, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2,
  };
  assert(codelength >= 2);
  assert(codelength <= 16);
  return _len_to_codes[codelength];
}


x86 assembly (clang, -O0):
<ppp_get_codes_per_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x44,%edx
call   1040 <memcpy@plt>
cmpl   $0x2,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x10,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movslq -0x4(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppp_get_codes_per_row>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x2,%ebx
setge  %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x11,%ebx
setl   %dil
call   1030 <assert@plt>
movslq %ebx,%rax
lea    0xec7(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.ppp_get_codes_per_row._len_to_codes = [17 x i32] [i32 -1, i32 -1, i32 11, i32 8, i32 7, i32 5, i32 5, i32 4, i32 3, i32 3, i32 3, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2]
define i32 @ppp_get_codes_per_row(i32 %0) {
%2 = alloca i32
%3 = alloca [17 x i32]
store i32 %0, i32* %2
%4 = bitcast [17 x i32]* %3 to i8*
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 16
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [17 x i32], [17 x i32]* %3, i64 0, i64 %14
%16 = load i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
@__const.ppp_get_codes_per_row._len_to_codes = [17 x i32] [i32 -1, i32 -1, i32 11, i32 8, i32 7, i32 5, i32 5, i32 4, i32 3, i32 3, i32 3, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2]
define i32 @ppp_get_codes_per_row(i32 %0) {
%2 = icmp sgt i32 %0, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp slt i32 %0, 17
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = sext i32 %0 to i64
%9 = getelementptr inbounds [17 x i32], [17 x i32]* @__const.ppp_get_codes_per_row._len_to_codes, i64 0, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
double difftime(time_t t1, time_t t0) { return (double)t1 - (double)t0; }


x86 assembly (clang, -O0):
<difftime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<difftime>:
cvtsi2sd %rdi,%xmm0
cvtsi2sd %rsi,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @difftime(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = sitofp i64 %5 to double
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to double
%9 = fsub double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @difftime(i64 %0, i64 %1) {
%3 = sitofp i64 %0 to double
%4 = sitofp i64 %1 to double
%5 = fsub double %3, %4
ret double %5
}
/* Variables and functions */
int LOG_DEBUG;
int LOG_USER;
int /*<<< orphan*/ syslog(int, char *);
int main() {
  syslog(LOG_USER | LOG_DEBUG, "valgrind/none/tests/syslog: test message");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea9(%rip),%rax
or     (%rax),%edi
lea    0xec8(%rip),%rsi
call   1030 <syslog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
lea    0xed6(%rip),%rsi
call   1030 <syslog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LOG_USER = global i32 0
@LOG_DEBUG = global i32 0
@.str = [41 x i8] c"valgrind/none/tests/syslog: test message\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @LOG_USER
%3 = load i32, i32* @LOG_DEBUG
%4 = or i32 %2, %3
%5 = call i32 @syslog(i32 %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@LOG_USER = global i32 0
@LOG_DEBUG = global i32 0
@.str = [41 x i8] c"valgrind/none/tests/syslog: test message\00"
define i32 @main() {
%1 = load i32, i32* @LOG_USER
%2 = load i32, i32* @LOG_DEBUG
%3 = or i32 %2, %1
%4 = tail call i32 @syslog(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
uint32_t rotateL_fun_uint32_t(uint32_t x, int32_t i) {
  if ((i %= 32) == 0)
    return x;
  return (x << i) | (x >> (32 - i));
}


x86 assembly (clang, -O0):
<rotateL_fun_uint32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmp    $0x0,%edx
jne    112c <rotateL_fun_uint32_t+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <rotateL_fun_uint32_t+0x48>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateL_fun_uint32_t>:
lea    0x1f(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
and    $0xffffffe0,%eax
sub    %eax,%esi
mov    %edi,%edx
mov    %esi,%ecx
shl    %cl,%edx
neg    %cl
mov    %edi,%eax
sar    %cl,%eax
or     %edx,%eax
test   %esi,%esi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotateL_fun_uint32_t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 32
store i32 %7, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %20
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = shl i32 %12, %13
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = sub nsw i32 32, %16
%18 = ashr i32 %15, %17
%19 = or i32 %14, %18
store i32 %19, i32* %3
br label %20
20: ; preds = %11, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @rotateL_fun_uint32_t(i32 %0, i32 %1) {
%3 = srem i32 %1, 32
%4 = icmp eq i32 %3, 0
%5 = shl i32 %0, %3
%6 = sub nsw i32 32, %3
%7 = ashr i32 %0, %6
%8 = or i32 %7, %5
%9 = select i1 %4, i32 %0, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fastscan(int *);
int /*<<< orphan*/ printf(char *, unsigned long);
unsigned long solve(int);
int main() {
  int t;
  fastscan(&t);
  while (t--) {
    int n = 0;
    fastscan(&n);
    unsigned long res = solve(n);
    printf("%ld\n", res);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <fastscan@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     118d <main+0x5d>
movl   $0x0,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <fastscan@plt>
mov    -0xc(%rbp),%edi
call   1030 <solve@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
jmp    1148 <main+0x18>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <fastscan@plt>
subl   $0x1,0x4(%rsp)
jb     1179 <main+0x49>
mov    %rsp,%r14
lea    0xeb1(%rip),%rbx
nop
movl   $0x0,(%rsp)
mov    %r14,%rdi
call   1050 <fastscan@plt>
mov    (%rsp),%edi
call   1030 <solve@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
subl   $0x1,0x4(%rsp)
jae    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 @fastscan(i32* %2)
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %16
10: ; preds = %6
store i32 0, i32* %3
%11 = call i32 @fastscan(i32* %3)
%12 = load i32, i32* %3
%13 = call i64 @solve(i32 %12)
store i64 %13, i64* %4
%14 = load i64, i64* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %14)
br label %6
16: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = call i32 @fastscan(i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -1
store i32 %6, i32* %1
%7 = icmp eq i32 %5, 0
br i1 %7, label %18, label %8
8: ; preds = %0
%9 = bitcast i32* %2 to i8*
br label %10
10: ; preds = %8, %10
store i32 0, i32* %2
%11 = call i32 @fastscan(i32* %2)
%12 = load i32, i32* %2
%13 = call i64 @solve(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = load i32, i32* %1
%16 = add nsw i32 %15, -1
store i32 %16, i32* %1
%17 = icmp eq i32 %15, 0
br i1 %17, label %18, label %10
18: ; preds = %10, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int /*<<< orphan*/);
int /*<<< orphan*/ IntUnregister(int /*<<< orphan*/);
int /*<<< orphan*/ _SSIIntNumberGet(int /*<<< orphan*/);
void SSIIntUnregister(uint32_t ui32Base) {
  uint32_t ui32Int;
  ;
  ui32Int = _SSIIntNumberGet(ui32Base);
  ;
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<SSIIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <_SSIIntNumberGet@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <IntDisable@plt>
mov    -0x8(%rbp),%edi
call   1040 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIIntUnregister>:
push   %rbx
call   1050 <_SSIIntNumberGet@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @SSIIntUnregister(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_SSIIntNumberGet(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @IntDisable(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @IntUnregister(i32 %8)
ret void
}

LLVM IR (-O2):
define void @SSIIntUnregister(i32 %0) {
%2 = tail call i32 @_SSIIntNumberGet(i32 %0)
%3 = tail call i32 @IntDisable(i32 %2)
%4 = tail call i32 @IntUnregister(i32 %2)
ret void
}
long double imms_average_winc(long double avg, long double add,
                              long double count, long double inc) {
  return (avg * (count / (count + inc))) + (add / (count + inc));
}


x86 assembly (clang, -O0):
<imms_average_winc>:
push   %rbp
mov    %rsp,%rbp
fldt   0x40(%rbp)
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fstpt  -0x40(%rbp)
fldt   -0x10(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fadd   %st(1),%st
fdivr  %st,%st(1)
fldt   -0x20(%rbp)
fdivp  %st,%st(1)
fxch   %st(2)
fmulp  %st,%st(1)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<imms_average_winc>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fldt   0x38(%rsp)
fldt   0x28(%rsp)
fadd   %st,%st(1)
fdiv   %st(1),%st
fmulp  %st,%st(3)
fdivrp %st,%st(1)
faddp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @imms_average_winc(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2, x86_fp80 %3) {
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca x86_fp80
%8 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %5
store x86_fp80 %1, x86_fp80* %6
store x86_fp80 %2, x86_fp80* %7
store x86_fp80 %3, x86_fp80* %8
%9 = load x86_fp80, x86_fp80* %5
%10 = load x86_fp80, x86_fp80* %7
%11 = load x86_fp80, x86_fp80* %7
%12 = load x86_fp80, x86_fp80* %8
%13 = fadd x86_fp80 %11, %12
%14 = fdiv x86_fp80 %10, %13
%15 = load x86_fp80, x86_fp80* %6
%16 = load x86_fp80, x86_fp80* %7
%17 = load x86_fp80, x86_fp80* %8
%18 = fadd x86_fp80 %16, %17
%19 = fdiv x86_fp80 %15, %18
%20 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %9, x86_fp80 %14, x86_fp80 %19)
ret x86_fp80 %20
}

LLVM IR (-O2):
define x86_fp80 @imms_average_winc(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2, x86_fp80 %3) {
%5 = fadd x86_fp80 %2, %3
%6 = fdiv x86_fp80 %2, %5
%7 = fdiv x86_fp80 %1, %5
%8 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %0, x86_fp80 %6, x86_fp80 %7)
ret x86_fp80 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage() {
  fprintf(stderr, "Usage: snap [-s <sym-file>] <in-file> <out-file>\n");
  return -1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: snap [-s <sym-file>] <in-file> <out-file>\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: snap [-s <sym-file>] <in-file> <out-file>\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int *grayCode(int, int *);
int main(void) {
  int *res, n;
  res = grayCode(1, &n);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    -0x14(%rbp),%rsi
call   1030 <grayCode@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
call   1030 <grayCode@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32* @grayCode(i32 1, i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, double const);
bool cutils_cdar_DynamicArray_double_format(const double *i, char **b,
                                            size_t *s) {
  snprintf(*b, *s, "%lf", *i);
  return true;
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_double_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xebf(%rip),%rdx
call   1030 <snprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_double_format>:
push   %rax
mov    (%rsi),%rax
mov    (%rdx),%rsi
movsd  (%rdi),%xmm0
lea    0xede(%rip),%rdx
mov    %rax,%rdi
call   1030 <snprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @cutils_cdar_DynamicArray_double_format(double* %0, i8** %1, i64* %2) {
%4 = alloca double*
%5 = alloca i8**
%6 = alloca i64*
store double* %0, double** %4
store i8** %1, i8*** %5
store i64* %2, i64** %6
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = load i64*, i64** %6
%10 = load i64, i64* %9
%11 = load double*, double** %4
%12 = load double, double* %11
%13 = call i32 @snprintf(i8* %8, i64 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %12)
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @cutils_cdar_DynamicArray_double_format(double* nocapture %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = load double, double* %0
%7 = tail call i32 @snprintf(i8* %4, i64 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fread2();
int main() {
  fread2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fread2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <fread2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fread2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fread2()
ret i32 0
}
/* Type definitions */
struct cnfnode {
  int dummy;
};
struct cnfmodule {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int unparse_dhcp_leases(struct cnfmodule *cm, FILE *fptr,
                        struct cnfnode *cn_root) {
  fprintf(fptr, "(not yet implemented)\n");
  return 0;
}


x86 assembly (clang, -O0):
<unparse_dhcp_leases>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unparse_dhcp_leases>:
push   %rax
mov    %rsi,%rcx
lea    0xee5(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cnfmodule = type { i32 }
%struct.cnfnode = type { i32 }
@.str = [23 x i8] c"(not yet implemented)\0A\00"
define i32 @unparse_dhcp_leases(%struct.cnfmodule* %0, i32* %1, %struct.cnfnode* %2) {
%4 = alloca %struct.cnfmodule*
%5 = alloca i32*
%6 = alloca %struct.cnfnode*
store %struct.cnfmodule* %0, %struct.cnfmodule** %4
store i32* %1, i32** %5
store %struct.cnfnode* %2, %struct.cnfnode** %6
%7 = load i32*, i32** %5
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.cnfmodule = type { i32 }
%struct.cnfnode = type { i32 }
@.str = [23 x i8] c"(not yet implemented)\0A\00"
define i32 @unparse_dhcp_leases(%struct.cnfmodule* nocapture readnone %0, i32* nocapture %1, %struct.cnfnode* nocapture readnone %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 22, i64 1, i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *name) {
  printf("Usage for program %s\n", name);
  printf("3 arguments required: 1) quantity 2) wsz 3) hsz\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage for program %s\0A\00"
@.str.1 = [49 x i8] c"3 arguments required: 1) quantity 2) wsz 3) hsz\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage for program %s\0A\00"
@str = [48 x i8] c"3 arguments required: 1) quantity 2) wsz 3) hsz\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret void
}