xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
int main(int argc, char **argv) {
  argv[0] = "egrep";
  execv("/vsta/bin/grep", argv);
  return (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xecf(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <execv@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rax
mov    %rax,(%rsi)
lea    0xee4(%rip),%rdi
call   1030 <execv@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"egrep\00"
@.str.1 = [15 x i8] c"/vsta/bin/grep\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i8**, i8*** %5
%9 = call i32 @execv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %8)
ret i32 1
}

LLVM IR (-O2):
@.str = [6 x i8] c"egrep\00"
@.str.1 = [15 x i8] c"/vsta/bin/grep\00"
define i32 @main(i32 %0, i8** %1) {
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = tail call i32 @execv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %1)
ret i32 1
}
double ret_double2(int i, int j) {
  double d = 0.0 + i + j;
  return d;
}


x86 assembly (clang, -O0):
<ret_double2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
xorps  %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ret_double2>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ret_double2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = fadd double 0.000000e+00, %7
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = fadd double %8, %10
store double %11, double* %5
%12 = load double, double* %5
ret double %12
}

LLVM IR (-O2):
define double @ret_double2(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = fadd double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ array_free(void **);
void mstring_a_hp_stk(char **__dest, char **__src) {
  int i;
  for (i = 0; __src[i]; i++) {
    __dest[i] = __src[i];
  }
  array_free((void **)__src);
}


x86 assembly (clang, -O0):
<mstring_a_hp_stk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1160 <mstring_a_hp_stk+0x50>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <mstring_a_hp_stk+0x17>
mov    -0x10(%rbp),%rdi
call   1030 <array_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstring_a_hp_stk>:
mov    (%rsi),%rax
test   %rax,%rax
je     1132 <mstring_a_hp_stk+0x22>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %rax,(%rdi,%rcx,1)
mov    0x8(%rsi,%rcx,1),%rax
add    $0x8,%rcx
test   %rax,%rax
jne    1120 <mstring_a_hp_stk+0x10>
mov    %rsi,%rdi
jmp    1030 <array_free@plt>

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

LLVM IR (-O2):
define void @mstring_a_hp_stk(i8** nocapture writeonly %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8* [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %6
store i8* %7, i8** %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = tail call i32 @array_free(i8** %1)
ret void
}
void wmf_select_window(int id) { id = id; }


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

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

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

LLVM IR (-O2):
define void @wmf_select_window(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void reset_color() {
  printf("\033[0m");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<reset_color>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_color>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
@stdout = global i32 0
define void @reset_color() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
@stdout = global i32 0
define void @reset_color() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
void Noop() { ; }


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

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

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

LLVM IR (-O2):
define void @Noop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set(int, int);
int /*<<< orphan*/ usleep(int);
void write_zero(void) {
  gpio_set(27, 1);
  usleep((4 * 80));
  gpio_set(27, 0);
  usleep((12 * 80));
  gpio_set(27, 1);
  usleep((4 * 80));
  gpio_set(27, 0);
  usleep((12 * 80));
}


x86 assembly (clang, -O0):
<write_zero>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
mov    $0x1,%esi
call   1030 <gpio_set@plt>
mov    $0x140,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x3c0,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
mov    $0x1,%esi
call   1030 <gpio_set@plt>
mov    $0x140,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x3c0,%edi
call   1040 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_zero>:
push   %rax
mov    $0x1b,%edi
mov    $0x1,%esi
call   1030 <gpio_set@plt>
mov    $0x140,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x3c0,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
mov    $0x1,%esi
call   1030 <gpio_set@plt>
mov    $0x140,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x3c0,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @write_zero() {
%1 = call i32 @gpio_set(i32 27, i32 1)
%2 = call i32 @usleep(i32 320)
%3 = call i32 @gpio_set(i32 27, i32 0)
%4 = call i32 @usleep(i32 960)
%5 = call i32 @gpio_set(i32 27, i32 1)
%6 = call i32 @usleep(i32 320)
%7 = call i32 @gpio_set(i32 27, i32 0)
%8 = call i32 @usleep(i32 960)
ret void
}

LLVM IR (-O2):
define void @write_zero() {
%1 = tail call i32 @gpio_set(i32 27, i32 1)
%2 = tail call i32 @usleep(i32 320)
%3 = tail call i32 @gpio_set(i32 27, i32 0)
%4 = tail call i32 @usleep(i32 960)
%5 = tail call i32 @gpio_set(i32 27, i32 1)
%6 = tail call i32 @usleep(i32 320)
%7 = tail call i32 @gpio_set(i32 27, i32 0)
%8 = tail call i32 @usleep(i32 960)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void write_reclen(FILE *f, int n) {
  fputc(n & 0377, f);
  fputc((n >> 8) & 0377, f);
  fputc((n >> 16) & 0377, f);
  fputc((n >> 24) & 0377, f);
}


x86 assembly (clang, -O0):
<write_reclen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x10,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x18,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_reclen>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @write_reclen(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = load i32*, i32** %3
%8 = call i32 @fputc(i32 %6, i32* %7)
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = call i32 @fputc(i32 %11, i32* %12)
%14 = load i32, i32* %4
%15 = ashr i32 %14, 16
%16 = and i32 %15, 255
%17 = load i32*, i32** %3
%18 = call i32 @fputc(i32 %16, i32* %17)
%19 = load i32, i32* %4
%20 = ashr i32 %19, 24
%21 = and i32 %20, 255
%22 = load i32*, i32** %3
%23 = call i32 @fputc(i32 %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @write_reclen(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @fputc(i32 %3, i32* %0)
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = tail call i32 @fputc(i32 %6, i32* %0)
%8 = lshr i32 %1, 16
%9 = and i32 %8, 255
%10 = tail call i32 @fputc(i32 %9, i32* %0)
%11 = lshr i32 %1, 24
%12 = tail call i32 @fputc(i32 %11, i32* %0)
ret void
}
int ld_gt_rr2(long double a1, long double a2) { return !(((a1) > (a2))); }


x86 assembly (clang, -O0):
<ld_gt_rr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_gt_rr2>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
ret

LLVM IR (-O0):
define i32 @ld_gt_rr2(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp ogt x86_fp80 %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_gt_rr2(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp ule x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ report_fatal(char *, char *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ strsignal(int);
void stop_process(int sig) {
  report_fatal("stop_process()",
               "Signal '%s' caught, process(pid = %u) stopping", strsignal(sig),
               getpid());
}


x86 assembly (clang, -O0):
<stop_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <strsignal@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%edx
mov    %eax,%ecx
lea    0xea7(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1040 <report_fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_process>:
push   %rbx
call   1050 <strsignal@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeba(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    %ebx,%edx
mov    %eax,%ecx
pop    %rbx
jmp    1040 <report_fatal@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"stop_process()\00"
@.str.1 = [47 x i8] c"Signal '%s' caught, process(pid = %u) stopping\00"
define void @stop_process(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @strsignal(i32 %3)
%5 = call i32 (...) @getpid()
%6 = call i32 @report_fatal(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"stop_process()\00"
@.str.1 = [47 x i8] c"Signal '%s' caught, process(pid = %u) stopping\00"
define void @stop_process(i32 %0) {
%2 = tail call i32 @strsignal(i32 %0)
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @report_fatal(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %3)
ret void
}
unsigned long GrMapISO8859_1_Unicode(const char *pcSrcChar,
                                     unsigned long ulCount,
                                     unsigned long *pulSkip) {
  assert(pulSkip);
  assert(pcSrcChar);
  *pulSkip = 1;
  return ((unsigned long)((unsigned char)*pcSrcChar));
}


x86 assembly (clang, -O0):
<GrMapISO8859_1_Unicode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
movq   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GrMapISO8859_1_Unicode>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %rdx,%rdi
xor    %eax,%eax
call   1030 <assert@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <assert@plt>
movq   $0x1,(%rbx)
movzbl (%r14),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @GrMapISO8859_1_Unicode(i8* %0, i64 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
%8 = call i32 (i64*, ...) bitcast (i32 (...)* @assert to i32 (i64*, ...)*)(i64* %7)
%9 = load i8*, i8** %4
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %9)
%11 = load i64*, i64** %6
store i64 1, i64* %11
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i64
ret i64 %14
}

LLVM IR (-O2):
define i64 @GrMapISO8859_1_Unicode(i8* %0, i64 %1, i64* %2) {
%4 = tail call i32 (i64*, ...) bitcast (i32 (...)* @assert to i32 (i64*, ...)*)(i64* %2)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %0)
store i64 1, i64* %2
%6 = load i8, i8* %0
%7 = zext i8 %6 to i64
ret i64 %7
}
/* Variables and functions */
int get_menu_choice();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int choice;
  choice = get_menu_choice();
  printf("You chose Menu Option %d\n", choice);
  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    $0x0,%al
call   1030 <get_menu_choice@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [26 x i8] c"You chose Menu Option %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @get_menu_choice()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ __SOCKADDR_ARG;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int accept(int __fd, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @accept(i32 %0, i32 %1, i32* noalias %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* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @accept(i32 %0, i32 %1, i32* noalias nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ circular();
int /*<<< orphan*/ list();
int /*<<< orphan*/ tail();
int main() {
  list();
  tail();
  circular();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <list@plt>
mov    $0x0,%al
call   1040 <tail@plt>
mov    $0x0,%al
call   1050 <circular@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @list()
%2 = tail call i32 (...) @tail()
%3 = tail call i32 (...) @circular()
ret i32 0
}
/* Type definitions */
struct flock {
  scalar_t__ l_len;
  scalar_t__ l_start;
  int /*<<< orphan*/ l_whence;
  int /*<<< orphan*/ l_type;
};

/* Variables and functions */
int /*<<< orphan*/ F_SETLKW;
int /*<<< orphan*/ F_WRLCK;
int /*<<< orphan*/ SEEK_SET;
int fcntl(int, int /*<<< orphan*/, struct flock *);
int write_lock(int fd) {
  struct flock lock;
  lock.l_type = F_WRLCK;
  lock.l_whence = SEEK_SET;
  lock.l_start = 0;
  lock.l_len = 0;
  return fcntl(fd, F_SETLKW, &lock);
}


x86 assembly (clang, -O0):
<write_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_lock>:
sub    $0x18,%rsp
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <fcntl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i64, i64, i32, i32 }
@F_WRLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLKW = global i32 0
define i32 @write_lock(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.flock
store i32 %0, i32* %2
%4 = load i32, i32* @F_WRLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 3
store i32 %4, i32* %5
%6 = load i32, i32* @SEEK_SET
%7 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 2
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 1
store i64 0, i64* %8
%9 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 0
store i64 0, i64* %9
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETLKW
%12 = call i32 @fcntl(i32 %10, i32 %11, %struct.flock* %3)
ret i32 %12
}

LLVM IR (-O2):
%struct.flock = type { i64, i64, i32, i32 }
@F_WRLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLKW = global i32 0
define i32 @write_lock(i32 %0) {
%2 = alloca %struct.flock
%3 = bitcast %struct.flock* %2 to i8*
%4 = load i32, i32* @F_WRLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 3
store i32 %4, i32* %5
%6 = load i32, i32* @SEEK_SET
%7 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 2
store i32 %6, i32* %7
%8 = bitcast %struct.flock* %2 to i8*
%9 = load i32, i32* @F_SETLKW
%10 = call i32 @fcntl(i32 %0, i32 %9, %struct.flock* %2)
ret i32 %10
}
/* Variables and functions */
size_t string_hash(void *key) {
  unsigned char *string_key = key;
  size_t hash = 5381;
  int c;
  while ((c = *(string_key++))) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x1505,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1152 <string_hash+0x52>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
add    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <string_hash+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <string_hash+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <string_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
int iclamp(double x, double left, double right) {
  if (x < left) {
    return (int)left;
  } else if (x > right) {
    return (int)right;
  } else {
    return (int)x;
  }
}


x86 assembly (clang, -O0):
<iclamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1134 <iclamp+0x34>
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <iclamp+0x59>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1151 <iclamp+0x51>
cvttsd2si -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <iclamp+0x59>
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iclamp>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
cvttsd2si %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @iclamp(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
%8 = fptosi double %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void main(void) {
  char c[] = "GATE2011";
  char *p = c;
  printf("%s\n", p + p[3] - p[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xedf(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rax
movsbl 0x3(%rax),%eax
cltq
add    %rax,%rsi
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
movslq %eax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x3131303245544147,%rax
30 31 31
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
lea    0xc(%rsp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.c = [9 x i8] c"GATE2011\00"
@.str = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [9 x i8]
%2 = alloca i8*
%3 = bitcast [9 x i8]* %1 to i8*
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %5, i64 %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = sext i32 %15 to i64
%17 = sub i64 0, %16
%18 = getelementptr inbounds i8, i8* %11, i64 %17
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
ret void
}

LLVM IR (-O2):
@__const.main.c = [9 x i8] c"GATE2011\00"
@.str = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 4
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int google_chromeec_vbnv_context(int is_read, uint8_t *data, int len) {
  return 0;
}


x86 assembly (clang, -O0):
<google_chromeec_vbnv_context>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @google_chromeec_vbnv_context(i32 %0, i32* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ranged_random_mult64(int /*<<< orphan*/);
void loop_mult64(size_t count, uint32_t range, uint32_t *output) {
  for (size_t i = 0; i < count; i++) {
    *output++ = ranged_random_mult64(range);
  }
}


x86 assembly (clang, -O0):
<loop_mult64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1165 <loop_mult64+0x55>
mov    -0xc(%rbp),%edi
call   1030 <ranged_random_mult64@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x18(%rbp)
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <loop_mult64+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_mult64>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1145 <loop_mult64+0x35>
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r15d,%edi
call   1030 <ranged_random_mult64@plt>
mov    %eax,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <loop_mult64+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @loop_mult64(i64 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = phi i32* [ %10, %6 ], [ %2, %3 ]
%9 = tail call i32 @ranged_random_mult64(i32 %1)
%10 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %9, i32* %8
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %0
br i1 %12, label %5, label %6
}
void view_batch_init(void) {}


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

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

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

LLVM IR (-O2):
define void @view_batch_init() {
ret void
}
unsigned long long int
unsignedlonglongint_ignoring_unsignedchar(unsigned long long int x,
                                          unsigned char y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedlonglongint_ignoring_unsignedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @unsignedlonglongint_ignoring_unsignedchar(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglongint_ignoring_unsignedchar(i64 returned %0, i8 zeroext %1) {
ret i64 %0
}
void bar() {
  struct A {
    int x;
  };
  struct A a;
  a.x = 1;
  {
    struct A {
      int y;
    };
    struct A b;
    b.y = 2;
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.A = type { i32 }
%struct.A.0 = type { i32 }
define void @bar() {
%1 = alloca %struct.A
%2 = alloca %struct.A.0
%3 = getelementptr inbounds %struct.A, %struct.A* %1, i32 0, i32 0
store i32 1, i32* %3
%4 = getelementptr inbounds %struct.A.0, %struct.A.0* %2, i32 0, i32 0
store i32 2, i32* %4
ret void
}

LLVM IR (-O2):
define void @bar() {
ret void
}
void TimerInit(void) {}


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

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

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

LLVM IR (-O2):
define void @TimerInit() {
ret void
}
unsigned not(unsigned a) {
  if (a)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<not>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <not+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <not+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<not>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @not(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void newline_handler(void) { write_src("vid_writef(\"\\n\");\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"vid_writef(\22\\n\22);\0A\00"
define void @newline_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"vid_writef(\22\\n\22);\0A\00"
define void @newline_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_F4int64_lowword_mem(long long *val) {
  return ((*val) & (0xF4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F4int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 244
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t selector_for_index(unsigned index) { return index * 0x0008; }


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

x86 assembly (clang, -O2):
<selector_for_index>:
lea    0x0(,%rdi,8),%eax
ret

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

LLVM IR (-O2):
define i32 @selector_for_index(i32 %0) {
%2 = shl i32 %0, 3
ret i32 %2
}
int main() {
  int a, b;
  while (~scanf("%d %d", &a, &b)) {
    printf("%d\n", a + b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
xor    $0xffffffff,%eax
cmp    $0x0,%eax
je     116a <main+0x4a>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0xffffffff,%eax
je     1186 <main+0x66>
lea    0xebc(%rip),%r14
lea    0xeaf(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopl   0x0(%rax)
mov    (%rsp),%esi
add    0x4(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0xffffffff,%eax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %14, label %7
7: ; preds = %0, %7
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %7
14: ; preds = %7, %0
ret i32 0
}
void __hardpps(const struct timespec *ts1, const struct timespec *ts2) {}


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

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

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

LLVM IR (-O2):
%struct.timespec = type opaque
define void @__hardpps(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
main() { putchar('a'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @putchar(i8 signext 97)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 97)
ret i32 0
}
unsigned long USBHostHubAddrGet(unsigned long ulBase, unsigned long ulEndpoint,
                                unsigned long ulFlags) {
  ;

  ;
  if (ulFlags & 0x00002000) {
    return ((*(
        (volatile unsigned char *)(ulBase + 0x00000082 + (ulEndpoint >> 1)))));
  } else {
    return ((*((volatile unsigned char *)(ulBase + 0x00000082 + 4 +
                                          (ulEndpoint >> 1)))));
  }
}


x86 assembly (clang, -O0):
<USBHostHubAddrGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
and    $0x2000,%rax
cmp    $0x0,%rax
je     1147 <USBHostHubAddrGet+0x47>
mov    -0x10(%rbp),%rax
add    $0x82,%rax
mov    -0x18(%rbp),%rcx
shr    $0x1,%rcx
add    %rcx,%rax
mov    (%rax),%al
movzbl %al,%eax
mov    %rax,-0x8(%rbp)
jmp    1169 <USBHostHubAddrGet+0x69>
mov    -0x10(%rbp),%rax
add    $0x82,%rax
add    $0x4,%rax
mov    -0x18(%rbp),%rcx
shr    $0x1,%rcx
add    %rcx,%rax
mov    (%rax),%al
movzbl %al,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostHubAddrGet>:
xor    %eax,%eax
test   $0x2000,%edx
sete   %al
lea    (%rdi,%rax,4),%rax
shr    %rsi
movzbl 0x82(%rsi,%rax,1),%eax
ret

LLVM IR (-O0):
define i64 @USBHostHubAddrGet(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %7
%9 = and i64 %8, 8192
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %3
%12 = load i64, i64* %5
%13 = add i64 %12, 130
%14 = load i64, i64* %6
%15 = lshr i64 %14, 1
%16 = add i64 %13, %15
%17 = inttoptr i64 %16 to i8*
%18 = load volatile i8, i8* %17
%19 = zext i8 %18 to i64
store i64 %19, i64* %4
br label %30
20: ; preds = %3
%21 = load i64, i64* %5
%22 = add i64 %21, 130
%23 = add i64 %22, 4
%24 = load i64, i64* %6
%25 = lshr i64 %24, 1
%26 = add i64 %23, %25
%27 = inttoptr i64 %26 to i8*
%28 = load volatile i8, i8* %27
%29 = zext i8 %28 to i64
store i64 %29, i64* %4
br label %30
30: ; preds = %20, %11
%31 = load i64, i64* %4
ret i64 %31
}

LLVM IR (-O2):
define i64 @USBHostHubAddrGet(i64 %0, i64 %1, i64 %2) {
%4 = and i64 %2, 8192
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i64 134, i64 130
%7 = add i64 %6, %0
%8 = lshr i64 %1, 1
%9 = add i64 %7, %8
%10 = inttoptr i64 %9 to i8*
%11 = load volatile i8, i8* %10
%12 = zext i8 %11 to i64
ret i64 %12
}
/* Type definitions */
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void get_walltime_(double *wcTime) {
  struct timeval tp;
  gettimeofday(&tp, NULL);
  *wcTime = (double)(tp.tv_sec + tp.tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<get_walltime_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xec4(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_walltime_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
divsd  0xeca(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define void @get_walltime_(double* %0) {
%2 = alloca double*
%3 = alloca %struct.timeval
store double* %0, double** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %7, %10
%12 = load double*, double** %2
store double %11, double* %12
ret void
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define void @get_walltime_(double* nocapture writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %7
store double %11, double* %0
ret void
}
unsigned int readl(const volatile void *addr) {
  unsigned int ret;
  asm volatile("mov"
               "l"
               " %1,%0"
               : "=r"(ret)
               : "m"(*(volatile unsigned int *)addr)
               : "memory");
  return ret;
}


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

x86 assembly (clang, -O2):
<readl>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @readl(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = call i32 asm sideeffect "movl $1,$0", "=r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @readl(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 asm sideeffect "movl $1,$0", "=r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exynos_5410_gpio_write_mask(unsigned int, unsigned int,
                                               unsigned int);
void odroid_xu_gpio_write_26(unsigned int data) {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 0;
  exynos_5410_gpio_write_mask(bank_offset, ((data & 1U) << bit_index),
                              (1U << bit_index));
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_write_26>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xc40,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
and    $0x1,%esi
mov    -0xc(%rbp),%ecx
shl    %cl,%esi
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1030 <exynos_5410_gpio_write_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_write_26>:
mov    %edi,%esi
and    $0x1,%esi
mov    $0xc40,%edi
mov    $0x1,%edx
jmp    1030 <exynos_5410_gpio_write_mask@plt>

LLVM IR (-O0):
define void @odroid_xu_gpio_write_26(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 3136, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = and i32 %6, 1
%8 = load i32, i32* %4
%9 = shl i32 %7, %8
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = call i32 @exynos_5410_gpio_write_mask(i32 %5, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @odroid_xu_gpio_write_26(i32 %0) {
%2 = and i32 %0, 1
%3 = tail call i32 @exynos_5410_gpio_write_mask(i32 3136, i32 %2, i32 1)
ret void
}