xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ CAN_TIMER_SaveConfig();
int /*<<< orphan*/ CAN_TIMER_Stop();
void CAN_TIMER_Sleep(void) {
  CAN_TIMER_Stop();
  CAN_TIMER_SaveConfig();
}


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

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

LLVM IR (-O0):
define void @CAN_TIMER_Sleep() {
%1 = call i32 (...) @CAN_TIMER_Stop()
%2 = call i32 (...) @CAN_TIMER_SaveConfig()
ret void
}

LLVM IR (-O2):
define void @CAN_TIMER_Sleep() {
%1 = tail call i32 (...) @CAN_TIMER_Stop()
%2 = tail call i32 (...) @CAN_TIMER_SaveConfig()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main() {
  if ('M' == 0xd4) {
    exit(0);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
void ref_int64_t(int64_t arg, int64_t *result) { *result = arg; }


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

x86 assembly (clang, -O2):
<ref_int64_t>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @ref_int64_t(i32 %0, i32* nocapture writeonly %1) {
store i32 %0, i32* %1
ret void
}
int main() {
  int strstart = 0;
  int hash_head = 2;
  int prev_length = 5;
  int ins_h = 1;
  int prev[32] = {0};
  int head[32] = {0};
  int window[1024] = {0};
  do {
    strstart++;
    ((ins_h = (((ins_h) << ((15 + 3 - 1) / 3)) ^ (window[(strstart) + 3 - 1])) &
              0xFFFF),
     prev[(strstart)&0xFFFF] = hash_head = head[ins_h],
     head[ins_h] = (strstart));
  } while (--prev_length != 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1120,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
lea    -0x1120(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%ecx
add    $0x3,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xor    -0x1120(%rbp,%rcx,4),%eax
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x120(%rbp,%rax,4),%ecx
mov    %ecx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
cltq
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0x8(%rbp),%ecx
movslq -0x14(%rbp),%rax
mov    %ecx,-0x120(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jne    1177 <main+0x67>
mov    -0x4(%rbp),%eax
add    $0x1120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [32 x i32]
%7 = alloca [32 x i32]
%8 = alloca [1024 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 2, i32* %3
store i32 5, i32* %4
store i32 1, i32* %5
%9 = bitcast [32 x i32]* %6 to i8*
%10 = bitcast [32 x i32]* %7 to i8*
%11 = bitcast [1024 x i32]* %8 to i8*
br label %12
12: ; preds = %37, %0
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
%15 = load i32, i32* %5
%16 = shl i32 %15, 5
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 3
%19 = sub nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [1024 x i32], [1024 x i32]* %8, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = xor i32 %16, %22
%24 = and i32 %23, 65535
store i32 %24, i32* %5
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [32 x i32], [32 x i32]* %7, i64 0, i64 %26
%28 = load i32, i32* %27
store i32 %28, i32* %3
%29 = load i32, i32* %2
%30 = and i32 %29, 65535
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 %31
store i32 %28, i32* %32
%33 = load i32, i32* %2
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [32 x i32], [32 x i32]* %7, i64 0, i64 %35
store i32 %33, i32* %36
br label %37
37: ; preds = %12
%38 = load i32, i32* %4
%39 = add nsw i32 %38, -1
store i32 %39, i32* %4
%40 = icmp ne i32 %39, 0
br i1 %40, label %12, label %41
41: ; preds = %37
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
adrreg0indreg1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (p0[10000000]) = (*p1); }


x86 assembly (clang, -O0):
<adrreg0indreg1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x2625a00(%rax)
02
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0indreg1_set>:
movss  (%rcx),%xmm0
movss  %xmm0,0x2625a00(%rdx)
02
ret

LLVM IR (-O0):
define i32 @adrreg0indreg1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float*, float** %13
%17 = load float, float* %16
%18 = load float*, float** %12
%19 = getelementptr inbounds float, float* %18, i64 10000000
store float %17, float* %19
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @adrreg0indreg1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture %5) {
%7 = load float, float* %5
%8 = getelementptr inbounds float, float* %4, i64 10000000
store float %7, float* %8
ret i32 undef
}
/* Type definitions */
struct of_settings {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct of_settings *);
void of_settings_destroy(struct of_settings *ofsc) { free(ofsc); }


x86 assembly (clang, -O0):
<of_settings_destroy>:
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):
<of_settings_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.of_settings = type { i32 }
define void @of_settings_destroy(%struct.of_settings* nocapture %0) {
%2 = tail call i32 @free(%struct.of_settings* %0)
ret void
}
/* Type definitions */
struct timeval {
  long double tv_sec;
  long double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long double _now(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  const long double secs = tv.tv_sec;
  const long double usecs = tv.tv_usec;
  const long double result = secs + (usecs / 1000000.0);
  return result;
}


x86 assembly (clang, -O0):
<_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
xor    %eax,%eax
mov    %eax,%esi
lea    -0x20(%rbp),%rdi
call   1030 <gettimeofday@plt>
fldt   -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fstpt  -0x40(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
flds   0xec3(%rip)
fdivrp %st,%st(1)
faddp  %st,%st(1)
fstpt  -0x50(%rbp)
fldt   -0x50(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_now>:
sub    $0x28,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
fldt   (%rsp)
fldt   0x10(%rsp)
fdivs  0xed5(%rip)
faddp  %st,%st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { x86_fp80, x86_fp80 }
define x86_fp80 @_now() {
%1 = alloca %struct.timeval
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load x86_fp80, x86_fp80* %6
store x86_fp80 %7, x86_fp80* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load x86_fp80, x86_fp80* %8
store x86_fp80 %9, x86_fp80* %3
%10 = load x86_fp80, x86_fp80* %2
%11 = load x86_fp80, x86_fp80* %3
%12 = fdiv x86_fp80 %11, 0xK4012F424000000000000
%13 = fadd x86_fp80 %10, %12
store x86_fp80 %13, x86_fp80* %4
%14 = load x86_fp80, x86_fp80* %4
ret x86_fp80 %14
}

LLVM IR (-O2):
%struct.timeval = type { x86_fp80, x86_fp80 }
define x86_fp80 @_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = fdiv x86_fp80 %7, 0xK4012F424000000000000
%9 = fadd x86_fp80 %5, %8
ret x86_fp80 %9
}
void vportFinal() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ xf_sum(int /*<<< orphan*/ *, int, int);
uint32_t xf_add(uint32_t a, uint32_t b, int version) {
  uint32_t v[2] = {a, b};
  return xf_sum(v, 2, version);
}


x86 assembly (clang, -O0):
<xf_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x2,%esi
call   1030 <xf_sum@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xf_add>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1030 <xf_sum@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xf_add(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%9 = load i32, i32* %4
store i32 %9, i32* %8
%10 = getelementptr inbounds i32, i32* %8, i64 1
%11 = load i32, i32* %5
store i32 %11, i32* %10
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%13 = load i32, i32* %6
%14 = call i32 @xf_sum(i32* %12, i32 2, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @xf_add(i32 %0, i32 %1, i32 %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %1, i32* %7
%8 = call i32 @xf_sum(i32* %6, i32 2, i32 %2)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy2(char *, char *);
int main(int argc, char *argv[]) {
  char string[32];
  strcpy2(string, "Hello ");
  strcpy2(string, argv[1]);
  printf("hello %s", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1040 <strcpy2@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcpy2@plt>
lea    -0x30(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
lea    0xecf(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <strcpy2@plt>
mov    0x8(%rbx),%rsi
mov    %r14,%rdi
call   1040 <strcpy2@plt>
lea    0xeb8(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Hello \00"
@.str.1 = [9 x i8] c"hello %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [32 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%8 = call i32 @strcpy2(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strcpy2(i8* %9, i8* %12)
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello \00"
@.str.1 = [9 x i8] c"hello %s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy2(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @strcpy2(i8* %4, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void kill_child(pid_t pid) { kill(pid, SIGTERM); }


x86 assembly (clang, -O0):
<kill_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_child>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @kill_child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGTERM
%5 = call i32 @kill(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @kill_child(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = tail call i32 @kill(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
char *strstr(char const *, char const *);
char *os_strstr(const char *haystack, const char *needle) {
  return strstr(haystack, needle);
}


x86 assembly (clang, -O0):
<os_strstr>:
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 <strstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_strstr>:
jmp    1030 <strstr@plt>

LLVM IR (-O0):
define i8* @os_strstr(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 i8* @strstr(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @os_strstr(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %3
}
void yy_2_TableBody(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_2_TableBody(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *_uitoa(int x) {
  static char buf[10];
  sprintf(buf, "%d", x);
  return buf;
}


x86 assembly (clang, -O0):
<_uitoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f04(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_uitoa>:
push   %rbx
mov    %edi,%edx
lea    0x2f0f(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@_uitoa.buf = internal global [10 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @_uitoa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @_uitoa.buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @_uitoa.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@_uitoa.buf = internal global [10 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @_uitoa(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @_uitoa.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @_uitoa.buf, i64 0, i64 0)
}
struct eapol_sm *eapol_sm_init(struct eapol_ctx *ctx) {
  return (struct eapol_sm *)1;
}


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

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

LLVM IR (-O0):
%struct.eapol_sm = type opaque
%struct.eapol_ctx = type opaque
define %struct.eapol_sm* @eapol_sm_init(%struct.eapol_ctx* %0) {
%2 = alloca %struct.eapol_ctx*
store %struct.eapol_ctx* %0, %struct.eapol_ctx** %2
ret %struct.eapol_sm* inttoptr (i64 1 to %struct.eapol_sm*)
}

LLVM IR (-O2):
%struct.eapol_sm = type opaque
%struct.eapol_ctx = type opaque
define %struct.eapol_sm* @eapol_sm_init(%struct.eapol_ctx* nocapture readnone %0) {
ret %struct.eapol_sm* inttoptr (i64 1 to %struct.eapol_sm*)
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int m() { test(10); }


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

x86 assembly (clang, -O2):
<m>:
mov    $0xa,%edi
jmp    1030 <test@plt>

LLVM IR (-O0):
define i32 @m() {
%1 = alloca i32
%2 = call i32 @test(i32 10)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @m() {
%1 = tail call i32 @test(i32 10)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void tick(void) { write(1, ".", 1); }


x86 assembly (clang, -O0):
<tick>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
lea    0xee0(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tick>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define void @tick() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void set_motor_speed(int speed) {
  printf("ERROR: program is attacked without detection!\n");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"ERROR: program is attacked without detection!\0A\00"
define void @set_motor_speed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [46 x i8] c"ERROR: program is attacked without detection!\00"
define void @set_motor_speed(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_25519_sub(uintptr_t, uintptr_t, uintptr_t);
void fiat_25519_sub(uint64_t out1[5], const uint64_t arg1[5],
                    const uint64_t arg2[5]) {
  internal_fiat_25519_sub((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


x86 assembly (clang, -O0):
<fiat_25519_sub>:
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
mov    -0x18(%rbp),%rdx
call   1030 <internal_fiat_25519_sub@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_25519_sub>:
jmp    1030 <internal_fiat_25519_sub@plt>

LLVM IR (-O0):
define void @fiat_25519_sub(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_25519_sub(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_25519_sub(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_25519_sub(i64 %4, i64 %5, i64 %6)
ret void
}
/* Type definitions */
struct table_entry {
  int dummy;
};
struct table_col {
  int dummy;
};

/* Variables and functions */
int l_unit_raw(struct table_col *, struct table_entry *);
int l_unit_us(struct table_col *col, struct table_entry *e) {
  return l_unit_raw(col, e);
}


x86 assembly (clang, -O0):
<l_unit_us>:
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 <l_unit_raw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_unit_us>:
jmp    1030 <l_unit_raw@plt>

LLVM IR (-O0):
%struct.table_col = type { i32 }
%struct.table_entry = type { i32 }
define i32 @l_unit_us(%struct.table_col* %0, %struct.table_entry* %1) {
%3 = alloca %struct.table_col*
%4 = alloca %struct.table_entry*
store %struct.table_col* %0, %struct.table_col** %3
store %struct.table_entry* %1, %struct.table_entry** %4
%5 = load %struct.table_col*, %struct.table_col** %3
%6 = load %struct.table_entry*, %struct.table_entry** %4
%7 = call i32 @l_unit_raw(%struct.table_col* %5, %struct.table_entry* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.table_col = type { i32 }
%struct.table_entry = type { i32 }
define i32 @l_unit_us(%struct.table_col* %0, %struct.table_entry* %1) {
%3 = tail call i32 @l_unit_raw(%struct.table_col* %0, %struct.table_entry* %1)
ret i32 %3
}
char *postdec(char *base) {
  base--;
  return base;
}


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

x86 assembly (clang, -O2):
<postdec>:
lea    -0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @postdec(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i32 -1
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @postdec(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -1
ret i8* %2
}
/* Type definitions */
struct fb_var_screeninfo {
  int xres;
};

/* Variables and functions */
char get_pixel(int x, int y, void *fbp, struct fb_var_screeninfo *vinfo) {
  unsigned long offset = x + y * vinfo->xres;
  return *((char *)fbp + offset * sizeof(char));
}


x86 assembly (clang, -O0):
<get_pixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rdx
imul   (%rdx),%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x0,%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pixel>:
imul   (%rcx),%esi
add    %edi,%esi
movslq %esi,%rax
mov    (%rdx,%rax,1),%al
ret

LLVM IR (-O0):
%struct.fb_var_screeninfo = type { i32 }
define signext i8 @get_pixel(i32 %0, i32 %1, i8* %2, %struct.fb_var_screeninfo* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca %struct.fb_var_screeninfo*
%9 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store %struct.fb_var_screeninfo* %3, %struct.fb_var_screeninfo** %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %8
%13 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = mul nsw i32 %11, %14
%16 = add nsw i32 %10, %15
%17 = sext i32 %16 to i64
store i64 %17, i64* %9
%18 = load i8*, i8** %7
%19 = load i64, i64* %9
%20 = mul i64 %19, 1
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
ret i8 %22
}

LLVM IR (-O2):
%struct.fb_var_screeninfo = type { i32 }
define signext i8 @get_pixel(i32 %0, i32 %1, i8* nocapture %2, %struct.fb_var_screeninfo* nocapture %3) {
%5 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %3, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, %1
%8 = add nsw i32 %7, %0
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %2, i64 %9
%11 = load i8, i8* %10
ret i8 %11
}
void CSAMR3SetScanningEnabled(void) {}


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

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

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

LLVM IR (-O2):
define void @CSAMR3SetScanningEnabled() {
ret void
}
int _ksba_dummyobj_for_broken_ar(int foo) { return foo; }


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

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

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

LLVM IR (-O2):
define i32 @_ksba_dummyobj_for_broken_ar(i32 returned %0) {
ret i32 %0
}
void EVP_PKEY_missing_parameters(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_PKEY_missing_parameters() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ goto_tlr();
void do_TRST() { goto_tlr(); }


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

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

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

LLVM IR (-O2):
define void @do_TRST() {
%1 = tail call i32 (...) @goto_tlr()
ret void
}
int titlen(int *t, int c, int k) {
  int q;
  q = 0;
  while (1) {
    if (*t == 0)
      break;
    if (*t == c)
      break;
    if (*t == '%')
      q = q + k;
    else
      q++;
    t++;
  }
  return (q);
}


x86 assembly (clang, -O0):
<titlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1127 <titlen+0x27>
jmp    1170 <titlen+0x70>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    113b <titlen+0x3b>
jmp    1170 <titlen+0x70>
mov    -0x8(%rbp),%rax
cmpl   $0x25,(%rax)
jne    1156 <titlen+0x56>
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    115f <titlen+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <titlen+0x15>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<titlen>:
mov    (%rdi),%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     113f <titlen+0x3f>
cmp    %esi,%ecx
je     113f <titlen+0x3f>
add    $0x4,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%r8d
cmp    $0x25,%ecx
mov    $0x1,%eax
cmove  %edx,%eax
add    %r8d,%eax
mov    (%rdi),%ecx
test   %ecx,%ecx
je     113f <titlen+0x3f>
add    $0x4,%rdi
cmp    %esi,%ecx
jne    1120 <titlen+0x20>
ret

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

LLVM IR (-O2):
define i32 @titlen(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, 0
%6 = icmp eq i32 %4, %1
%7 = or i1 %5, %6
br i1 %7, label %20, label %8
8: ; preds = %3, %8
%9 = phi i32 [ %16, %8 ], [ %4, %3 ]
%10 = phi i32 [ %14, %8 ], [ 0, %3 ]
%11 = phi i32* [ %15, %8 ], [ %0, %3 ]
%12 = icmp eq i32 %9, 37
%13 = select i1 %12, i32 %2, i32 1
%14 = add nsw i32 %13, %10
%15 = getelementptr inbounds i32, i32* %11, i64 1
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 0
%18 = icmp eq i32 %16, %1
%19 = or i1 %17, %18
br i1 %19, label %20, label %8
20: ; preds = %8, %3
%21 = phi i32 [ 0, %3 ], [ %14, %8 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ bfwrite(char *);
int /*<<< orphan*/ cmdAdd(int);
void cmdSet(int iValue) {
  bfwrite("[-]");
  cmdAdd(iValue);
}


x86 assembly (clang, -O0):
<cmdSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <bfwrite@plt>
mov    -0x4(%rbp),%edi
call   1030 <cmdAdd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdSet>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <bfwrite@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <cmdAdd@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"[-]\00"
define void @cmdSet(i32 %0) {
%2 = tail call i32 @bfwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @cmdAdd(i32 %0)
ret void
}
/* Type definitions */
typedef void mtd_info;
struct device {
  int dummy;
};

/* Variables and functions */
void *dev_get_drvdata(struct device *);
struct mtd_info *dev_to_mtd(struct device *dev) {
  return dev ? dev_get_drvdata(dev) : ((void *)0);
}


x86 assembly (clang, -O0):
<dev_to_mtd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <dev_to_mtd+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <dev_get_drvdata@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <dev_to_mtd+0x34>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1144 <dev_to_mtd+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_to_mtd>:
test   %rdi,%rdi
je     111a <dev_to_mtd+0xa>
jmp    1030 <dev_get_drvdata@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.mtd_info = type opaque
%struct.device = type { i32 }
define %struct.mtd_info* @dev_to_mtd(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
%3 = load %struct.device*, %struct.device** %2
%4 = icmp ne %struct.device* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.device*, %struct.device** %2
%7 = call i8* @dev_get_drvdata(%struct.device* %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i8* [ %7, %5 ], [ null, %8 ]
%11 = bitcast i8* %10 to %struct.mtd_info*
ret %struct.mtd_info* %11
}

LLVM IR (-O2):
%struct.mtd_info = type opaque
%struct.device = type { i32 }
define %struct.mtd_info* @dev_to_mtd(%struct.device* %0) {
%2 = icmp eq %struct.device* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @dev_get_drvdata(%struct.device* %0)
%5 = bitcast i8* %4 to %struct.mtd_info*
br label %6
6: ; preds = %1, %3
%7 = phi %struct.mtd_info* [ %5, %3 ], [ null, %1 ]
ret %struct.mtd_info* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 1; i < 100; i++) {
    if (i % 2 != 0) {
      printf("%d\n", i);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1166 <main+0x56>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1153 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
jmp    1138 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x64,%ebx
je     1149 <main+0x39>
test   $0x1,%bl
je     1130 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 1, %0 ], [ %8, %7 ]
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 100
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hello();
int /*<<< orphan*/ world();
int main(void) {
  hello();
  world();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <hello@plt>
mov    $0x0,%al
call   1030 <world@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @hello()
%2 = call i32 (...) @world()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hello()
%2 = tail call i32 (...) @world()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
short seqFileFormatFp(int /*<<< orphan*/ *, long *, short *);
short seqFileFormat(const char *filename, long *skiplines, short *error) {
  FILE *fseq;
  short format;
  fseq = fopen(filename, "r");
  format = seqFileFormatFp(fseq, skiplines, error);
  if (fseq != NULL)
    fclose(fseq);
  return format;
}


x86 assembly (clang, -O0):
<seqFileFormat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <seqFileFormatFp@plt>
mov    %ax,-0x22(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1181 <seqFileFormat+0x51>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movswl -0x22(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seqFileFormat>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbp
lea    0xebf(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
call   1040 <seqFileFormatFp@plt>
mov    %eax,%ebp
test   %rbx,%rbx
je     1166 <seqFileFormat+0x36>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define signext i16 @seqFileFormat(i8* %0, i64* %1, i16* %2) {
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i16*
%7 = alloca i32*
%8 = alloca i16
store i8* %0, i8** %4
store i64* %1, i64** %5
store i16* %2, i16** %6
%9 = load i8*, i8** %4
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %7
%11 = load i32*, i32** %7
%12 = load i64*, i64** %5
%13 = load i16*, i16** %6
%14 = call signext i16 @seqFileFormatFp(i32* %11, i64* %12, i16* %13)
store i16 %14, i16* %8
%15 = load i32*, i32** %7
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = load i32*, i32** %7
%19 = call i32 @fclose(i32* %18)
br label %20
20: ; preds = %17, %3
%21 = load i16, i16* %8
ret i16 %21
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define signext i16 @seqFileFormat(i8* nocapture %0, i64* %1, i16* %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call signext i16 @seqFileFormatFp(i32* %4, i64* %1, i16* %2)
%6 = icmp eq i32* %4, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @fclose(i32* %4)
br label %9
9: ; preds = %7, %3
ret i16 %5
}
char int_to_leds_m$leds$red_toggle(void) {
  char result;
  result = leds$leds$red_toggle();
  return result;
}


x86 assembly (clang, -O0):
<int_to_leds_m$leds$red_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <leds$leds$red_toggle@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_leds_m$leds$red_toggle>:
push   %rax
xor    %eax,%eax
call   1030 <leds$leds$red_toggle@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @"int_to_leds_m$leds$red_toggle"() {
%1 = alloca i8
%2 = call i32 (...) @"leds$leds$red_toggle"()
%3 = trunc i32 %2 to i8
store i8 %3, i8* %1
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @"int_to_leds_m$leds$red_toggle"() {
%1 = tail call i32 (...) @"leds$leds$red_toggle"()
%2 = trunc i32 %1 to i8
ret i8 %2
}
int n(char c) {
  int s = 0;
  switch (c) {
  case 'I':
    s = 1;
    break;
  case 'V':
    s = 5;
    break;
  case 'X':
    s = 10;
    break;
  case 'L':
    s = 50;
    break;
  case 'C':
    s = 100;
    break;
  case '\0':
    s = 0;
    break;
  }
  return s;
}


x86 assembly (clang, -O0):
<n>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     11b6 <n+0xb6>
jmp    1125 <n+0x25>
mov    -0xc(%rbp),%eax
sub    $0x43,%eax
je     11aa <n+0xaa>
jmp    1136 <n+0x36>
mov    -0xc(%rbp),%eax
sub    $0x49,%eax
je     117a <n+0x7a>
jmp    1147 <n+0x47>
mov    -0xc(%rbp),%eax
sub    $0x4c,%eax
je     119e <n+0x9e>
jmp    1158 <n+0x58>
mov    -0xc(%rbp),%eax
sub    $0x56,%eax
je     1186 <n+0x86>
jmp    1169 <n+0x69>
mov    -0xc(%rbp),%eax
sub    $0x58,%eax
je     1192 <n+0x92>
jmp    11bd <n+0xbd>
movl   $0x1,-0x8(%rbp)
jmp    11bd <n+0xbd>
movl   $0x5,-0x8(%rbp)
jmp    11bd <n+0xbd>
movl   $0xa,-0x8(%rbp)
jmp    11bd <n+0xbd>
movl   $0x32,-0x8(%rbp)
jmp    11bd <n+0xbd>
movl   $0x64,-0x8(%rbp)
jmp    11bd <n+0xbd>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<n>:
xor    %eax,%eax
add    $0xffffffbd,%edi
cmp    $0x15,%edi
ja     111f <n+0x1f>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x64,%eax
ret
mov    $0x1,%eax
ret
mov    $0x32,%eax
ret
mov    $0x5,%eax
ret
mov    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @n(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 73, label %6
i32 86, label %7
i32 88, label %8
i32 76, label %9
i32 67, label %10
i32 0, label %11
]
6: ; preds = %1
store i32 1, i32* %3
br label %12
7: ; preds = %1
store i32 5, i32* %3
br label %12
8: ; preds = %1
store i32 10, i32* %3
br label %12
9: ; preds = %1
store i32 50, i32* %3
br label %12
10: ; preds = %1
store i32 100, i32* %3
br label %12
11: ; preds = %1
store i32 0, i32* %3
br label %12
12: ; preds = %1, %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @n(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %8 [
i32 73, label %3
i32 86, label %4
i32 88, label %5
i32 76, label %6
i32 67, label %7
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i32 [ 100, %7 ], [ 50, %6 ], [ 10, %5 ], [ 5, %4 ], [ 1, %3 ], [ 0, %1 ]
ret i32 %9
}
main() {
  int __attribute__((noderef)) *i = (void *)0;
  return *i;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
unsigned io_tty_cols(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @io_tty_cols() {
ret i32 0
}
/* Type definitions */
struct varscope {
  int dummy;
};
struct var {
  int dummy;
};
struct scope {
  int dummy;
};

/* Variables and functions */
struct var *scope_get(struct scope *, char const *);
struct var *varscope_get(const struct varscope *varscope, const char *varname) {
  return scope_get((struct scope *)varscope, varname);
}


x86 assembly (clang, -O0):
<varscope_get>:
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 <scope_get@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<varscope_get>:
jmp    1030 <scope_get@plt>

LLVM IR (-O0):
%struct.var = type { i32 }
%struct.varscope = type { i32 }
%struct.scope = type { i32 }
define %struct.var* @varscope_get(%struct.varscope* %0, i8* %1) {
%3 = alloca %struct.varscope*
%4 = alloca i8*
store %struct.varscope* %0, %struct.varscope** %3
store i8* %1, i8** %4
%5 = load %struct.varscope*, %struct.varscope** %3
%6 = bitcast %struct.varscope* %5 to %struct.scope*
%7 = load i8*, i8** %4
%8 = call %struct.var* @scope_get(%struct.scope* %6, i8* %7)
ret %struct.var* %8
}

LLVM IR (-O2):
%struct.var = type { i32 }
%struct.varscope = type { i32 }
%struct.scope = type { i32 }
define %struct.var* @varscope_get(%struct.varscope* %0, i8* %1) {
%3 = bitcast %struct.varscope* %0 to %struct.scope*
%4 = tail call %struct.var* @scope_get(%struct.scope* %3, i8* %1)
ret %struct.var* %4
}
/* Type definitions */
struct programmer_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pgm_default();
void pgm_default_4(struct programmer_t *pgm) { pgm_default(); }


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

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

LLVM IR (-O0):
%struct.programmer_t = type { i32 }
define void @pgm_default_4(%struct.programmer_t* %0) {
%2 = alloca %struct.programmer_t*
store %struct.programmer_t* %0, %struct.programmer_t** %2
%3 = call i32 (...) @pgm_default()
ret void
}

LLVM IR (-O2):
%struct.programmer_t = type { i32 }
define void @pgm_default_4(%struct.programmer_t* nocapture readnone %0) {
%2 = tail call i32 (...) @pgm_default()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *const, char *, int *const);
void read_skip_i(const char *const line, int *const var) {
  sscanf(line, "%*s %u", var);
}


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

x86 assembly (clang, -O2):
<read_skip_i>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <sscanf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%*s %u\00"
define void @read_skip_i(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%*s %u\00"
define void @read_skip_i(i8* nocapture %0, i32* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}