xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse_string(char *);
int main(int argc, char **argv) {
  char input[] = "the sky is blue";
  printf("[before] input : %s\n", input);
  reverse_string(input);
  printf("[after]  input : %s\n", input);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse_string@plt>
lea    0xed4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.input = [16 x i8] c"the sky is blue\00"
@.str = [21 x i8] c"[before] input : %s\0A\00"
@.str.1 = [21 x i8] c"[after] input : %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [16 x i8]* %6 to i8*
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%11 = call i32 @reverse_string(i8* %10)
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.input = [16 x i8] c"the sky is blue\00"
@.str = [21 x i8] c"[before] input : %s\0A\00"
@.str.1 = [21 x i8] c"[after] input : %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @reverse_string(i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ss2scs(float);
void ss2scs_(float *spd) { ss2scs(*spd); }


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

x86 assembly (clang, -O2):
<ss2scs_>:
movss  (%rdi),%xmm0
jmp    1030 <ss2scs@plt>

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

LLVM IR (-O2):
define void @ss2scs_(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call i32 @ss2scs(float %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xfree(char *);
char *xstrdup(char *);
void set_value_string(char **dest, char *value) {
  if (*dest)
    xfree(*dest);
  *dest = xstrdup(value);
}


x86 assembly (clang, -O0):
<set_value_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114a <set_value_string+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <xfree@plt>
mov    -0x10(%rbp),%rdi
call   1040 <xstrdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_value_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1137 <set_value_string+0x17>
call   1030 <xfree@plt>
mov    %r14,%rdi
call   1040 <xstrdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @set_value_string(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** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = call i32 @xfree(i8* %10)
br label %12
12: ; preds = %8, %2
%13 = load i8*, i8** %4
%14 = call i8* @xstrdup(i8* %13)
%15 = load i8**, i8*** %3
store i8* %14, i8** %15
ret void
}

LLVM IR (-O2):
define void @set_value_string(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @xfree(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = tail call i8* @xstrdup(i8* %1)
store i8* %8, i8** %0
ret void
}
double fmod(double val1, double val2) {
  int whole = val1 / val2;
  return val1 - (whole * val2);
}


x86 assembly (clang, -O0):
<fmod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm1
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod>:
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @fmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fdiv double %6, %7
%9 = fptosi double %8 to i32
store i32 %9, i32* %5
%10 = load double, double* %3
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to double
%13 = load double, double* %4
%14 = fneg double %12
%15 = call double @llvm.fmuladd.f64(double %14, double %13, double %10)
ret double %15
}

LLVM IR (-O2):
define double @fmod(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
%6 = fneg double %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %0)
ret double %7
}
/* Variables and functions */
int __WORDSIZE;
int /*<<< orphan*/ memcpy(unsigned long *, unsigned long const *, int);
void bitmap_copy(unsigned long *dst, const unsigned long *src, int nbits) {
  if (nbits <= __WORDSIZE)
    *dst = *src;
  else {
    int len = ((nbits + __WORDSIZE - 1) / __WORDSIZE) * sizeof(unsigned long);
    memcpy(dst, src, len);
  }
}


x86 assembly (clang, -O0):
<bitmap_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%eax
jg     1148 <bitmap_copy+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    117a <bitmap_copy+0x6a>
mov    -0x14(%rbp),%eax
mov    0x2e96(%rip),%rcx
add    (%rcx),%eax
sub    $0x1,%eax
mov    0x2e8a(%rip),%rcx
cltd
idivl  (%rcx)
cltq
shl    $0x3,%rax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_copy>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
cmp    %edx,%ecx
jge    1132 <bitmap_copy+0x22>
lea    (%rdx,%rcx,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %ecx
lea    0x0(,%rax,8),%edx
jmp    1030 <memcpy@plt>
mov    (%rsi),%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
@__WORDSIZE = global i32 0
define void @bitmap_copy(i64* %0, i64* %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i32
%7 = alloca i32
store i64* %0, i64** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* @__WORDSIZE
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i64*, i64** %5
%13 = load i64, i64* %12
%14 = load i64*, i64** %4
store i64 %13, i64* %14
br label %29
15: ; preds = %3
%16 = load i32, i32* %6
%17 = load i32, i32* @__WORDSIZE
%18 = add nsw i32 %16, %17
%19 = sub nsw i32 %18, 1
%20 = load i32, i32* @__WORDSIZE
%21 = sdiv i32 %19, %20
%22 = sext i32 %21 to i64
%23 = mul i64 %22, 8
%24 = trunc i64 %23 to i32
store i32 %24, i32* %7
%25 = load i64*, i64** %4
%26 = load i64*, i64** %5
%27 = load i32, i32* %7
%28 = call i32 @memcpy(i64* %25, i64* %26, i32 %27)
br label %29
29: ; preds = %15, %11
ret void
}

LLVM IR (-O2):
@__WORDSIZE = global i32 0
define void @bitmap_copy(i64* %0, i64* %1, i32 %2) {
%4 = load i32, i32* @__WORDSIZE
%5 = icmp slt i32 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = load i64, i64* %1
store i64 %7, i64* %0
br label %14
8: ; preds = %3
%9 = add nsw i32 %2, -1
%10 = add i32 %9, %4
%11 = sdiv i32 %10, %4
%12 = shl i32 %11, 3
%13 = tail call i32 @memcpy(i64* %0, i64* %1, i32 %12)
br label %14
14: ; preds = %8, %6
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int intcmp(const void *a, const void *b) {
  return (*(int32_t *)a - *(int32_t *)b);
}


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

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

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

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void test_5(unsigned char *x, unsigned int *y) { y[0] = x[1] >> 6; }


x86 assembly (clang, -O0):
<test_5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
sar    $0x6,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_5>:
movzbl 0x1(%rdi),%eax
shr    $0x6,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @test_5(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = lshr i8 %4, 6
%6 = zext i8 %5 to i32
store i32 %6, i32* %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t st103_get_epreg(uint8_t ep_num) {
  uint16_t *reg_p = (uint16_t *)((0x40005C00UL) + ep_num * 4);
  return *reg_p;
}


x86 assembly (clang, -O0):
<st103_get_epreg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
cltq
add    $0x40005c00,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st103_get_epreg>:
movslq %edi,%rax
mov    0x40005c00(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @st103_get_epreg(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 4
%6 = sext i32 %5 to i64
%7 = add i64 1073765376, %6
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @st103_get_epreg(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = sext i32 %2 to i64
%4 = add nsw i64 %3, 1073765376
%5 = inttoptr i64 %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int bounce(int);
foo(int k, int j, int z) {
  if (k > z) {
    if (j > k) {
      if (j > bounce(z))
        return j;
    }
  }
  return j + 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1169 <foo+0x59>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1164 <foo+0x54>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <bounce@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jle    115f <foo+0x4f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <foo+0x62>
jmp    1164 <foo+0x54>
jmp    1169 <foo+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %esi,%ebx
cmp    %edi,%esi
jle    1126 <foo+0x16>
cmp    %edx,%edi
jle    1126 <foo+0x16>
mov    %edx,%edi
call   1030 <bounce@plt>
cmp    %ebx,%eax
jl     1129 <foo+0x19>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %7
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = call i32 @bounce(i32 %17)
%19 = icmp sgt i32 %16, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i32, i32* %6
store i32 %21, i32* %4
br label %27
22: ; preds = %15
br label %23
23: ; preds = %22, %11
br label %24
24: ; preds = %23, %3
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %27
27: ; preds = %24, %20
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = icmp sgt i32 %1, %0
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 @bounce(i32 %2)
%9 = icmp slt i32 %8, %1
br i1 %9, label %12, label %10
10: ; preds = %7, %3
%11 = add nsw i32 %1, 1
br label %12
12: ; preds = %7, %10
%13 = phi i32 [ %11, %10 ], [ %1, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr,
          "usage:  %s [options]\n"
          "Parse input from stdin as JSON and ouput parsing details "
          "to stdout\n"
          "   -b  set the read buffer size\n"
          "   -c  allow comments\n"
          "   -g  allow *g*arbage after valid JSON text\n"
          "   -m  allows the parser to consume multiple JSON values\n"
          "       from a single string separated by whitespace\n"
          "   -p  partial JSON documents should not cause errors\n",
          progname);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [351 x i8] c"usage: %s [options]\0AParse input from stdin as JSON and ouput parsing details to stdout\0A -b set the read buffer size\0A -c allow comments\0A -g allow *g*arbage after valid JSON text\0A -m allows the parser to consume multiple JSON values\0A from a single string separated by whitespace\0A -p partial JSON documents should not cause errors\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([351 x i8], [351 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [351 x i8] c"usage: %s [options]\0AParse input from stdin as JSON and ouput parsing details to stdout\0A -b set the read buffer size\0A -c allow comments\0A -g allow *g*arbage after valid JSON text\0A -m allows the parser to consume multiple JSON values\0A from a single string separated by whitespace\0A -p partial JSON documents should not cause errors\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([351 x i8], [351 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
long ndb_chk_ptr(void *i_ptr, long *o_index) { return 0; }


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

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

LLVM IR (-O0):
define i64 @ndb_chk_ptr(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
ret i64 0
}

LLVM IR (-O2):
define i64 @ndb_chk_ptr(i8* nocapture readnone %0, i64* nocapture readnone %1) {
ret i64 0
}
void enable_interrupts(void) { asm("sti"); }


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

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

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

LLVM IR (-O2):
define void @enable_interrupts() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int ft_isdigit(int c) {
  if ((c > 47) && (c < 58))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2f,-0x8(%rbp)
jle    1127 <ft_isdigit+0x27>
cmpl   $0x3a,-0x8(%rbp)
jge    1127 <ft_isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long long osGetThreadID(void) {
  return (unsigned long long)pthread_self();
}


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

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

LLVM IR (-O0):
define i64 @osGetThreadID() {
%1 = call i64 (...) @pthread_self()
ret i64 %1
}

LLVM IR (-O2):
define i64 @osGetThreadID() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t
hci_subevent_le_connection_complete_get_conn_latency(const uint8_t *event) {
  return little_endian_read_16(event, 16);
}


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

x86 assembly (clang, -O2):
<hci_subevent_le_connection_complete_get_conn_latency>:
mov    $0x10,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @hci_subevent_le_connection_complete_get_conn_latency(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 16)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ register_capm_function_list();
void capm_init() { register_capm_function_list(); }


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

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

LLVM IR (-O0):
define void @capm_init() {
%1 = call i32 (...) @register_capm_function_list()
ret void
}

LLVM IR (-O2):
define void @capm_init() {
%1 = tail call i32 (...) @register_capm_function_list()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SSD1306_cleanBlue();
int /*<<< orphan*/ SSD1306_cleanYellow();
void SSD1306_cleanAll() {
  SSD1306_cleanBlue();
  SSD1306_cleanYellow();
}


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

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

LLVM IR (-O0):
define void @SSD1306_cleanAll() {
%1 = call i32 (...) @SSD1306_cleanBlue()
%2 = call i32 (...) @SSD1306_cleanYellow()
ret void
}

LLVM IR (-O2):
define void @SSD1306_cleanAll() {
%1 = tail call i32 (...) @SSD1306_cleanBlue()
%2 = tail call i32 (...) @SSD1306_cleanYellow()
ret void
}
void FTMR3PowerOn(void) {}


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

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

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

LLVM IR (-O2):
define void @FTMR3PowerOn() {
ret void
}
char *strchrnul(const char *s, int c) {
  int i = 0, last = 0;
  for (i = 0;; i++) {
    if (s[i] == 0 || s[i] == c)
      break;
  }
  return &s[i];
}


x86 assembly (clang, -O0):
<strchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114a <strchrnul+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0xc(%rbp),%eax
jne    114f <strchrnul+0x4f>
jmp    1162 <strchrnul+0x62>
jmp    1154 <strchrnul+0x54>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <strchrnul+0x20>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrnul>:
mov    %rdi,%rax
mov    $0xffffffffffffffff,%rcx
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax,%rcx,1),%edx
add    $0x1,%rcx
test   %edx,%edx
je     1121 <strchrnul+0x21>
cmp    %esi,%edx
jne    1110 <strchrnul+0x10>
mov    %ecx,%ecx
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strchrnul(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %11, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
%10 = or i1 %7, %9
%11 = add nuw i64 %4, 1
br i1 %10, label %12, label %3
12: ; preds = %3
%13 = and i64 %4, 4294967295
%14 = getelementptr inbounds i8, i8* %0, i64 %13
ret i8* %14
}
int cdrom_start(int trk, int loop) { return 0; }


x86 assembly (clang, -O0):
<cdrom_start>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cdrom_start(i32 %0, i32 %1) {
ret i32 0
}
void print_byte_array(char *buff, int length, int offset) {}


x86 assembly (clang, -O0):
<print_byte_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_byte_array(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int mktemp_internal(char *, int, int);
int mkstemps(char *path, int slen) { return (mktemp_internal(path, slen, 1)); }


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

x86 assembly (clang, -O2):
<mkstemps>:
mov    $0x1,%edx
jmp    1030 <mktemp_internal@plt>

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

LLVM IR (-O2):
define i32 @mkstemps(i8* %0, i32 %1) {
%3 = tail call i32 @mktemp_internal(i8* %0, i32 %1, i32 1)
ret i32 %3
}
int test_imm_51uint16_reg(unsigned short val) {
  return ((val) & (0x51 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_51uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x51,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_51uint16_reg>:
test   $0x51,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_51uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 81
%6 = icmp ne i32 %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_51uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 81
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void work(ip, jp) int *ip, *jp;
{
  *ip = 1;
  *jp = 2;
}


x86 assembly (clang, -O0):
<work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<work>:
movl   $0x1,(%rdi)
movl   $0x2,(%rsi)
ret

LLVM IR (-O0):
define void @work(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
store i32 1, i32* %5
%6 = load i32*, i32** %4
store i32 2, i32* %6
ret void
}

LLVM IR (-O2):
define void @work(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 1, i32* %0
store i32 2, i32* %1
ret void
}
/* Variables and functions */
double __nv_floor(double);
double floor(double __f) { return __nv_floor(__f); }


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

x86 assembly (clang, -O2):
<floor>:
jmp    1030 <__nv_floor@plt>

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

LLVM IR (-O2):
define double @floor(double %0) {
%2 = tail call double @__nv_floor(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ NEG();
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_ED_0x4c(void) {
  NEG();
  T_WAIT_UNTIL(4);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0x4c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <NEG@plt>
mov    $0x4,%edi
call   1030 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0x4c>:
push   %rax
xor    %eax,%eax
call   1040 <NEG@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_ED_0x4c() {
%1 = call i32 (...) @NEG()
%2 = call i32 @T_WAIT_UNTIL(i32 4)
ret void
}

LLVM IR (-O2):
define void @op_ED_0x4c() {
%1 = tail call i32 (...) @NEG()
%2 = tail call i32 @T_WAIT_UNTIL(i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ write_at_ble8(void *, int /*<<< orphan*/, size_t);
void write_at_be8(void *dest, uint8_t val, size_t offset) {
  write_at_ble8(dest, val, offset);
}


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

x86 assembly (clang, -O2):
<write_at_be8>:
jmp    1030 <write_at_ble8@plt>

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

LLVM IR (-O2):
define void @write_at_be8(i8* %0, i32 %1, i64 %2) {
%4 = tail call i32 @write_at_ble8(i8* %0, i32 %1, i64 %2)
ret void
}
int f(int *arr, int x) {
  if (x == 0)
    return arr[100];
  return f(arr, --x);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    113b <f+0x2b>
mov    -0x10(%rbp),%rax
mov    0x190(%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <f+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0x14(%rbp)
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(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 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 100
%11 = load i32, i32* %10
store i32 %11, i32* %3
br label %17
12: ; preds = %2
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = add nsw i32 %14, -1
store i32 %15, i32* %5
%16 = call i32 @f(i32* %13, i32 %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %12, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @f(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 100
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ thread_print_all();
void _ps_handler(int argc, char **argv) {
  (void)argc;
  (void)argv;
  thread_print_all();
}


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

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

LLVM IR (-O0):
define void @_ps_handler(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 (...) @thread_print_all()
ret void
}

LLVM IR (-O2):
define void @_ps_handler(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @thread_print_all()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tipo1();
int /*<<< orphan*/ tipo2();
int main(void) {
  tipo1();
  tipo2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tipo1()
%2 = tail call i32 (...) @tipo2()
ret i32 0
}
unsigned convert_bits(unsigned a, unsigned b) {
  unsigned diff = a ^ b;
  unsigned bits;
  for (bits = 0; diff != 0; bits++, diff &= (diff - 1))
    ;
  return bits;
}


x86 assembly (clang, -O0):
<convert_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1143 <convert_bits+0x43>
jmp    1129 <convert_bits+0x29>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    111a <convert_bits+0x1a>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_bits>:
xor    %eax,%eax
xor    %esi,%edi
je     111c <convert_bits+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <convert_bits+0x10>
ret

LLVM IR (-O0):
define i32 @convert_bits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %7, %8
store i32 %9, i32* %5
store i32 0, i32* %6
br label %10
10: ; preds = %14, %2
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %10
br label %14
14: ; preds = %13
%15 = load i32, i32* %6
%16 = add i32 %15, 1
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = sub i32 %17, 1
%19 = load i32, i32* %5
%20 = and i32 %19, %18
store i32 %20, i32* %5
br label %10
21: ; preds = %10
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
define i32 @convert_bits(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = phi i32 [ %10, %5 ], [ %3, %2 ]
%8 = add i32 %6, 1
%9 = add i32 %7, -1
%10 = and i32 %9, %7
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %13
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
int get_XMotionEvent_x(void *_p) { return (int)((XMotionEvent *)_p)->x; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XMotionEvent_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XMotionEvent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
FILE *xsfopen(const char *path) {
  FILE *stream;
  stream = fopen(path, "w");
  return stream;
}


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

x86 assembly (clang, -O2):
<xsfopen>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define i32* @xsfopen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
ret i32* %6
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define noalias i32* @xsfopen(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_SYSCALL;
int /*<<< orphan*/ perror(char *);
long ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
            int /*<<< orphan*/ *);
int proc_syscall(pid_t pid) {
  long ret;
  ret = ptrace(PTRACE_SYSCALL, pid, NULL, NULL);
  if (ret == -1) {
    perror("ptrace syscall");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<proc_syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <ptrace@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    116a <proc_syscall+0x4a>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <proc_syscall+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_syscall>:
push   %rbx
mov    %edi,%esi
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
cmp    $0xffffffffffffffff,%rax
je     1141 <proc_syscall+0x21>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%ebx
jmp    113d <proc_syscall+0x1d>

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

LLVM IR (-O2):
@PTRACE_SYSCALL = global i32 0
@.str = [15 x i8] c"ptrace syscall\00"
define i32 @proc_syscall(i32 %0) {
%2 = load i32, i32* @PTRACE_SYSCALL
%3 = tail call i64 @ptrace(i32 %2, i32 %0, i32* null, i32* null)
%4 = icmp eq i64 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
struct qbman_result {
  int dummy;
};

/* Variables and functions */
int qbman_result_DQ_flags(struct qbman_result const *);
int qbman_result_DQ_is_pull_complete(const struct qbman_result *dq) {
  return (int)(qbman_result_DQ_flags(dq) & 0x01);
}


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

x86 assembly (clang, -O2):
<qbman_result_DQ_is_pull_complete>:
push   %rax
call   1030 <qbman_result_DQ_flags@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.qbman_result = type { i32 }
define i32 @qbman_result_DQ_is_pull_complete(%struct.qbman_result* %0) {
%2 = alloca %struct.qbman_result*
store %struct.qbman_result* %0, %struct.qbman_result** %2
%3 = load %struct.qbman_result*, %struct.qbman_result** %2
%4 = call i32 @qbman_result_DQ_flags(%struct.qbman_result* %3)
%5 = and i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
%struct.qbman_result = type { i32 }
define i32 @qbman_result_DQ_is_pull_complete(%struct.qbman_result* %0) {
%2 = tail call i32 @qbman_result_DQ_flags(%struct.qbman_result* %0)
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_wvline_set(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_wvline_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_wvline_set+0x2a>
jmp    1170 <cmd_wvline_set+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_wvline_set>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_wvline_set+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wvline_set(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifidirect_config_usage(void) {
  printf("\nUsage : wifidirect_config [CONFIG_FILE]\n");
  printf("\nIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is "
         "performed.\n");
  printf("CONFIG_FILE contains all WIFIDIRECT parameters.\n");
  return;
}


x86 assembly (clang, -O0):
<print_wifidirect_config_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
lea    0xf46(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_wifidirect_config_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xf47(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"\0AUsage : wifidirect_config [CONFIG_FILE]\0A\00"
@.str.1 = [79 x i8] c"\0AIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is performed.\0A\00"
@.str.2 = [49 x i8] c"CONFIG_FILE contains all WIFIDIRECT parameters.\0A\00"
define void @print_wifidirect_config_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"\0AUsage : wifidirect_config [CONFIG_FILE]\00"
@str.3 = [78 x i8] c"\0AIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is performed.\00"
@str.4 = [48 x i8] c"CONFIG_FILE contains all WIFIDIRECT parameters.\00"
define void @print_wifidirect_config_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.4, i64 0, i64 0))
ret void
}
void foo427() {}


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

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

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

LLVM IR (-O2):
define void @foo427() {
ret void
}
int do_674() { return 674; }


x86 assembly (clang, -O0):
<do_674>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_674() {
ret i32 674
}

LLVM IR (-O2):
define i32 @do_674() {
ret i32 674
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void portable_puts(char *buf) {
  while ((*buf) != 0) {
    putchar(*buf);
    buf++;
  }
}


x86 assembly (clang, -O0):
<portable_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <portable_puts+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <portable_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portable_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <portable_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <portable_puts+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @portable_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @putchar(i8 signext %10)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @portable_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}