xunge/DecIR huggingface dataset:
int gdt_compare_ulonglong(const void *p1, const void *p2) {
  unsigned long long n1 = *((unsigned long long *)p1);
  unsigned long long n2 = *((unsigned long long *)p2);
  if (n1 < n2) {
    return -1;
  } else if (n1 > n2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<gdt_compare_ulonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    113c <gdt_compare_ulonglong+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <gdt_compare_ulonglong+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jbe    1156 <gdt_compare_ulonglong+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <gdt_compare_ulonglong+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdt_compare_ulonglong>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gdt_compare_ulonglong(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp ult i64 %4, %6
%8 = icmp ugt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int fibR(int n) {
  if (n < 2)
    return n;
  return (fibR(n - 2) + fibR(n - 1));
}


x86 assembly (clang, -O0):
<fibR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <fibR+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fibR+0x43>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibR@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibR@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibR>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1147 <fibR+0x37>
add    $0x1,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x3(%rbx),%edi
call   1030 <fibR@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     1130 <fibR+0x20>
mov    $0x1,%ebx
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibR(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -2
%7 = tail call i32 @fibR(i32 %6)
%8 = add nsw i32 %4, -1
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 3
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ 1, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
float sqrtf(int);
float C(int u) {
  if (u == 0)
    return (1.0f / sqrtf(2));
  else
    return 1.0f;
}


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1148 <C+0x38>
mov    $0x2,%edi
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  0xec6(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1155 <C+0x45>
movss  0xeb0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C>:
push   %rax
test   %edi,%edi
je     111f <C+0xf>
movss  0xee3(%rip),%xmm0
pop    %rax
ret
mov    $0x2,%edi
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  0xecc(%rip),%xmm0
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @C(i32 %0) {
%2 = alloca float
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call float @sqrtf(i32 2)
%8 = fdiv float 1.000000e+00, %7
store float %8, float* %2
br label %10
9: ; preds = %1
store float 1.000000e+00, float* %2
br label %10
10: ; preds = %9, %6
%11 = load float, float* %2
ret float %11
}

LLVM IR (-O2):
define float @C(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call float @sqrtf(i32 2)
%5 = fdiv float 1.000000e+00, %4
br label %6
6: ; preds = %1, %3
%7 = phi float [ %5, %3 ], [ 1.000000e+00, %1 ]
ret float %7
}
void prepare_fields_acoustic_adj_dev_(long *Mesh_pointer,
                                      int *APPROXIMATE_HESS_KL) {}


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

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

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

LLVM IR (-O2):
define void @prepare_fields_acoustic_adj_dev_(i64* nocapture %0, i32* nocapture %1) {
ret void
}
int do_198() { return 198; }


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

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

LLVM IR (-O0):
define i32 @do_198() {
ret i32 198
}

LLVM IR (-O2):
define i32 @do_198() {
ret i32 198
}
const char *ED(int bit) { return bit ? "ENABLED" : "DISABLED"; }


x86 assembly (clang, -O0):
<ED>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef7(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ED>:
test   %edi,%edi
lea    0xeff(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"ENABLED\00"
@.str.1 = [9 x i8] c"DISABLED\00"
define i8* @ED(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"ENABLED\00"
@.str.1 = [9 x i8] c"DISABLED\00"
define i8* @ED(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ burnstack(int);
int /*<<< orphan*/ conv_sk_ed25519_to_x25519(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/ const *);
void eddsa_sk_eddsa_to_dh(uint8_t out[32], const uint8_t in[32]) {
  conv_sk_ed25519_to_x25519(out, in);
  burnstack(1024);
}


x86 assembly (clang, -O0):
<eddsa_sk_eddsa_to_dh>:
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 <conv_sk_ed25519_to_x25519@plt>
mov    $0x400,%edi
call   1040 <burnstack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eddsa_sk_eddsa_to_dh>:
push   %rax
call   1030 <conv_sk_ed25519_to_x25519@plt>
mov    $0x400,%edi
pop    %rax
jmp    1040 <burnstack@plt>

LLVM IR (-O0):
define void @eddsa_sk_eddsa_to_dh(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @conv_sk_ed25519_to_x25519(i32* %5, i32* %6)
%8 = call i32 @burnstack(i32 1024)
ret void
}

LLVM IR (-O2):
define void @eddsa_sk_eddsa_to_dh(i32* %0, i32* %1) {
%3 = tail call i32 @conv_sk_ed25519_to_x25519(i32* %0, i32* %1)
%4 = tail call i32 @burnstack(i32 1024)
ret void
}
void iwmct_dbgfs_register(struct iwmct_priv *priv, const char *name) {}


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

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

LLVM IR (-O0):
%struct.iwmct_priv = type opaque
define void @iwmct_dbgfs_register(%struct.iwmct_priv* %0, i8* %1) {
%3 = alloca %struct.iwmct_priv*
%4 = alloca i8*
store %struct.iwmct_priv* %0, %struct.iwmct_priv** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.iwmct_priv = type opaque
define void @iwmct_dbgfs_register(%struct.iwmct_priv* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
long double __nanl();
long double nanl(char const *tagp) { return __nanl(); }


x86 assembly (clang, -O0):
<nanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
call   1030 <__nanl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @nanl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call x86_fp80 (...) @__nanl()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @nanl(i8* nocapture readnone %0) {
%2 = tail call x86_fp80 (...) @__nanl()
ret x86_fp80 %2
}
/* Type definitions */
struct mcp23017 {
  int dummy;
};
struct hd44780 {
  int dummy;
};
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ hd44780WriteByte(struct mcp23017 *, struct hd44780 *, int,
                                    int /*<<< orphan*/);
int /*<<< orphan*/ usleep(int);
int8_t hd44780Home(struct mcp23017 *mcp23017, struct hd44780 *hd44780) {
  hd44780WriteByte(mcp23017, hd44780, 0x02, 0);
  usleep(1600);
  return 0;
}


x86 assembly (clang, -O0):
<hd44780Home>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1030 <hd44780WriteByte@plt>
mov    $0x640,%edi
call   1040 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd44780Home>:
push   %rax
mov    $0x2,%edx
xor    %ecx,%ecx
call   1030 <hd44780WriteByte@plt>
mov    $0x640,%edi
call   1040 <usleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mcp23017 = type { i32 }
%struct.hd44780 = type { i32 }
define i32 @hd44780Home(%struct.mcp23017* %0, %struct.hd44780* %1) {
%3 = alloca %struct.mcp23017*
%4 = alloca %struct.hd44780*
store %struct.mcp23017* %0, %struct.mcp23017** %3
store %struct.hd44780* %1, %struct.hd44780** %4
%5 = load %struct.mcp23017*, %struct.mcp23017** %3
%6 = load %struct.hd44780*, %struct.hd44780** %4
%7 = call i32 @hd44780WriteByte(%struct.mcp23017* %5, %struct.hd44780* %6, i32 2, i32 0)
%8 = call i32 @usleep(i32 1600)
ret i32 0
}

LLVM IR (-O2):
%struct.mcp23017 = type { i32 }
%struct.hd44780 = type { i32 }
define i32 @hd44780Home(%struct.mcp23017* %0, %struct.hd44780* %1) {
%3 = tail call i32 @hd44780WriteByte(%struct.mcp23017* %0, %struct.hd44780* %1, i32 2, i32 0)
%4 = tail call i32 @usleep(i32 1600)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ins_elt();
void cealtesthook_input_iter_change() { ins_elt(); }


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

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

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

LLVM IR (-O2):
define void @cealtesthook_input_iter_change() {
%1 = tail call i32 (...) @ins_elt()
ret void
}
/* Variables and functions */
void signals_unblock(void) {}


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

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

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

LLVM IR (-O2):
define void @signals_unblock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void everror(const char *s) { fprintf(stderr, "%s\n", s); }


x86 assembly (clang, -O0):
<everror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<everror>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @everror(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @everror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double divisor_count(unsigned int);
unsigned int pow(unsigned int, double);
unsigned int divisor_product(unsigned int n) {
  return pow(n, divisor_count(n) / 2.0);
}


x86 assembly (clang, -O0):
<divisor_product>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <divisor_count@plt>
mov    -0x8(%rbp),%edi
movsd  0xebc(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divisor_product>:
push   %rbx
mov    %edi,%ebx
call   1030 <divisor_count@plt>
mulsd  0xed0(%rip),%xmm0
mov    %ebx,%edi
pop    %rbx
jmp    1040 <pow@plt>

LLVM IR (-O0):
define i32 @divisor_product(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call double @divisor_count(i32 %4)
%6 = fdiv double %5, 2.000000e+00
%7 = call i32 @pow(i32 %3, double %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @divisor_product(i32 %0) {
%2 = tail call double @divisor_count(i32 %0)
%3 = fmul double %2, 5.000000e-01
%4 = tail call i32 @pow(i32 %0, double %3)
ret i32 %4
}
int is_aligned(unsigned long value, unsigned powof2) {
  return ((value & (powof2 - 1)) == 0);
}


x86 assembly (clang, -O0):
<is_aligned>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
and    %rcx,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_aligned>:
add    $0xffffffff,%esi
xor    %eax,%eax
test   %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_aligned(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = sub i32 %6, 1
%8 = zext i32 %7 to i64
%9 = and i64 %5, %8
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_aligned(i64 %0, i32 %1) {
%3 = add i32 %1, -1
%4 = zext i32 %3 to i64
%5 = and i64 %4, %0
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
void *calloc(size_t, int);
void *get_mem(size_t bytes) { return calloc(bytes, 1); }


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

x86 assembly (clang, -O2):
<get_mem>:
mov    $0x1,%esi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @get_mem(i64 %0) {
%2 = tail call i8* @calloc(i64 %0, i32 1)
ret i8* %2
}
void event_handle_gchord(s) char *s;
{}


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

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

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

LLVM IR (-O2):
define void @event_handle_gchord(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void caml_ojs_wrap_fun_arguments() {
  fprintf(stderr,
          "Unimplemented JavaScript primitive caml_ojs_wrap_fun_arguments!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<caml_ojs_wrap_fun_arguments>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<caml_ojs_wrap_fun_arguments>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"Unimplemented JavaScript primitive caml_ojs_wrap_fun_arguments!\0A\00"
define void @caml_ojs_wrap_fun_arguments() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"Unimplemented JavaScript primitive caml_ojs_wrap_fun_arguments!\0A\00"
define void @caml_ojs_wrap_fun_arguments() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int is_matrix_delim(const char *s) {
  if (strcmp(s, "[") == 0)
    return 1;
  else if (strcmp(s, "]") == 0)
    return 2;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_matrix_delim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <is_matrix_delim+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <is_matrix_delim+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <is_matrix_delim+0x58>
movl   $0x2,-0x4(%rbp)
jmp    116f <is_matrix_delim+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_matrix_delim>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1143 <is_matrix_delim+0x33>
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"[\00"
@.str.1 = [2 x i8] c"]\00"
define i32 @is_matrix_delim(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 2, i32 0
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *msg) {
  fprintf(stderr, "Resource file structure error: %s\n", msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<die>:
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    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Resource file structure error: %s\0A\00"
define void @die(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 ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Resource file structure error: %s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ splice(int /*<<< orphan*/, int /*<<< orphan*/, int,
                          int /*<<< orphan*/, int, int /*<<< orphan*/);
int main(int argc, char **argv) {
  splice(0, 0, 1, 0, 1 << 30, 0);
  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)
xor    %r9d,%r9d
mov    $0x1,%edx
mov    $0x40000000,%r8d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%ecx
call   1030 <splice@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x40000000,%r8d
xor    %r9d,%r9d
call   1030 <splice@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 @splice(i32 0, i32 0, i32 1, i32 0, i32 1073741824, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @splice(i32 0, i32 0, i32 1, i32 0, i32 1073741824, i32 0)
ret i32 0
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
off_t lseek(int fd, off_t offset, int whence) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec3(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EINVAL
store i32 %4, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef size_t uint32_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
void store_SINT64(int64_t *arr, uint32_t idx, int64_t value) {
  arr[idx] = value;
}


x86 assembly (clang, -O0):
<store_SINT64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_SINT64>:
mov    %edx,(%rdi,%rsi,4)
ret

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

LLVM IR (-O2):
define void @store_SINT64(i32* nocapture writeonly %0, i64 %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
store i32 %2, i32* %4
ret void
}
void XtAppErrorMsg() {}


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

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

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

LLVM IR (-O2):
define void @XtAppErrorMsg() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  unsigned x = 2;
  printf("x = [%d]\n", x);
  printf("(x << 1) = [%d]\n", x << 1);
  printf("(x << 0) = [%d]\n", x << 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
shl    $0x0,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"x = [%d]\0A\00"
@.str.1 = [17 x i8] c"(x << 1) = [%d]\0A\00"
@.str.2 = [17 x i8] c"(x << 0) = [%d]\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void test_or() {
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c",
          6, 3, 1 | 2);
  ;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c",
          7, 7, 2 | 5);
  ;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c",
          8, 7, 2 | 7);
  ;
}


x86 assembly (clang, -O0):
<test_or>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x6,%esi
mov    $0x3,%ecx
mov    %ecx,%edx
call   1030 <fexpect@plt>
lea    0xecd(%rip),%rdi
mov    $0x7,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <fexpect@plt>
lea    0xeb8(%rip),%rdi
mov    $0x8,%esi
mov    $0x7,%ecx
mov    %ecx,%edx
call   1030 <fexpect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_or>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x7,%edx
mov    $0x7,%ecx
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x7,%edx
mov    $0x7,%ecx
pop    %rbx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c\00"
define void @test_or() {
%1 = call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 6, i32 3, i32 3)
%2 = call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 7, i32 7, i32 7)
%3 = call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 8, i32 7, i32 7)
ret void
}

LLVM IR (-O2):
@.str = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c\00"
define void @test_or() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 6, i32 3, i32 3)
%2 = tail call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 7, i32 7, i32 7)
%3 = tail call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 8, i32 7, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void init_arr(int arr[]) { memset(arr, 0, sizeof(int) * (1000000 + 1)); }


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

x86 assembly (clang, -O2):
<init_arr>:
xor    %esi,%esi
mov    $0x3d0904,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @init_arr(i32* %0) {
%2 = tail call i32 @memset(i32* %0, i32 0, i32 4000004)
ret void
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ printf(char *, int);
main() { printf("%c", f(8)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <f@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1030 <f@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 @f(i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void foo_1_1_2_1_1_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_1_2_1_1_2() {
ret void
}
int abs(int a) {
  if (a < 0) {
    return a * (-1);
  } else {
    return a;
  }
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <abs+0x1d>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1123 <abs+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void foo738(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo738(i32 %0) {
ret void
}
void store2a(long long *array, long long a) {
  array[200] = a;
  array[201] = a;
  array[202] = a;
  array[203] = a;
}


x86 assembly (clang, -O0):
<store2a>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x640(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x648(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x650(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x658(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store2a>:
mov    %rsi,0x640(%rdi)
mov    %rsi,0x648(%rdi)
mov    %rsi,0x650(%rdi)
mov    %rsi,0x658(%rdi)
ret

LLVM IR (-O0):
define void @store2a(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 200
store i64 %5, i64* %7
%8 = load i64, i64* %4
%9 = load i64*, i64** %3
%10 = getelementptr inbounds i64, i64* %9, i64 201
store i64 %8, i64* %10
%11 = load i64, i64* %4
%12 = load i64*, i64** %3
%13 = getelementptr inbounds i64, i64* %12, i64 202
store i64 %11, i64* %13
%14 = load i64, i64* %4
%15 = load i64*, i64** %3
%16 = getelementptr inbounds i64, i64* %15, i64 203
store i64 %14, i64* %16
ret void
}

LLVM IR (-O2):
define void @store2a(i64* nocapture writeonly %0, i64 %1) {
%3 = getelementptr inbounds i64, i64* %0, i64 200
store i64 %1, i64* %3
%4 = getelementptr inbounds i64, i64* %0, i64 201
store i64 %1, i64* %4
%5 = getelementptr inbounds i64, i64* %0, i64 202
store i64 %1, i64* %5
%6 = getelementptr inbounds i64, i64* %0, i64 203
store i64 %1, i64* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ block_signals();
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int const);
void terminate(const int exitCode) {
  block_signals();
  cleanup();
  exit(exitCode);
  assert(0);
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <block_signals@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<terminate>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <block_signals@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @block_signals()
%4 = call i32 (...) @cleanup()
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
define void @terminate(i32 %0) {
%2 = tail call i32 (...) @block_signals()
%3 = tail call i32 (...) @cleanup()
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int equal_string(void *s1, void *s2) { return !strcmp((char *)s1, (char *)s2); }


x86 assembly (clang, -O0):
<equal_string>:
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 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_string>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @equal_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** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @equal_string(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void mysleep(int sec) { sleep(sec); }


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

x86 assembly (clang, -O2):
<mysleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @mysleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __syscall(int, int);
void nc_close(int fd) { __syscall(6, fd); }


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

x86 assembly (clang, -O2):
<nc_close>:
mov    %edi,%esi
mov    $0x6,%edi
jmp    1030 <__syscall@plt>

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

LLVM IR (-O2):
define void @nc_close(i32 %0) {
%2 = tail call i32 @__syscall(i32 6, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BUG_WARN(int);
void c2p_unsupported(void) { BUG_WARN(1); }


x86 assembly (clang, -O0):
<c2p_unsupported>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <BUG_WARN@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2p_unsupported>:
mov    $0x1,%edi
jmp    1030 <BUG_WARN@plt>

LLVM IR (-O0):
define void @c2p_unsupported() {
%1 = call i32 @BUG_WARN(i32 1)
ret void
}

LLVM IR (-O2):
define void @c2p_unsupported() {
%1 = tail call i32 @BUG_WARN(i32 1)
ret void
}
void reset_cycle_counter(void) {}


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

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

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

LLVM IR (-O2):
define void @reset_cycle_counter() {
ret void
}
void ff_hevc_put_hevc_qpel_h16_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h16_10_avx2() {
ret void
}
void getSumDifAndProduct(int a, int b, int *sum, int *dif, int *product) {
  *sum = a + b;
  *dif = a - b;
  *product = a * b;
}


x86 assembly (clang, -O0):
<getSumDifAndProduct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSumDifAndProduct>:
lea    (%rsi,%rdi,1),%eax
mov    %eax,(%rdx)
mov    %edi,%eax
sub    %esi,%eax
mov    %eax,(%rcx)
imul   %edi,%esi
mov    %esi,(%r8)
ret

LLVM IR (-O0):
define void @getSumDifAndProduct(i32 %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = add nsw i32 %11, %12
%14 = load i32*, i32** %8
store i32 %13, i32* %14
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = sub nsw i32 %15, %16
%18 = load i32*, i32** %9
store i32 %17, i32* %18
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = mul nsw i32 %19, %20
%22 = load i32*, i32** %10
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @getSumDifAndProduct(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = add nsw i32 %1, %0
store i32 %6, i32* %2
%7 = sub nsw i32 %0, %1
store i32 %7, i32* %3
%8 = mul nsw i32 %1, %0
store i32 %8, i32* %4
ret void
}
int check(unsigned c) {
  int i;
  if (((c >> 28) & 0xF) == 0)
    return 0;
  for (i = 0; i < 32; i += 8)
    if (((c >> i) & 0xFF) == '\n')
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1c,%eax
and    $0xf,%eax
cmp    $0x0,%eax
jne    1125 <check+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1172 <check+0x72>
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    116b <check+0x6b>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
and    $0xff,%eax
cmp    $0xa,%eax
jne    1158 <check+0x58>
movl   $0x0,-0x4(%rbp)
jmp    1172 <check+0x72>
jmp    115d <check+0x5d>
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <check+0x2c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
cmp    $0x10000000,%edi
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
pand   0xee9(%rip),%xmm0
setae  %al
pcmpeqd 0xeee(%rip),%xmm0
movmskps %xmm0,%ecx
test   %ecx,%ecx
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @check(i32 %0) {
%2 = icmp ugt i32 %0, 268435455
%3 = insertelement <4 x i32> poison, i32 %0, i64 0
%4 = shufflevector <4 x i32> %3, <4 x i32> poison, <4 x i32> zeroinitializer
%5 = and <4 x i32> %4, <i32 255, i32 65280, i32 16711680, i32 -16777216>
%6 = icmp eq <4 x i32> %5, <i32 10, i32 2560, i32 655360, i32 167772160>
%7 = bitcast <4 x i1> %6 to i4
%8 = icmp eq i4 %7, 0
%9 = and i1 %8, %2
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int rand();
int rand_int_generator(int max) { return (rand() % (max + 1)); }


x86 assembly (clang, -O0):
<rand_int_generator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_int_generator>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
add    $0x1,%ebx
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand_int_generator(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = srem i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @rand_int_generator(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = add nsw i32 %0, 1
%4 = srem i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int readFloat(char *);
int getBatPercent() {
  return readFloat("/sys/class/power_supply/BAT0/capacity");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"/sys/class/power_supply/BAT0/capacity\00"
define i32 @getBatPercent() {
%1 = call i32 @readFloat(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [38 x i8] c"/sys/class/power_supply/BAT0/capacity\00"
define i32 @getBatPercent() {
%1 = tail call i32 @readFloat(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
unsigned char calcR(unsigned char *X, unsigned char *Y,
                    const unsigned char *D) {
  return (~(*X ^ *Y)) ^ *D;
}


x86 assembly (clang, -O0):
<calcR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
xor    $0xffffffff,%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcR>:
mov    (%rdi),%al
xor    (%rsi),%al
xor    (%rdx),%al
not    %al
ret

LLVM IR (-O0):
define zeroext i8 @calcR(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %9, %12
%14 = xor i32 %13, -1
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = xor i32 %14, %17
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @calcR(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
%4 = load i8, i8* %0
%5 = load i8, i8* %1
%6 = load i8, i8* %2
%7 = xor i8 %4, %5
%8 = xor i8 %7, %6
%9 = xor i8 %8, -1
ret i8 %9
}