xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ init_pkteng_linux_pf_packet();
void PKTENG_init_packet_engine(void) { init_pkteng_linux_pf_packet(); }


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

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

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

LLVM IR (-O2):
define void @PKTENG_init_packet_engine() {
%1 = tail call i32 (...) @init_pkteng_linux_pf_packet()
ret void
}
/* Variables and functions */
char **id_to_fmt(unsigned int);
int /*<<< orphan*/ strcpy(char *, char *);
void get_format(unsigned int id, char *buf) {
  char **fmtp = id_to_fmt(id);
  strcpy(buf, *fmtp);
}


x86 assembly (clang, -O0):
<get_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <id_to_fmt@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_format>:
push   %rbx
mov    %rsi,%rbx
call   1040 <id_to_fmt@plt>
mov    (%rax),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @get_format(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = call i8** @id_to_fmt(i32 %6)
store i8** %7, i8*** %5
%8 = load i8*, i8** %4
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
%11 = call i32 @strcpy(i8* %8, i8* %10)
ret void
}

LLVM IR (-O2):
define void @get_format(i32 %0, i8* %1) {
%3 = tail call i8** @id_to_fmt(i32 %0)
%4 = load i8*, i8** %3
%5 = tail call i32 @strcpy(i8* %1, i8* %4)
ret void
}
int test_imm_31uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x31 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_31uint64_highword_reg>:
movabs $0x3100000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_31uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 210453397504
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int _falwcGenericDrawString() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_falwcGenericDrawString() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_llrintf();
scalar_t__ llrintf(float);
void test_llrintf(float f) {
  if (llrintf(f) != llrintf(f))
    link_failure_llrintf();
}


x86 assembly (clang, -O0):
<test_llrintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <llrintf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <llrintf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_llrintf+0x3c>
mov    $0x0,%al
call   1030 <link_failure_llrintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_llrintf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1040 <llrintf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1040 <llrintf@plt>
cmp    %rax,%rbx
jne    1149 <test_llrintf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_llrintf@plt>

