xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isnan(double);
unsigned int fpu_fcom_c3(double a, double b) {
  if (isnan(a) || isnan(b))
    return 1;
  if (a == b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<fpu_fcom_c3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
jne    114a <fpu_fcom_c3+0x3a>
movsd  -0x18(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1156 <fpu_fcom_c3+0x46>
movl   $0x1,-0x4(%rbp)
jmp    117f <fpu_fcom_c3+0x6f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1178 <fpu_fcom_c3+0x68>
jp     1178 <fpu_fcom_c3+0x68>
movl   $0x1,-0x4(%rbp)
jmp    117f <fpu_fcom_c3+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpu_fcom_c3>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <isnan@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1152 <fpu_fcom_c3+0x42>
movsd  (%rsp),%xmm0
call   1030 <isnan@plt>
test   %rax,%rax
jne    1152 <fpu_fcom_c3+0x42>
movsd  0x8(%rsp),%xmm0
cmpeqsd (%rsp),%xmm0
movq   %xmm0,%rbx
and    $0x1,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fpu_fcom_c3(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = call i64 @isnan(double %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load double, double* %5
%11 = call i64 @isnan(double %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9, %2
store i32 1, i32* %3
br label %20
14: ; preds = %9
%15 = load double, double* %4
%16 = load double, double* %5
%17 = fcmp oeq double %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 1, i32* %3
br label %20
19: ; preds = %14
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18, %13
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @fpu_fcom_c3(double %0, double %1) {
%3 = tail call i64 @isnan(double %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i64 @isnan(double %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = fcmp oeq double %0, %1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %8, %2, %5
%12 = phi i32 [ 1, %5 ], [ 1, %2 ], [ %10, %8 ]
ret i32 %12
}
void save_tty(void) {}


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

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

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

LLVM IR (-O2):
define void @save_tty() {
ret void
}
int test_imm_26int64_highword_reg(long long val) {
  return ((val >> 32) & (0x26 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_26int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 38
%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_26int64_highword_reg(i64 %0) {
%2 = and i64 %0, 163208757248
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __dint();
int /*<<< orphan*/ __nop();
void __nesc_disable_interrupt(void) {
  __dint();
  __nop();
}


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

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

LLVM IR (-O0):
define void @__nesc_disable_interrupt() {
%1 = call i32 (...) @__dint()
%2 = call i32 (...) @__nop()
ret void
}

LLVM IR (-O2):
define void @__nesc_disable_interrupt() {
%1 = tail call i32 (...) @__dint()
%2 = tail call i32 (...) @__nop()
ret void
}
/* Type definitions */
struct modify_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ modify_cmdline_parser_release(struct modify_args_info *);
void modify_cmdline_parser_free(struct modify_args_info *args_info) {
  modify_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<modify_cmdline_parser_free>:
jmp    1030 <modify_cmdline_parser_release@plt>

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

LLVM IR (-O2):
%struct.modify_args_info = type { i32 }
define void @modify_cmdline_parser_free(%struct.modify_args_info* %0) {
%2 = tail call i32 @modify_cmdline_parser_release(%struct.modify_args_info* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "calculates the 2K2 resistor, when a 1000R resistor is attached\n");
  fprintf(stderr, "./kty-calibrate [1000R Value] [0-7]*\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf11(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"calculates the 2K2 resistor, when a 1000R resistor is attached\0A\00"
@.str.1 = [38 x i8] c"./kty-calibrate [1000R Value] [0-7]*\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"calculates the 2K2 resistor, when a 1000R resistor is attached\0A\00"
@.str.1 = [38 x i8] c"./kty-calibrate [1000R Value] [0-7]*\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int fpu_control_t;

/* Variables and functions */
int /*<<< orphan*/ _FPU_GETCW(int);
int _FPU_RESERVED;
int /*<<< orphan*/ _FPU_SETCW(int);
void __setfpucw(fpu_control_t set) {
  fpu_control_t cw;
  _FPU_GETCW(cw);
  cw &= _FPU_RESERVED;
  cw |= set & ~_FPU_RESERVED;
  _FPU_SETCW(cw);
}


x86 assembly (clang, -O0):
<__setfpucw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
mov    (%rcx),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <_FPU_SETCW@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setfpucw>:
push   %rbx
mov    %edi,%ebx
call   1030 <_FPU_GETCW@plt>
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
not    %eax
and    %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <_FPU_SETCW@plt>

LLVM IR (-O0):
@_FPU_RESERVED = global i32 0
define void @__setfpucw(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %3
%5 = call i32 @_FPU_GETCW(i32 %4)
%6 = load i32, i32* @_FPU_RESERVED
%7 = load i32, i32* %3
%8 = and i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* @_FPU_RESERVED
%11 = xor i32 %10, -1
%12 = and i32 %9, %11
%13 = load i32, i32* %3
%14 = or i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = call i32 @_FPU_SETCW(i32 %15)
ret void
}

LLVM IR (-O2):
@_FPU_RESERVED = global i32 0
define void @__setfpucw(i32 %0) {
%2 = tail call i32 @_FPU_GETCW(i32 undef)
%3 = load i32, i32* @_FPU_RESERVED
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
%6 = tail call i32 @_FPU_SETCW(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _show_settimer_page(int);
void PAGE_SetTimerInit(int index) { _show_settimer_page(index); }


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

x86 assembly (clang, -O2):
<PAGE_SetTimerInit>:
jmp    1030 <_show_settimer_page@plt>

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

LLVM IR (-O2):
define void @PAGE_SetTimerInit(i32 %0) {
%2 = tail call i32 @_show_settimer_page(i32 %0)
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
uint64_t load64(const unsigned char *x) {
  unsigned long long r = 0, i;
  for (i = 0; i < 8; ++i) {
    r |= (unsigned long long)x[i] << 8 * i;
  }
  return r;
}


x86 assembly (clang, -O0):
<load64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x8,-0x18(%rbp)
jae    1153 <load64+0x53>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
shl    $0x3,%rcx
shl    %cl,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <load64+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load64>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @load64(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %12, %8
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %17, %13
%19 = getelementptr inbounds i8, i8* %0, i64 4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i64
%22 = shl nuw nsw i64 %21, 32
%23 = or i64 %22, %18
%24 = getelementptr inbounds i8, i8* %0, i64 5
%25 = load i8, i8* %24
%26 = zext i8 %25 to i64
%27 = shl nuw nsw i64 %26, 40
%28 = or i64 %27, %23
%29 = getelementptr inbounds i8, i8* %0, i64 6
%30 = load i8, i8* %29
%31 = zext i8 %30 to i64
%32 = shl nuw nsw i64 %31, 48
%33 = or i64 %32, %28
%34 = getelementptr inbounds i8, i8* %0, i64 7
%35 = load i8, i8* %34
%36 = zext i8 %35 to i64
%37 = shl nuw i64 %36, 56
%38 = or i64 %37, %33
ret i64 %38
}
int test_imm_34int64_lowword_mem(long long *val) {
  return ((*val) & (0x34 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_34int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 52
%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_34int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 52
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EZI2C_EzI2CInit();
void EZI2C_Init(void) { EZI2C_EzI2CInit(); }


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

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

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

LLVM IR (-O2):
define void @EZI2C_Init() {
%1 = tail call i32 (...) @EZI2C_EzI2CInit()
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ sleep(int);
void sleepRandom() { sleep(rand() % 5 + 1); }


x86 assembly (clang, -O0):
<sleepRandom>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x1,%edi
call   1030 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleepRandom>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x1,%edi
pop    %rax
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @sleepRandom() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 5
%3 = add nsw i32 %2, 1
%4 = call i32 @sleep(i32 %3)
ret void
}

LLVM IR (-O2):
define void @sleepRandom() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 5
%3 = add nsw i32 %2, 1
%4 = tail call i32 @sleep(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sw_printf(char *, unsigned int, unsigned int);
int stdiotest(int argc, char *argv[]) {
  unsigned int i;
  for (i = 0xfafafafa; i < 0xffffffff; i += 0xff) {
    sw_printf("[%u] = %x\n\r", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<stdiotest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xfafafafa,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jae    1152 <stdiotest+0x42>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <sw_printf@plt>
mov    -0x14(%rbp),%eax
add    $0xff,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <stdiotest+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdiotest>:
push   %r14
push   %rbx
push   %rax
mov    $0xfafafafa,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <sw_printf@plt>
add    $0xff,%ebx
cmp    $0xffffffff,%ebx
jne    1120 <stdiotest+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"[%u] = %x\0A\0D\00"
define i32 @stdiotest(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ -84215046, %2 ], [ %6, %3 ]
%5 = tail call i32 @sw_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %4)
%6 = add i32 %4, 255
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
streq(a, b) char *a;
char *b;
{ return (strcmp(a, b) == 0); }


x86 assembly (clang, -O0):
<streq>:
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
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
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 @streq(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 eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @streq(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
}
void emptyDb(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               64, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<emptyDb>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x40,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emptyDb>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x40,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.emptyDb = [8 x i8] c"emptyDb\00"
define void @emptyDb() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.emptyDb, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.emptyDb = [8 x i8] c"emptyDb\00"
define void @emptyDb() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.emptyDb, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x >= 0) {
    x = x + y;
    y = y + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1154 <main+0x44>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int yyerror(char const *str) {
  extern char *yytext;
  fprintf(stderr, "parser error near %s\n", yytext);
  return 0;
}


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

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%rdx
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"parser error near %s\0A\00"
@yytext = external global i8*
define i32 @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** @yytext
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"parser error near %s\0A\00"
@yytext = external global i8*
define i32 @yyerror(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** @yytext
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int fun987() { return 987; }


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

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

LLVM IR (-O0):
define i32 @fun987() {
ret i32 987
}

LLVM IR (-O2):
define i32 @fun987() {
ret i32 987
}
/* Type definitions */
struct cramfs_inode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cramfs_inode *);
void iput(struct cramfs_inode *inode) { free(inode); }


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

x86 assembly (clang, -O2):
<iput>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.cramfs_inode = type { i32 }
define void @iput(%struct.cramfs_inode* nocapture %0) {
%2 = tail call i32 @free(%struct.cramfs_inode* %0)
ret void
}
/* Variables and functions */
char *match(char *str, char const *match) {
  while (*match) {
    if (!(*match++ == *str++))
      return NULL;
  }
  return str;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <match+0x57>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1152 <match+0x52>
movq   $0x0,-0x8(%rbp)
jmp    115f <match+0x5f>
jmp    110c <match+0xc>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsi),%ecx
test   %cl,%cl
je     1128 <match+0x28>
add    $0x1,%rsi
lea    0x1(%rax),%rdx
cmp    (%rax),%cl
mov    %rdx,%rax
je     1110 <match+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @match(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %10, %8 ]
%5 = phi i8* [ %1, %2 ], [ %9, %8 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = load i8, i8* %4
%12 = icmp eq i8 %6, %11
br i1 %12, label %3, label %13
13: ; preds = %3, %8
%14 = phi i8* [ null, %8 ], [ %4, %3 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, double, double);
double sys_cputime();
double sys_realtime();
const char *sys_timestamp() {
  static char buf[256];
  double rt, ct;
  rt = sys_realtime();
  ct = sys_cputime();
  snprintf(buf, 255, "%.3f*%.2f", rt, ct / rt);
  return buf;
}


x86 assembly (clang, -O0):
<sys_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <sys_realtime@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <sys_cputime@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  -0x8(%rbp),%xmm1
lea    0x2eea(%rip),%rdi
mov    $0xff,%esi
lea    0xe8e(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2ed2(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_timestamp>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <sys_realtime@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1050 <sys_cputime@plt>
movapd %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm0,%xmm1
lea    0x2ef2(%rip),%rbx
lea    0xe9b(%rip),%rdx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@sys_timestamp.buf = internal global [256 x i8] zeroinitializer
@.str = [10 x i8] c"%.3f*%.2f\00"
define i8* @sys_timestamp() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @sys_realtime()
store double %3, double* %1
%4 = call double (...) @sys_cputime()
store double %4, double* %2
%5 = load double, double* %1
%6 = load double, double* %2
%7 = load double, double* %1
%8 = fdiv double %6, %7
%9 = call i32 @snprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @sys_timestamp.buf, i64 0, i64 0), i32 255, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %5, double %8)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @sys_timestamp.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@sys_timestamp.buf = internal global [256 x i8] zeroinitializer
@.str = [10 x i8] c"%.3f*%.2f\00"
define i8* @sys_timestamp() {
%1 = tail call double (...) @sys_realtime()
%2 = tail call double (...) @sys_cputime()
%3 = fdiv double %2, %1
%4 = tail call i32 @snprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @sys_timestamp.buf, i64 0, i64 0), i32 255, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %1, double %3)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @sys_timestamp.buf, i64 0, i64 0)
}
int release_lease(void *a, void *b, void *c) { return 0; }


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

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

LLVM IR (-O0):
define i32 @release_lease(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
ret i32 0
}

LLVM IR (-O2):
define i32 @release_lease(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void cp_help(void) { puts("usage: cp [file1] [file2]"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"usage: cp [file1] [file2]\00"
define void @cp_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"usage: cp [file1] [file2]\00"
define void @cp_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
foo(int k, int j) {
  if (k >= 10) {
    if (j > k) {
      if (j < 10)
        abort();
    }
  }
  return j;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     114f <foo+0x3f>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    114a <foo+0x3a>
cmpl   $0xa,-0x8(%rbp)
jge    1145 <foo+0x35>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    114a <foo+0x3a>
jmp    114f <foo+0x3f>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0xa,%edi
jl     111e <foo+0xe>
cmp    %edi,%esi
jle    111e <foo+0xe>
cmp    $0x9,%esi
jle    1121 <foo+0x11>
mov    %esi,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @foo(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 = icmp sge i32 %5, 10
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 10
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11
br label %17
17: ; preds = %16, %7
br label %18
18: ; preds = %17, %2
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 returned %1) {
%3 = icmp sgt i32 %0, 9
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = icmp sgt i32 %1, %0
%6 = icmp slt i32 %1, 10
%7 = and i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %4, %2
ret i32 %1
}
/* Type definitions */
struct csa {
  int dummy;
};

/* Variables and functions */
double log(double);
scalar_t__ randy(struct csa *);
int exponential(struct csa *csa, double lambda[1]) {
  return ((int)(-lambda[0] * log((double)randy(csa)) + 0.5));
}


x86 assembly (clang, -O0):
<exponential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <randy@plt>
cvtsi2sd %rax,%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe85(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponential>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <randy@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
movsd  0xeb7(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.csa = type { i32 }
define i32 @exponential(%struct.csa* %0, double* %1) {
%3 = alloca %struct.csa*
%4 = alloca double*
store %struct.csa* %0, %struct.csa** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fneg double %7
%9 = load %struct.csa*, %struct.csa** %3
%10 = call i64 @randy(%struct.csa* %9)
%11 = sitofp i64 %10 to double
%12 = call double @log(double %11)
%13 = call double @llvm.fmuladd.f64(double %8, double %12, double 5.000000e-01)
%14 = fptosi double %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.csa = type { i32 }
define i32 @exponential(%struct.csa* %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fneg double %3
%5 = tail call i64 @randy(%struct.csa* %0)
%6 = sitofp i64 %5 to double
%7 = tail call double @log(double %6)
%8 = tail call double @llvm.fmuladd.f64(double %4, double %7, double 5.000000e-01)
%9 = fptosi double %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ rxReset();
int /*<<< orphan*/ txReset();
void hidPacket_reset() {
  rxReset();
  txReset();
}


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

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

LLVM IR (-O0):
define void @hidPacket_reset() {
%1 = call i32 (...) @rxReset()
%2 = call i32 (...) @txReset()
ret void
}

LLVM IR (-O2):
define void @hidPacket_reset() {
%1 = tail call i32 (...) @rxReset()
%2 = tail call i32 (...) @txReset()
ret void
}
void int_to_ascii_convertor(unsigned int n, unsigned char hex[]) {
  hex[0] = n >> 8;
  hex[1] = n;
}


x86 assembly (clang, -O0):
<int_to_ascii_convertor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_ascii_convertor>:
rol    $0x8,%di
mov    %di,(%rsi)
ret

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

LLVM IR (-O2):
define void @int_to_ascii_convertor(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = trunc i32 %0 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
/* Type definitions */
struct passwd {
  scalar_t__ pw_uid;
};

/* Variables and functions */
struct passwd *getpwnam(char *);
int get_uid(char *user) {
  int retcode;
  struct passwd *pw;
  pw = getpwnam(user);
  if (pw == NULL) {
    retcode = -1;
  } else {
    retcode = (unsigned)pw->pw_uid;
  }
  return retcode;
}


x86 assembly (clang, -O0):
<get_uid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getpwnam@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1140 <get_uid+0x30>
movl   $0xffffffff,-0xc(%rbp)
jmp    114a <get_uid+0x3a>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uid>:
push   %rax
call   1030 <getpwnam@plt>
test   %rax,%rax
je     111f <get_uid+0xf>
mov    (%rax),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i64 }
define i32 @get_uid(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.passwd*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call %struct.passwd* @getpwnam(i8* %5)
store %struct.passwd* %6, %struct.passwd** %4
%7 = load %struct.passwd*, %struct.passwd** %4
%8 = icmp eq %struct.passwd* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %3
br label %15
10: ; preds = %1
%11 = load %struct.passwd*, %struct.passwd** %4
%12 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i32 0, i32 0
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
store i32 %14, i32* %3
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.passwd = type { i64 }
define i32 @get_uid(i8* nocapture %0) {
%2 = tail call %struct.passwd* @getpwnam(i8* %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ branch(int);
int /*<<< orphan*/ expr(int /*<<< orphan*/);
int /*<<< orphan*/ match(char *);
void if_branch() {
  match("if");
  match("(");
  expr(0);
  match(")");
  branch(false);
}


x86 assembly (clang, -O0):
<if_branch>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <match@plt>
lea    0xebc(%rip),%rdi
call   1050 <match@plt>
xor    %edi,%edi
call   1040 <expr@plt>
lea    0xeab(%rip),%rdi
call   1050 <match@plt>
xor    %edi,%edi
call   1030 <branch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_branch>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <match@plt>
lea    0xebf(%rip),%rdi
call   1050 <match@plt>
xor    %edi,%edi
call   1040 <expr@plt>
lea    0xeae(%rip),%rdi
call   1050 <match@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <branch@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"if\00"
@.str.1 = [2 x i8] c"(\00"
@.str.2 = [2 x i8] c")\00"
define void @if_branch() {
%1 = call i32 @match(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @expr(i32 0)
%4 = call i32 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @branch(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"if\00"
@.str.1 = [2 x i8] c"(\00"
@.str.2 = [2 x i8] c")\00"
define void @if_branch() {
%1 = tail call i32 @match(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @expr(i32 0)
%4 = tail call i32 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @branch(i32 0)
ret void
}
/* Variables and functions */
int fabs(double);
double subgrad_huber(double x) {
  if (fabs(x) <= 1) {
    return 2 * x;
  } else {
    return 2 * (x > 0 ? x : -x);
  }
}


x86 assembly (clang, -O0):
<subgrad_huber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
cmp    $0x1,%eax
jg     1147 <subgrad_huber+0x37>
movsd  0xec8(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119f <subgrad_huber+0x8f>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1168 <subgrad_huber+0x58>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1189 <subgrad_huber+0x79>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  0xe6a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subgrad_huber>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
call   1030 <fabs@plt>
movapd (%rsp),%xmm3
movapd %xmm3,%xmm1
cmp    $0x2,%eax
jl     1138 <subgrad_huber+0x28>
movapd 0xecc(%rip),%xmm1
xorpd  %xmm3,%xmm1
xorpd  %xmm0,%xmm0
cmpltsd %xmm3,%xmm0
movapd %xmm0,%xmm2
andnpd %xmm1,%xmm2
andpd  %xmm3,%xmm0
orpd   %xmm2,%xmm0
addsd  %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @subgrad_huber(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i32 @fabs(double %4)
%6 = icmp sle i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load double, double* %3
%9 = fmul double 2.000000e+00, %8
store double %9, double* %2
br label %21
10: ; preds = %1
%11 = load double, double* %3
%12 = fcmp ogt double %11, 0.000000e+00
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load double, double* %3
br label %18
15: ; preds = %10
%16 = load double, double* %3
%17 = fneg double %16
br label %18
18: ; preds = %15, %13
%19 = phi double [ %14, %13 ], [ %17, %15 ]
%20 = fmul double 2.000000e+00, %19
store double %20, double* %2
br label %21
21: ; preds = %18, %7
%22 = load double, double* %2
ret double %22
}

LLVM IR (-O2):
define double @subgrad_huber(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = icmp slt i32 %2, 2
%4 = fcmp ogt double %0, 0.000000e+00
%5 = fneg double %0
%6 = or i1 %4, %3
%7 = select i1 %6, double %0, double %5
%8 = fmul double %7, 2.000000e+00
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ aeron_client_conductor_on_cmd_destination(void *, void *,
                                                             int);
void aeron_client_conductor_on_cmd_add_rcv_destination(void *clientd,
                                                       void *item) {
  aeron_client_conductor_on_cmd_destination(clientd, item, (0x0C));
}


x86 assembly (clang, -O0):
<aeron_client_conductor_on_cmd_add_rcv_destination>:
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    $0xc,%edx
call   1030 <aeron_client_conductor_on_cmd_destination@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_client_conductor_on_cmd_add_rcv_destination>:
mov    $0xc,%edx
jmp    1030 <aeron_client_conductor_on_cmd_destination@plt>

LLVM IR (-O0):
define void @aeron_client_conductor_on_cmd_add_rcv_destination(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 @aeron_client_conductor_on_cmd_destination(i8* %5, i8* %6, i32 12)
ret void
}

LLVM IR (-O2):
define void @aeron_client_conductor_on_cmd_add_rcv_destination(i8* %0, i8* %1) {
%3 = tail call i32 @aeron_client_conductor_on_cmd_destination(i8* %0, i8* %1, i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetNumI2MRows(char byBoardNum, short wNumI2MRows) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetNumI2MRows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
lea    0xed4(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvSetNumI2MRows>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSetNumI2MRows(i8 signext %0, i16 signext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @DetectTlsJa3HashRegisterTests() {
ret void
}
/* Variables and functions */
int next_char();
int /*<<< orphan*/ printf(char *, int);
void dev_random(int trial) {
  int i;
  for (i = trial; i > 0; i--) {
    printf("%d\n", next_char());
  }
}


x86 assembly (clang, -O0):
<dev_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115e <dev_random+0x3e>
mov    $0x0,%al
call   1030 <next_char@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <dev_random+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_random>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1159 <dev_random+0x39>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xecc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <next_char@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1140 <dev_random+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @dev_random(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = tail call i32 (...) @next_char()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nsw i32 %4, -1
%8 = icmp ugt i32 %4, 1
br i1 %8, label %3, label %9
9: ; preds = %3, %1
ret void
}