xunge/DecIR huggingface dataset:
double sim_38(double h, double f01, double f11, double f2, double f3) {
  return 3 * h * (f01 + 3 * (f11 + f2) + f3) / 8;
}


x86 assembly (clang, -O0):
<sim_38>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
movsd  0xec7(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
addsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_38>:
movsd  0xef8(%rip),%xmm5
mulsd  %xmm5,%xmm0
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm5
addsd  %xmm1,%xmm5
addsd  %xmm4,%xmm5
mulsd  %xmm5,%xmm0
mulsd  0xee0(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @sim_38(double %0, double %1, double %2, double %3, double %4) {
%6 = fmul double %0, 3.000000e+00
%7 = fadd double %2, %3
%8 = tail call double @llvm.fmuladd.f64(double %7, double 3.000000e+00, double %1)
%9 = fadd double %8, %4
%10 = fmul double %6, %9
%11 = fmul double %10, 1.250000e-01
ret double %11
}
int do_525() { return 525; }


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

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

LLVM IR (-O0):
define i32 @do_525() {
ret i32 525
}

LLVM IR (-O2):
define i32 @do_525() {
ret i32 525
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ LittleEndianWriteU32(int /*<<< orphan*/,
                                        int /*<<< orphan*/ *);
void LittleEndianWriteF32(float value, uint8_t *bytes) {
  union {
    float f32;
    uint32_t u32;
  } u;
  u.f32 = value;
  LittleEndianWriteU32(u.u32, bytes);
}


x86 assembly (clang, -O0):
<LittleEndianWriteF32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <LittleEndianWriteU32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LittleEndianWriteF32>:
mov    %rdi,%rsi
movd   %xmm0,%edi
jmp    1030 <LittleEndianWriteU32@plt>

LLVM IR (-O0):
%union.anon = type { float }
define void @LittleEndianWriteF32(float %0, i32* %1) {
%3 = alloca float
%4 = alloca i32*
%5 = alloca %union.anon
store float %0, float* %3
store i32* %1, i32** %4
%6 = load float, float* %3
%7 = bitcast %union.anon* %5 to float*
store float %6, float* %7
%8 = bitcast %union.anon* %5 to i32*
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
%11 = call i32 @LittleEndianWriteU32(i32 %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @LittleEndianWriteF32(float %0, i32* %1) {
%3 = bitcast float %0 to i32
%4 = tail call i32 @LittleEndianWriteU32(i32 %3, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
char *remove_first_slashes(const char *str) {
  static char path[256 + 1];
  int i = 0;
  while (str[i] == '/') {
    i++;
  }
  strcpy(path, str + i);
  return path;
}


x86 assembly (clang, -O0):
<remove_first_slashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1146 <remove_first_slashes+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <remove_first_slashes+0x13>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
lea    0x2ee8(%rip),%rdi
call   1030 <strcpy@plt>
lea    0x2edc(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_first_slashes>:
push   %rbx
mov    %rdi,%rsi
mov    $0xffffffffffffffff,%rax
nopl   0x0(%rax,%rax,1)
cmpb   $0x2f,0x1(%rsi,%rax,1)
lea    0x1(%rax),%rax
je     1120 <remove_first_slashes+0x10>
mov    %eax,%eax
add    %rax,%rsi
lea    0x2f09(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@remove_first_slashes.path = internal global [257 x i8] zeroinitializer
define i8* @remove_first_slashes(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 47
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = call i32 @strcpy(i8* getelementptr inbounds ([257 x i8], [257 x i8]* @remove_first_slashes.path, i64 0, i64 0), i8* %19)
ret i8* getelementptr inbounds ([257 x i8], [257 x i8]* @remove_first_slashes.path, i64 0, i64 0)
}

LLVM IR (-O2):
@remove_first_slashes.path = internal global [257 x i8] zeroinitializer
define i8* @remove_first_slashes(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 47
%7 = add nuw i64 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = tail call i32 @strcpy(i8* getelementptr inbounds ([257 x i8], [257 x i8]* @remove_first_slashes.path, i64 0, i64 0), i8* %10)
ret i8* getelementptr inbounds ([257 x i8], [257 x i8]* @remove_first_slashes.path, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G100_f(char *s) {
  debug("G100_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"G100_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G100_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"G100_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G100_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char *ptr = "test";
  strcpy(ptr, "TEST");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed0(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@.str.1 = [5 x i8] c"TEST\00"
define i32 @main() {
%1 = tail call i32 @strcpy(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t checkbit(uint8_t byte, uint8_t bit) {
  if (byte & (1 << bit)) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<checkbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1130 <checkbit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <checkbit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkbit>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @checkbit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @checkbit(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ test(int *);
int main() {
  int z;
  z = rand();
  test(&z);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @rand()
store i32 %3, i32* %1
%4 = call i32 @test(i32* %1)
ret i32 0
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double now() {
  struct timespec ts;
  clock_gettime(CLOCK_REALTIME, &ts);
  return ts.tv_sec + ts.tv_nsec * 1e-9;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
@CLOCK_REALTIME = global i32 0
define double @now() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 1.000000e-09, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timespec = type { double, i32 }
@CLOCK_REALTIME = global i32 0
define double @now() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.000000e-09, double %6)
ret double %10
}
int setZeroACC(char *STAT, int bit) {
  if (bit == 1)
    *STAT = *STAT | 1;
  else
    *STAT = *STAT & (255 - 1);
}


x86 assembly (clang, -O0):
<setZeroACC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    112c <setZeroACC+0x2c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
or     $0x1,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    1140 <setZeroACC+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xfe,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setZeroACC>:
cmp    $0x1,%esi
sete   %al
mov    (%rdi),%cl
and    $0xfe,%cl
or     %al,%cl
mov    %cl,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @setZeroACC(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = load i8, i8* %0
%5 = and i8 %4, -2
%6 = zext i1 %3 to i8
%7 = or i8 %5, %6
store i8 %7, i8* %0
ret i32 undef
}
/* Type definitions */
struct xw_state {
  int dummy;
};
struct window {
  int dummy;
};
typedef int /*<<< orphan*/ Window;

/* Variables and functions */
struct window **get_window_loc(struct xw_state *, int /*<<< orphan*/);
struct window *get_window(struct xw_state *state, Window window) {
  struct window **p = get_window_loc(state, window);
  return p ? *p : NULL;
}


x86 assembly (clang, -O0):
<get_window>:
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   1030 <get_window_loc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <get_window+0x3a>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1155 <get_window+0x45>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1155 <get_window+0x45>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_window>:
push   %rax
call   1030 <get_window_loc@plt>
test   %rax,%rax
je     1120 <get_window+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.window = type { i32 }
%struct.xw_state = type { i32 }
define %struct.window* @get_window(%struct.xw_state* %0, i32 %1) {
%3 = alloca %struct.xw_state*
%4 = alloca i32
%5 = alloca %struct.window**
store %struct.xw_state* %0, %struct.xw_state** %3
store i32 %1, i32* %4
%6 = load %struct.xw_state*, %struct.xw_state** %3
%7 = load i32, i32* %4
%8 = call %struct.window** @get_window_loc(%struct.xw_state* %6, i32 %7)
store %struct.window** %8, %struct.window*** %5
%9 = load %struct.window**, %struct.window*** %5
%10 = icmp ne %struct.window** %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load %struct.window**, %struct.window*** %5
%13 = load %struct.window*, %struct.window** %12
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %11
%16 = phi %struct.window* [ %13, %11 ], [ null, %14 ]
ret %struct.window* %16
}

LLVM IR (-O2):
%struct.window = type { i32 }
%struct.xw_state = type { i32 }
define %struct.window* @get_window(%struct.xw_state* %0, i32 %1) {
%3 = tail call %struct.window** @get_window_loc(%struct.xw_state* %0, i32 %1)
%4 = icmp eq %struct.window** %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = load %struct.window*, %struct.window** %3
br label %7
7: ; preds = %2, %5
%8 = phi %struct.window* [ %6, %5 ], [ null, %2 ]
ret %struct.window* %8
}
void *Realloc(vpPtr, iSize) void *vpPtr;
{
  void *vpNew;
  vpNew = realloc(vpPtr, iSize);
  return (vpNew);
}


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

x86 assembly (clang, -O2):
<Realloc>:
movslq %esi,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @Realloc(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 = sext i32 %7 to i64
%9 = call i8* @realloc(i8* %6, i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @Realloc(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call i8* @realloc(i8* %0, i64 %3)
ret i8* %4
}
/* Variables and functions */
void RS485_Transmitter_Enable(bool enable) { (void)enable; }


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

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

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

LLVM IR (-O2):
define void @RS485_Transmitter_Enable(i32 %0) {
ret void
}
char *tokenize(char *buf) {
  char *cp = buf;
  while (*buf && *buf != ' ')
    buf++;
  *buf = 0;
  return cp;
}


x86 assembly (clang, -O0):
<tokenize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1135 <tokenize+0x35>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1145 <tokenize+0x45>
jmp    1156 <tokenize+0x56>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <tokenize+0x10>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokenize>:
mov    %rdi,%rax
mov    %rdi,%rcx
testb  $0xdf,(%rcx)
je     1119 <tokenize+0x19>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rcx
testb  $0xdf,(%rcx)
jne    1110 <tokenize+0x10>
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
define i8* @tokenize(i8* returned %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 32, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
store i8 0, i8* %3
ret i8* %0
}
void target_function() {}


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

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

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

LLVM IR (-O2):
define void @target_function() {
ret void
}
void nrf_802154_lp_timer_init(void) {}


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

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

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

LLVM IR (-O2):
define void @nrf_802154_lp_timer_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int firstMissingPositive(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int nums[] = {1};
  int numsSize = sizeof(nums) / 4;
  int ret = firstMissingPositive(nums, numsSize);
  printf("%d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec4(%rip),%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1040 <firstMissingPositive@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1040 <firstMissingPositive@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1 x i32]
%4 = bitcast [1 x i32]* %3 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 1, i32* %5
%6 = call i32 @firstMissingPositive(i32* %5, i32 1)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
void anc_hs_force_charge(int disable) { return; }


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

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

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

LLVM IR (-O2):
define void @anc_hs_force_charge(i32 %0) {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ fstat(int const, struct stat *);
int fd_is_open(const int fd) {
  static struct stat buf;
  return (fstat(fd, &buf) == 0);
}


x86 assembly (clang, -O0):
<fd_is_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f07(%rip),%rsi
call   1030 <fstat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
@fd_is_open.buf = internal global %struct.stat zeroinitializer
define i32 @fd_is_open(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @fstat(i32 %3, %struct.stat* @fd_is_open.buf)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@fd_is_open.buf = internal global %struct.stat zeroinitializer
define i32 @fd_is_open(i32 %0) {
%2 = tail call i64 @fstat(i32 %0, %struct.stat* @fd_is_open.buf)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
struct mufont_s *SCR_RegisterFont(const char *name) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.mufont_s = type opaque
define %struct.mufont_s* @SCR_RegisterFont(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.mufont_s* null
}

LLVM IR (-O2):
%struct.mufont_s = type opaque
define noalias %struct.mufont_s* @SCR_RegisterFont(i8* nocapture readnone %0) {
ret %struct.mufont_s* null
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void small_sleep() {
  static struct timeval timeout;
  timeout.tv_sec = 0;
  timeout.tv_usec = 50000;
  select(0, NULL, NULL, NULL, &timeout);
}


x86 assembly (clang, -O0):
<small_sleep>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,0x2f19(%rip)
movl   $0xc350,0x2f07(%rip)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    0x2efa(%rip),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<small_sleep>:
movq   $0x0,0x2f1d(%rip)
lea    0x2f0e(%rip),%r8
movl   $0xc350,0x2f04(%rip)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <select@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
@small_sleep.timeout = internal global %struct.timeval zeroinitializer
define void @small_sleep() {
store i64 0, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @small_sleep.timeout, i32 0, i32 1)
store i32 50000, i32* getelementptr inbounds (%struct.timeval, %struct.timeval* @small_sleep.timeout, i32 0, i32 0)
%1 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* @small_sleep.timeout)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
@small_sleep.timeout = internal global %struct.timeval zeroinitializer
define void @small_sleep() {
store i64 0, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @small_sleep.timeout, i64 0, i32 1)
store i32 50000, i32* getelementptr inbounds (%struct.timeval, %struct.timeval* @small_sleep.timeout, i64 0, i32 0)
%1 = tail call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* @small_sleep.timeout)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
void dir_join(char *dst, const char *dirname, const char *filename) {
  strcpy(dst, dirname);
  if (dst[strlen(dst) - 1] != '/')
    strcat(dst, "/");
  strcat(dst, filename);
}


x86 assembly (clang, -O0):
<dir_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     118b <dir_join+0x5b>
mov    -0x8(%rbp),%rdi
lea    0xe7a(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_join>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rax,%rbx,1)
je     115f <dir_join+0x2f>
lea    0xea9(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <strcat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define void @dir_join(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %10, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 47
br i1 %18, label %19, label %22
19: ; preds = %3
%20 = load i8*, i8** %4
%21 = call i32 @strcat(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %19, %3
%23 = load i8*, i8** %4
%24 = load i8*, i8** %6
%25 = call i32 @strcat(i8* %23, i8* %24)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @dir_join(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %0, i8* %1)
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 47
br i1 %10, label %13, label %11
11: ; preds = %3
%12 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %3
%14 = tail call i32 @strcat(i8* %0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int strncmp(char const *, char const *, int /*<<< orphan*/);
int sstrcmp(const char *a, const char *b) { return strncmp(a, b, strlen(b)); }


x86 assembly (clang, -O0):
<sstrcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sstrcmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @sstrcmp(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @sstrcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
int ieee802_1x_alloc_kay_sm_hapd(struct hostapd_data *hapd,
                                 struct sta_info *sta) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.hostapd_data = type opaque
%struct.sta_info = type opaque
define i32 @ieee802_1x_alloc_kay_sm_hapd(%struct.hostapd_data* %0, %struct.sta_info* %1) {
%3 = alloca %struct.hostapd_data*
%4 = alloca %struct.sta_info*
store %struct.hostapd_data* %0, %struct.hostapd_data** %3
store %struct.sta_info* %1, %struct.sta_info** %4
ret i32 0
}

LLVM IR (-O2):
%struct.hostapd_data = type opaque
%struct.sta_info = type opaque
define i32 @ieee802_1x_alloc_kay_sm_hapd(%struct.hostapd_data* nocapture readnone %0, %struct.sta_info* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __chk_fail();
int __ptsname_r(int, char *, size_t);
int __ptsname_r_chk(int fd, char *buf, size_t buflen, size_t nreal) {
  if (buflen > nreal)
    __chk_fail();
  return __ptsname_r(fd, buf, buflen);
}


x86 assembly (clang, -O0):
<__ptsname_r_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    114c <__ptsname_r_chk+0x2c>
mov    $0x0,%al
call   1030 <__chk_fail@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <__ptsname_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ptsname_r_chk>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
cmp    %rcx,%rdx
jbe    1138 <__ptsname_r_chk+0x18>
xor    %eax,%eax
call   1030 <__chk_fail@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <__ptsname_r@plt>

LLVM IR (-O0):
define i32 @__ptsname_r_chk(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %7
%10 = load i64, i64* %8
%11 = icmp ugt i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = call i32 (...) @__chk_fail()
br label %14
14: ; preds = %12, %4
%15 = load i32, i32* %5
%16 = load i8*, i8** %6
%17 = load i64, i64* %7
%18 = call i32 @__ptsname_r(i32 %15, i8* %16, i64 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @__ptsname_r_chk(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = icmp ugt i64 %2, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (...) @__chk_fail()
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @__ptsname_r(i32 %0, i8* %1, i64 %2)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(size_t);
unsigned int maxavail();
unsigned memavail(void) {
  char *ptr;
  unsigned size;
  size = maxavail();
  if (size != 0) {
    if ((ptr = malloc((size_t)size)) != NULL) {
      size += memavail();
      free(ptr);
    }
  }
  return size;
}


x86 assembly (clang, -O0):
<memavail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <maxavail@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     118d <memavail+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1188 <memavail+0x48>
call   1050 <memavail@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
jmp    118d <memavail+0x4d>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memavail>:
push   %rbp
push   %r14
push   %rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <maxavail@plt>
test   %eax,%eax
je     1177 <memavail+0x37>
mov    %eax,%ebx
mov    %eax,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1175 <memavail+0x35>
mov    %rax,%r14
call   1050 <memavail@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %r14,%rdi
call   1030 <free@plt>
jmp    1177 <memavail+0x37>
mov    %ebx,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @memavail() {
%1 = tail call i32 (...) @maxavail()
%2 = icmp eq i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = zext i32 %1 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0, %3, %9
%8 = phi i32 [ %11, %9 ], [ %1, %3 ], [ 0, %0 ]
ret i32 %8
9: ; preds = %3
%10 = tail call i32 @memavail()
%11 = add i32 %10, %1
%12 = tail call i32 @free(i8* %5)
br label %7
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
bool InsSequenceLe(uint16_t a, uint16_t b) { return (int16_t)(a - b) <= 0; }


x86 assembly (clang, -O0):
<InsSequenceLe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
cmp    $0x0,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<InsSequenceLe>:
xor    %eax,%eax
cmp    %rsi,%rdi
setle  %al
ret

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

LLVM IR (-O2):
define i32 @InsSequenceLe(i64 %0, i64 %1) {
%3 = icmp sle i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int setbit(int num, int i) { return num | (1 << i); }


x86 assembly (clang, -O0):
<setbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbit>:
mov    %edi,%eax
bts    %esi,%eax
ret

LLVM IR (-O0):
define i32 @setbit(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 = shl i32 1, %6
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @setbit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void print_usage(const char *prog) {
  fprintf(stdout, "Usage: %s [-b bus][-s slave]\n", prog);
  fprintf(stdout, " -b bus : i2c bus number.\n");
  fprintf(stdout, " -s addr: i2c slave address.\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeea(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef5(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [30 x i8] c"Usage: %s [-b bus][-s slave]\0A\00"
@.str.1 = [27 x i8] c" -b bus : i2c bus number.\0A\00"
@.str.2 = [30 x i8] c" -s addr: i2c slave address.\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdout
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [30 x i8] c"Usage: %s [-b bus][-s slave]\0A\00"
@.str.1 = [27 x i8] c" -b bus : i2c bus number.\0A\00"
@.str.2 = [30 x i8] c" -s addr: i2c slave address.\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct passwd {
  char const *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
const char *Sys_GetUsername() {
  struct passwd *passwdstr = getpwuid(getuid());
  if (passwdstr == NULL)
    return "CoD-Admin";
  return passwdstr->pw_name;
}


x86 assembly (clang, -O0):
<Sys_GetUsername>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <Sys_GetUsername+0x35>
lea    0xeb4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <Sys_GetUsername+0x40>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_GetUsername>:
push   %rax
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1139 <Sys_GetUsername+0x19>
mov    (%rax),%rax
pop    %rcx
ret
lea    0xec0(%rip),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [10 x i8] c"CoD-Admin\00"
define i8* @Sys_GetUsername() {
%1 = tail call i32 (...) @getuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %0, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %0 ]
ret i8* %8
}
/* Variables and functions */
int system(char const *);
int ifconfigExec(const char *cmd) {
  int ret = system(cmd);
  return ret;
}


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

x86 assembly (clang, -O2):
<ifconfigExec>:
jmp    1030 <system@plt>

LLVM IR (-O0):
define i32 @ifconfigExec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @system(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @ifconfigExec(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
void foo589(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo589(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ofwo_dump();
void dump_config(void) { ofwo_dump(); }


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

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

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

LLVM IR (-O2):
define void @dump_config() {
%1 = tail call i32 (...) @ofwo_dump()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error_mem_out(void) {
  fprintf(stderr, "CUTE: Out of memory!!\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"CUTE: Out of memory!!\0A\00"
define void @error_mem_out() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"CUTE: Out of memory!!\0A\00"
define void @error_mem_out() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int fn2(int a, int b) {
  ++a;
  return b;
}


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

x86 assembly (clang, -O2):
<fn2>:
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @fn2(i32 %0, i32 returned %1) {
ret i32 %1
}
void gtk_toolbar_style_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_style_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__1__GeneralIO__set();
void CC2420ControlP__CSN__set(void) { Msp430GpioC__1__GeneralIO__set(); }


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

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

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

LLVM IR (-O2):
define void @CC2420ControlP__CSN__set() {
%1 = tail call i32 (...) @Msp430GpioC__1__GeneralIO__set()
ret void
}
int main() {
  int a = 5;
  a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-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
store i32 5, i32* %1
%2 = load i32, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}