LLVM IR (-O0):
define void @test_llrintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @llrintf(float %3)
%5 = load float, float* %2
%6 = call i64 @llrintf(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_llrintf()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_llrintf(float %0) {
%2 = tail call i64 @llrintf(float %0)
%3 = tail call i64 @llrintf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_llrintf()
br label %7
7: ; preds = %5, %1
ret void
}
void XOpenOM() {}


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

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

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

LLVM IR (-O2):
define void @XOpenOM() {
ret void
}
void sysfs_exit_ns(int type, const void *tag) {}


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

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

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

LLVM IR (-O2):
define void @sysfs_exit_ns(i32 %0, i8* nocapture %1) {
ret void
}
extern const char *lua_version(void) { return "Lua 5.0.1"; }


x86 assembly (clang, -O0):
<lua_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Lua 5.0.1\00"
define i8* @lua_version() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"Lua 5.0.1\00"
define i8* @lua_version() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
double g(double p, double x, double k1, double k2) {
  return p - x * (1 + x * x * (k1 + k2 * x * x));
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm4
movsd  -0x20(%rbp),%xmm3
mulsd  -0x10(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xeac(%rip),%xmm3
addsd  %xmm3,%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):
<g>:
movapd %xmm1,%xmm4
mulsd  %xmm1,%xmm4
mulsd  %xmm1,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm4,%xmm3
addsd  0xee0(%rip),%xmm3
mulsd  %xmm1,%xmm3
subsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @g(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %6
%12 = load double, double* %6
%13 = fmul double %11, %12
%14 = load double, double* %7
%15 = load double, double* %8
%16 = load double, double* %6
%17 = fmul double %15, %16
%18 = load double, double* %6
%19 = call double @llvm.fmuladd.f64(double %17, double %18, double %14)
%20 = call double @llvm.fmuladd.f64(double %13, double %19, double 1.000000e+00)
%21 = fneg double %10
%22 = call double @llvm.fmuladd.f64(double %21, double %20, double %9)
ret double %22
}

LLVM IR (-O2):
define double @g(double %0, double %1, double %2, double %3) {
%5 = fmul double %1, %1
%6 = fmul double %1, %3
%7 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %2)
%8 = tail call double @llvm.fmuladd.f64(double %5, double %7, double 1.000000e+00)
%9 = fneg double %1
%10 = tail call double @llvm.fmuladd.f64(double %9, double %8, double %0)
ret double %10
}
void gtk_text_view_new_with_buffer() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_new_with_buffer() {
ret void
}
/* Variables and functions */
int __eventfd(unsigned int, int);
int eventfd(unsigned int initval, int flags) {
  return __eventfd(initval, flags);
}


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

x86 assembly (clang, -O2):
<eventfd>:
jmp    1030 <__eventfd@plt>

LLVM IR (-O0):
define i32 @eventfd(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 @__eventfd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @eventfd(i32 %0, i32 %1) {
%3 = tail call i32 @__eventfd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mDB_kill();
void mDB_exit() { mDB_kill(); }


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

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

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

LLVM IR (-O2):
define void @mDB_exit() {
%1 = tail call i32 (...) @mDB_kill()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mainloop();
int /*<<< orphan*/ parse_args(int, char **);
int main(int argc, char *argv[]) {
  parse_args(argc, argv);
  mainloop();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <parse_args@plt>
xor    %eax,%eax
call   1040 <mainloop@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parse_args(i32 %6, i8** %7)
%9 = call i32 (...) @mainloop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
%4 = tail call i32 (...) @mainloop()
ret i32 0
}
void rop3_146_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = *D | T;
  stk3 = S & stk4;
  stk2 = T ^ stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_146_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xe(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xe(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_146_1_0>:
mov    (%rdi),%al
xor    %al,%dl
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_146_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %10
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = load i8, i8* %10
%21 = zext i8 %20 to i32
%22 = and i32 %19, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %9
%24 = load i8, i8* %6
%25 = zext i8 %24 to i32
%26 = load i8, i8* %9
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %8
%30 = load i8*, i8** %4
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = load i8, i8* %8
%34 = zext i8 %33 to i32
%35 = xor i32 %32, %34
%36 = trunc i32 %35 to i8
store i8 %36, i8* %7
%37 = load i8, i8* %7
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %5
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_146_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = xor i8 %1, -1
%7 = and i8 %5, %6
%8 = and i8 %4, %1
%9 = or i8 %7, %8
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, unsigned int);
int /*<<< orphan*/ stderr;
void *xrealloc(void *ptr, unsigned size) {
  void *result = realloc(ptr, size);
  if (!result) {
    fprintf(stderr, "Out of memory\n");
    exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117d <xrealloc+0x4d>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int find(int *, int);
int test_one_element() {
  int array[] = {4};
  return 4 == find(array, 1);
}


x86 assembly (clang, -O0):
<test_one_element>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
call   1030 <find@plt>
mov    %eax,%ecx
mov    $0x4,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_one_element>:
push   %rax
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1030 <find@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.test_one_element.array = [1 x i32] [i32 4]
define i32 @test_one_element() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%4 = call i32 @find(i32* %3, i32 1)
%5 = icmp eq i32 4, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_one_element() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 4, i32* %3
%4 = call i32 @find(i32* %3, i32 1)
%5 = icmp eq i32 %4, 4
%6 = zext i1 %5 to i32
ret i32 %6
}
int i8042_platform_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @i8042_platform_init() {
ret i32 0
}
void foo_1_2_1_2_2_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_2_1_2_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int isunaryrule(char *word) {
  if (!strcmp(word, "<not>"))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isunaryrule>:
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,%eax
jne    1141 <isunaryrule+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <isunaryrule+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"<not>\00"
define i32 @isunaryrule(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned long http_parser_version(void) {
  return 2 * 0x10000 | 2 * 0x00100 | 1 * 0x00001;
}


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

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

LLVM IR (-O0):
define i64 @http_parser_version() {
ret i64 131585
}

LLVM IR (-O2):
define i64 @http_parser_version() {
ret i64 131585
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void welcome(pid_t thisPid) {
  printf("Welcome to shox, the shell of a fox. My pid is %d.\nEnter any "
         "command here.\n",
         thisPid);
}


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

x86 assembly (clang, -O2):
<welcome>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"Welcome to shox, the shell of a fox. My pid is %d.\0AEnter any command here.\0A\00"
define void @welcome(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [76 x i8] c"Welcome to shox, the shell of a fox. My pid is %d.\0AEnter any command here.\0A\00"
define void @welcome(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void foo_1_1_2_1_2_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_2_1_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, char const *, int, char *);
die(const char *test, int v, int die) {
  printf("%s = %d%s\n", test, v, die ? "!" : "");
  if (die)
    abort();
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%edi
lea    0xec7(%rip),%rcx
lea    0xec1(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%rcx
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
je     116e <die+0x4e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %edx,%ebx
mov    %esi,%edx
mov    %rdi,%rsi
test   %ebx,%ebx
lea    0xed9(%rip),%rax
lea    0xed3(%rip),%rcx
cmove  %rax,%rcx
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
test   %ebx,%ebx
jne    114e <die+0x2e>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"%s = %d%s\0A\00"
@.str.1 = [2 x i8] c"!\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @die(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %5)
br i1 %4, label %9, label %7
7: ; preds = %3
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ChipResetStateMachine();
int /*<<< orphan*/ EventCheck();
int /*<<< orphan*/ InterruptCheck();
int /*<<< orphan*/ PsPollCheck();
int /*<<< orphan*/ RxPacketCheck();
void WF_Task() {
  ChipResetStateMachine();
  EventCheck();
  InterruptCheck();
  RxPacketCheck();
  PsPollCheck();
}


x86 assembly (clang, -O0):
<WF_Task>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <ChipResetStateMachine@plt>
mov    $0x0,%al
call   1030 <EventCheck@plt>
mov    $0x0,%al
call   1040 <InterruptCheck@plt>
mov    $0x0,%al
call   1050 <RxPacketCheck@plt>
mov    $0x0,%al
call   1060 <PsPollCheck@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WF_Task>:
push   %rax
xor    %eax,%eax
call   1070 <ChipResetStateMachine@plt>
xor    %eax,%eax
call   1030 <EventCheck@plt>
xor    %eax,%eax
call   1040 <InterruptCheck@plt>
xor    %eax,%eax
call   1050 <RxPacketCheck@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <PsPollCheck@plt>

LLVM IR (-O0):
define void @WF_Task() {
%1 = call i32 (...) @ChipResetStateMachine()
%2 = call i32 (...) @EventCheck()
%3 = call i32 (...) @InterruptCheck()
%4 = call i32 (...) @RxPacketCheck()
%5 = call i32 (...) @PsPollCheck()
ret void
}

LLVM IR (-O2):
define void @WF_Task() {
%1 = tail call i32 (...) @ChipResetStateMachine()
%2 = tail call i32 (...) @EventCheck()
%3 = tail call i32 (...) @InterruptCheck()
%4 = tail call i32 (...) @RxPacketCheck()
%5 = tail call i32 (...) @PsPollCheck()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int usage(const char *pname, int exit) {
  printf("Usage: %s FILE [15A [24B [...]]]\n"
         "\n"
         "Register a SELL action to file FILE.\n",
         pname);
  return exit;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [72 x i8] c"Usage: %s FILE [15A [24B [...]]]\0A\0ARegister a SELL action to file FILE.\0A\00"
define i32 @usage(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 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
@.str = [72 x i8] c"Usage: %s FILE [15A [24B [...]]]\0A\0ARegister a SELL action to file FILE.\0A\00"
define i32 @usage(i8* %0, i32 returned %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %1
}
int isgraph(int c) { return (c >= 0x21 && c <= 0x7e); }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x21,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isgraph+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 33
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
void unend(char *s) {
  if (s[0] == '\0')
    return;
  while (s[1] != '\0')
    s++;
  if (s[0] == '\n')
    s[0] = '\0';
}


x86 assembly (clang, -O0):
<unend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    111d <unend+0x1d>
jmp    115b <unend+0x5b>
jmp    1122 <unend+0x22>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1144 <unend+0x44>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1122 <unend+0x22>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    115b <unend+0x5b>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unend>:
cmpb   $0x0,(%rdi)
je     1122 <unend+0x22>
add    $0xffffffffffffffff,%rdi
nopl   0x0(%rax)
cmpb   $0x0,0x2(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <unend+0x10>
cmpb   $0xa,(%rdi)
jne    1122 <unend+0x22>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @unend(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4
%10 = load i8, i8* %5
%11 = icmp eq i8 %10, 10
br i1 %11, label %12, label %13
12: ; preds = %9
store i8 0, i8* %5
br label %13
13: ; preds = %1, %12, %9
ret void
}
/* Variables and functions */
scalar_t__ wait(int /*<<< orphan*/ *);
void sigchld_handler(int s) {
  while (wait(NULL) > 0)
    ;
}


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <wait@plt>
cmp    $0x0,%rax
jle    1133 <sigchld_handler+0x23>
jmp    111b <sigchld_handler+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_handler>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <wait@plt>
test   %rax,%rax
jg     1120 <sigchld_handler+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = call i64 @wait(i32* null)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @sigchld_handler(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @wait(i32* null)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
ret void
}
/* Type definitions */
struct RNA2Dfold_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
RNA2Dfold_cmdline_parser_release(struct RNA2Dfold_args_info *);
void RNA2Dfold_cmdline_parser_free(struct RNA2Dfold_args_info *args_info) {
  RNA2Dfold_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<RNA2Dfold_cmdline_parser_free>:
jmp    1030 <RNA2Dfold_cmdline_parser_release@plt>

LLVM IR (-O0):
%struct.RNA2Dfold_args_info = type { i32 }
define void @RNA2Dfold_cmdline_parser_free(%struct.RNA2Dfold_args_info* %0) {
%2 = alloca %struct.RNA2Dfold_args_info*
store %struct.RNA2Dfold_args_info* %0, %struct.RNA2Dfold_args_info** %2
%3 = load %struct.RNA2Dfold_args_info*, %struct.RNA2Dfold_args_info** %2
%4 = call i32 @RNA2Dfold_cmdline_parser_release(%struct.RNA2Dfold_args_info* %3)
ret void
}

LLVM IR (-O2):
%struct.RNA2Dfold_args_info = type { i32 }
define void @RNA2Dfold_cmdline_parser_free(%struct.RNA2Dfold_args_info* %0) {
%2 = tail call i32 @RNA2Dfold_cmdline_parser_release(%struct.RNA2Dfold_args_info* %0)
ret void
}
int main(void) {
  long unsigned int x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ json_oom();
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *json_strdup(const char *str) {
  char *ret = (char *)malloc(strlen(str) + 1);
  if (ret == NULL) {
    json_oom();
    return NULL;
  }
  strcpy(ret, str);
  return ret;
}


x86 assembly (clang, -O0):
<json_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1184 <json_strdup+0x44>
mov    $0x0,%al
call   1060 <json_oom@plt>
movq   $0x0,-0x8(%rbp)
jmp    1199 <json_strdup+0x59>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     116a <json_strdup+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1173 <json_strdup+0x33>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <json_oom@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @json_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 (...) @json_oom()
store i8* null, i8** %2
br label %19
14: ; preds = %1
%15 = load i8*, i8** %4
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %4
store i8* %18, i8** %2
br label %19
19: ; preds = %14, %12
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @json_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 (...) @json_oom()
br label %11
9: ; preds = %1
%10 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %11
11: ; preds = %9, %7
%12 = phi i8* [ null, %7 ], [ %5, %9 ]
ret i8* %12
}
/* Variables and functions */
int SQLITE_DONE;
int SQLITE_ROW;
int /*<<< orphan*/ srcdie();
void csrc(int rc) {
  if (rc == SQLITE_DONE || rc == SQLITE_ROW)
    return;
  else
    srcdie();
}


x86 assembly (clang, -O0):
<csrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%eax
je     113f <csrc+0x2f>
mov    -0x4(%rbp),%eax
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
jne    1144 <csrc+0x34>
jmp    114b <csrc+0x3b>
mov    $0x0,%al
call   1030 <srcdie@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csrc>:
mov    0x2ec9(%rip),%rax
cmp    %edi,(%rax)
je     112d <csrc+0x1d>
mov    0x2eb6(%rip),%rax
cmp    %edi,(%rax)
je     112d <csrc+0x1d>
xor    %eax,%eax
jmp    1030 <srcdie@plt>
ret

LLVM IR (-O0):
@SQLITE_DONE = global i32 0
@SQLITE_ROW = global i32 0
define void @csrc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SQLITE_DONE
%5 = icmp eq i32 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @SQLITE_ROW
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6, %1
br label %13
11: ; preds = %6
%12 = call i32 (...) @srcdie()
br label %13
13: ; preds = %10, %11
ret void
}

LLVM IR (-O2):
@SQLITE_DONE = global i32 0
@SQLITE_ROW = global i32 0
define void @csrc(i32 %0) {
%2 = load i32, i32* @SQLITE_DONE
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @SQLITE_ROW
%5 = icmp eq i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 (...) @srcdie()
br label %9
9: ; preds = %1, %7
ret void
}
/* Variables and functions */
int *malloc(int);
int *allocTab(int size) {
  int *i = malloc(sizeof(int) * size);
  return i;
}


x86 assembly (clang, -O0):
<allocTab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocTab>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i32* @allocTab(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32* @malloc(i32 %2)
ret i32* %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t diff_ns_to_usec(uint64_t prev, uint64_t next) {
  return (next - prev + 500) / 1000;
}


x86 assembly (clang, -O0):
<diff_ns_to_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1f4,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_ns_to_usec>:
sub    %edi,%esi
add    $0x1f4,%esi
movslq %esi,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @diff_ns_to_usec(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = add nsw i32 %7, 500
%9 = sdiv i32 %8, 1000
ret i32 %9
}

LLVM IR (-O2):
define i32 @diff_ns_to_usec(i32 %0, i32 %1) {
%3 = sub i32 500, %0
%4 = add i32 %3, %1
%5 = sdiv i32 %4, 1000
ret i32 %5
}
/* Variables and functions */
size_t mblen(char *, size_t);
int /*<<< orphan*/ putchar(char);
size_t put_mbchar(char *str_ring, size_t str_ring_len) {
  size_t i;
  for (i = 0; i < mblen(str_ring, str_ring_len); i++) {
    putchar(str_ring[i]);
  }
  return i;
}


x86 assembly (clang, -O0):
<put_mbchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mblen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jae    117f <put_mbchar+0x5f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <put_mbchar+0x18>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_mbchar>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <mblen@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115e <put_mbchar+0x3e>
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <mblen@plt>
cmp    %rax,%rbx
jb     1140 <put_mbchar+0x20>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @put_mbchar(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i64 @mblen(i8* %8, i64 %9)
%11 = icmp ult i64 %7, %10
br i1 %11, label %12, label %21
12: ; preds = %6
%13 = load i8*, i8** %3
%14 = load i64, i64* %5
%15 = getelementptr inbounds i8, i8* %13, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @putchar(i8 signext %16)
br label %18
18: ; preds = %12
%19 = load i64, i64* %5
%20 = add i64 %19, 1
store i64 %20, i64* %5
br label %6
21: ; preds = %6
%22 = load i64, i64* %5
ret i64 %22
}

LLVM IR (-O2):
define i64 @put_mbchar(i8* %0, i64 %1) {
%3 = tail call i64 @mblen(i8* %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @putchar(i8 signext %8)
%10 = add nuw i64 %6, 1
%11 = tail call i64 @mblen(i8* %0, i64 %1)
%12 = icmp ult i64 %10, %11
br i1 %12, label %5, label %13
13: ; preds = %5, %2
%14 = phi i64 [ 0, %2 ], [ %10, %5 ]
ret i64 %14
}
void putTtyChar(int character) {
  long __res, dummy;
  __asm__ __volatile__("int $0x80"
                       : "=a"(__res), "=&b"(dummy)
                       : "0"(2), "1"((long)(character)));
  return (void)__res;
}


x86 assembly (clang, -O0):
<putTtyChar>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rbx
mov    $0x2,%eax
int    $0x80
mov    %rax,-0x18(%rbp)
mov    %rbx,-0x20(%rbp)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<putTtyChar>:
push   %rbx
movslq %edi,%rbx
mov    $0x2,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define void @putTtyChar(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = call { i64, i64 } asm sideeffect "int $$0x80", "={ax},=&{bx},0,1,~{dirflag},~{fpsr},~{flags}"(i64 2, i64 %6)
%8 = extractvalue { i64, i64 } %7, 0
%9 = extractvalue { i64, i64 } %7, 1
store i64 %8, i64* %3
store i64 %9, i64* %4
%10 = load i64, i64* %3
ret void
}

LLVM IR (-O2):
define void @putTtyChar(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call { i64, i64 } asm sideeffect "int $$0x80", "={ax},=&{bx},0,1,~{dirflag},~{fpsr},~{flags}"(i64 2, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__42__IO__selectModuleFunc();
void Msp430Adc12ImplP__Port62__selectModuleFunc(void) {
  HplMsp430GeneralIOP__42__IO__selectModuleFunc();
}


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port62__selectModuleFunc() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__42__IO__selectModuleFunc()
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ pipe(int *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void my_pipe(int *fds) {
  if (pipe(fds) < 0) {
    int errsv = errno;
    fprintf(stderr, "Cannot create pipe %s\n", strerror(errsv));
    exit(1);
  }
}


x86 assembly (clang, -O0):
<my_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pipe@plt>
cmp    $0x0,%rax
jge    119b <my_pipe+0x5b>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e6e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <strerror@plt>
mov    -0x10(%rbp),%edi
mov    %rax,%rdx
lea    0xe74(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pipe>:
push   %rbx
call   1030 <pipe@plt>
test   %rax,%rax
js     114d <my_pipe+0xd>
pop    %rbx
ret
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    0x2e83(%rip),%rax
mov    (%rax),%ebx
call   1060 <strerror@plt>
lea    0xe95(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"Cannot create pipe %s\0A\00"
define void @my_pipe(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i64 @pipe(i32* %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i32, i32* @errno
store i32 %8, i32* %3
%9 = load i32, i32* @stderr
%10 = load i32, i32* %3
%11 = call i8* @strerror(i32 %10)
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"Cannot create pipe %s\0A\00"
define void @my_pipe(i32* %0) {
%2 = tail call i64 @pipe(i32* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = load i32, i32* @stderr
%7 = tail call i8* @strerror(i32 %5)
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}