xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int arr[], int m) {
  for (int i = 0; i < m; i++)
    printf("%d ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ _checksum(void const *, unsigned int, int /*<<< orphan*/);
uint8_t ipmi_checksum(const void *buf, unsigned int buflen) {
  uint8_t checksum;
  checksum = _checksum(buf, buflen, 0);
  return (-checksum);
}


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

x86 assembly (clang, -O2):
<ipmi_checksum>:
push   %rax
xor    %edx,%edx
call   1030 <_checksum@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ipmi_checksum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @_checksum(i8* %6, i32 %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @ipmi_checksum(i8* %0, i32 %1) {
%3 = tail call i32 @_checksum(i8* %0, i32 %1, i32 0)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_tablefunc_describe(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_tablefunc_describe() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_tablefunc_describe() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ nn_ins_init();
void nn_inproc_init(void) { nn_ins_init(); }


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

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

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

LLVM IR (-O2):
define void @nn_inproc_init() {
%1 = tail call i32 (...) @nn_ins_init()
ret void
}
/* Variables and functions */
int yylex();
void testTortureExecute(void) {
  int ch = yylex();
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <yylex@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = alloca i32
%2 = call i32 (...) @yylex()
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 (...) @yylex()
ret void
}
void corner_dtrtri_1x1_lib4(double *A, int use_inv_diag_A, double *inv_diag_A,
                            double *C) {
  const int bs = 4;
  double c_00, c_10, c_11;
  if (use_inv_diag_A) {
    c_00 = inv_diag_A[0];
  } else {
    c_00 = 1.0 / A[0 + bs * 0];
  }
  C[0 + bs * 0] = c_00;
  return;
}


x86 assembly (clang, -O0):
<corner_dtrtri_1x1_lib4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x4,-0x24(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1136 <corner_dtrtri_1x1_lib4+0x36>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    114b <corner_dtrtri_1x1_lib4+0x4b>
mov    -0x8(%rbp),%rax
movsd  0xebe(%rip),%xmm0
divsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<corner_dtrtri_1x1_lib4>:
test   %esi,%esi
je     110d <corner_dtrtri_1x1_lib4+0xd>
movsd  (%rdx),%xmm0
movsd  %xmm0,(%rcx)
ret
movsd  0xeeb(%rip),%xmm0
divsd  (%rdi),%xmm0
movsd  %xmm0,(%rcx)
ret

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

LLVM IR (-O2):
define void @corner_dtrtri_1x1_lib4(double* nocapture %0, i32 %1, double* nocapture %2, double* nocapture writeonly %3) {
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = load double, double* %2
br label %11
8: ; preds = %4
%9 = load double, double* %0
%10 = fdiv double 1.000000e+00, %9
br label %11
11: ; preds = %8, %6
%12 = phi double [ %7, %6 ], [ %10, %8 ]
store double %12, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_name(int id) { printf("{%d}", id); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"{%d}\00"
define void @print_name(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct tms {
  scalar_t__ tms_utime;
};

/* Variables and functions */
int /*<<< orphan*/ times(struct tms *);
int curtime(void) {
  struct tms t;
  times(&t);
  return (int)t.tms_utime;
}


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

x86 assembly (clang, -O2):
<curtime>:
push   %rax
mov    %rsp,%rdi
call   1030 <times@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tms = type { i64 }
define i32 @curtime() {
%1 = alloca %struct.tms
%2 = call i32 @times(%struct.tms* %1)
%3 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
%struct.tms = type { i64 }
define i32 @curtime() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
bool isOpen_3(FILE *this) { return this != NULL; }


x86 assembly (clang, -O0):
<isOpen_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOpen_3>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @isOpen_3(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isOpen_3(i32* readnone %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int snprintf(char *, int, char *, int);
int senFunc2(char *s, int n, int a) { return snprintf(s, n, "Light: %d", a); }


x86 assembly (clang, -O0):
<senFunc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
lea    0xecd(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<senFunc2>:
mov    %edx,%ecx
lea    0xee7(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Light: %d\00"
define i32 @senFunc2(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [10 x i8] c"Light: %d\00"
define i32 @senFunc2(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %4
}
void xchg(long *ptr, long dst) {
  asm volatile("xchg %0, %1" : "+r"(dst), "+m"(*ptr)::"memory", "cc");
}


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

x86 assembly (clang, -O2):
<xchg>:
xchg   %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @xchg(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64*, i64** %3
%7 = call i64 asm sideeffect "xchg $0, $1", "=r,=*m,0,*m,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %5, i64* elementtype(i64) %6)
store i64 %7, i64* %4
ret void
}

LLVM IR (-O2):
define void @xchg(i64* %0, i64 %1) {
%3 = tail call i64 asm sideeffect "xchg $0, $1", "=r,=*m,0,*m,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %1, i64* elementtype(i64) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int system(char *);
int main(void) {
  int r;
  r = system("ls -al");
  if (r == -1)
    perror("system");
  return r;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1154 <main+0x34>
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1138 <main+0x18>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
jmp    1134 <main+0x14>

LLVM IR (-O0):
@.str = [7 x i8] c"ls -al\00"
@.str.1 = [7 x i8] c"system\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"ls -al\00"
@.str.1 = [7 x i8] c"system\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 %1
}
int rl_vi_search_again(count, key)
int count, key;
{
  switch (key) {
  case 'n':
    rl_noninc_reverse_search_again(count, key);
    break;
  case 'N':
    rl_noninc_forward_search_again(count, key);
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<rl_vi_search_again>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4e,%eax
je     1165 <rl_vi_search_again+0x45>
jmp    1142 <rl_vi_search_again+0x22>
mov    -0xc(%rbp),%eax
sub    $0x6e,%eax
jne    1172 <rl_vi_search_again+0x52>
jmp    1153 <rl_vi_search_again+0x33>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1040 <rl_noninc_reverse_search_again@plt>
jmp    1172 <rl_vi_search_again+0x52>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <rl_noninc_forward_search_again@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_vi_search_again>:
push   %rax
cmp    $0x4e,%esi
je     1139 <rl_vi_search_again+0x19>
cmp    $0x6e,%esi
jne    1145 <rl_vi_search_again+0x25>
mov    $0x6e,%esi
xor    %eax,%eax
call   1040 <rl_noninc_reverse_search_again@plt>
jmp    1145 <rl_vi_search_again+0x25>
mov    $0x4e,%esi
xor    %eax,%eax
call   1030 <rl_noninc_forward_search_again@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rl_vi_search_again(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
switch i32 %5, label %14 [
i32 110, label %6
i32 78, label %10
]
6: ; preds = %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_noninc_reverse_search_again to i32 (i32, i32, ...)*)(i32 %7, i32 %8)
br label %14
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_noninc_forward_search_again to i32 (i32, i32, ...)*)(i32 %11, i32 %12)
br label %14
14: ; preds = %2, %10, %6
ret i32 0
}

LLVM IR (-O2):
define i32 @rl_vi_search_again(i32 %0, i32 %1) {
switch i32 %1, label %7 [
i32 110, label %3
i32 78, label %5
]
3: ; preds = %2
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_noninc_reverse_search_again to i32 (i32, i32, ...)*)(i32 %0, i32 110)
br label %7
5: ; preds = %2
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_noninc_forward_search_again to i32 (i32, i32, ...)*)(i32 %0, i32 78)
br label %7
7: ; preds = %2, %5, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char message[] = "UCSC Contest Problem Two is too hard for you, give up!";
  printf("%s\n", message);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x37,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x21707520657669,%rax
mov    %rax,0x2f(%rsp)
lea    0xeea(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.message = [55 x i8] c"UCSC Contest Problem Two is too hard for you, give up!\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [55 x i8]
store i32 0, i32* %1
%3 = bitcast [55 x i8]* %2 to i8*
%4 = getelementptr inbounds [55 x i8], [55 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.message = [55 x i8] c"UCSC Contest Problem Two is too hard for you, give up!\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [55 x i8]
%2 = getelementptr inbounds [55 x i8], [55 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
uid_t getuid(void) {
  printf("getuid\n");
  return 0x0ddba11;
}


x86 assembly (clang, -O0):
<getuid>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xddba11,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getuid>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xddba11,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"getuid\0A\00"
define i32 @getuid() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 14531089
}

LLVM IR (-O2):
@str = [7 x i8] c"getuid\00"
define i32 @getuid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 14531089
}
void wait_sem(void) {}


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

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

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

LLVM IR (-O2):
define void @wait_sem() {
ret void
}
/* Variables and functions */
int pow(int, int);
float exponentialEaseOutf(float p) {
  return (p == 1.0) ? p : 1 - pow(2, -10 * p);
}


x86 assembly (clang, -O0):
<exponentialEaseOutf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    114d <exponentialEaseOutf+0x3d>
jp     114d <exponentialEaseOutf+0x3d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    117a <exponentialEaseOutf+0x6a>
movss  0xeb3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponentialEaseOutf>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1120 <exponentialEaseOutf+0x10>
jnp    1144 <exponentialEaseOutf+0x34>
mulss  0xedc(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @exponentialEaseOutf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp oeq double %4, 1.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %2
br label %15
8: ; preds = %1
%9 = load float, float* %2
%10 = fmul float -1.000000e+01, %9
%11 = fptosi float %10 to i32
%12 = call i32 @pow(i32 2, i32 %11)
%13 = sub nsw i32 1, %12
%14 = sitofp i32 %13 to float
br label %15
15: ; preds = %8, %6
%16 = phi float [ %7, %6 ], [ %14, %8 ]
ret float %16
}

LLVM IR (-O2):
define float @exponentialEaseOutf(float %0) {
%2 = fcmp oeq float %0, 1.000000e+00
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = fmul float %0, -1.000000e+01
%5 = fptosi float %4 to i32
%6 = tail call i32 @pow(i32 2, i32 %5)
%7 = sub nsw i32 1, %6
%8 = sitofp i32 %7 to float
br label %9
9: ; preds = %1, %3
%10 = phi float [ %8, %3 ], [ 1.000000e+00, %1 ]
ret float %10
}
void gtk_widget_grab_focus() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_grab_focus() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO2(long, long);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, long *);
long int BNCField() {
  long int ii, jj = 46, stat = 99;
  printf("Field number (0-9), 0=turns curser off ?\n");
  scanf("%li", &ii);
  BNCIO2(jj, ii);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCField>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x2e,-0x10(%rbp)
movq   $0x63,-0x18(%rbp)
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <BNCIO2@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCField>:
push   %rax
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rsi
mov    $0x2e,%edi
call   1040 <BNCIO2@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Field number (0-9), 0=turns curser off ?\0A\00"
@.str.1 = [4 x i8] c"%li\00"
define i64 @BNCField() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
store i64 46, i64* %2
store i64 99, i64* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%6 = load i64, i64* %2
%7 = load i64, i64* %1
%8 = call i32 @BNCIO2(i64 %6, i64 %7)
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%li\00"
@str = [41 x i8] c"Field number (0-9), 0=turns curser off ?\00"
define i64 @BNCField() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = call i32 @BNCIO2(i64 46, i64 %5)
ret i64 99
}
const char *test_2_get_description(void) {
  return "Create a directory named test_2_test_dir_pid, where "
         "pid is the process id.  Within that directory, "
         "create about 1000 files.  Append 400 bytes to each until "
         "the file system is full.  Then delete half of them.  Then "
         "create a big file that uses about 2/3 of the remaining free "
         "space.  Get a file descriptor for the big file, and delete "
         "the big file.  Then repeatedly write to the small files "
         "and the big file. "
         "Finally delete the big file and directory.";
}


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

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

LLVM IR (-O0):
@.str = [450 x i8] c"Create a directory named test_2_test_dir_pid, where pid is the process id. Within that directory, create about 1000 files. Append 400 bytes to each until the file system is full. Then delete half of them. Then create a big file that uses about 2/3 of the remaining free space. Get a file descriptor for the big file, and delete the big file. Then repeatedly write to the small files and the big file. Finally delete the big file and directory.\00"
define i8* @test_2_get_description() {
ret i8* getelementptr inbounds ([450 x i8], [450 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [450 x i8] c"Create a directory named test_2_test_dir_pid, where pid is the process id. Within that directory, create about 1000 files. Append 400 bytes to each until the file system is full. Then delete half of them. Then create a big file that uses about 2/3 of the remaining free space. Get a file descriptor for the big file, and delete the big file. Then repeatedly write to the small files and the big file. Finally delete the big file and directory.\00"
define i8* @test_2_get_description() {
ret i8* getelementptr inbounds ([450 x i8], [450 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void cursorforward(int arg) {
  printf("\x1b["
         "%dC",
         arg);
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dC\00"
define void @cursorforward(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dC\00"
define void @cursorforward(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_error_set(int /*<<< orphan*/ *);
int my_error() {
  my_error_set(NULL);
  return (-1);
}


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

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

LLVM IR (-O0):
define i32 @my_error() {
%1 = call i32 @my_error_set(i32* null)
ret i32 -1
}

LLVM IR (-O2):
define i32 @my_error() {
%1 = tail call i32 @my_error_set(i32* null)
ret i32 -1
}
/* Type definitions */
struct termios {
  int /*<<< orphan*/ c_ispeed;
};
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
int /*<<< orphan*/ _DIAGASSERT(int /*<<< orphan*/);
speed_t cfgetispeed(const struct termios *t) {
  _DIAGASSERT(t != NULL);
  return (t->c_ispeed);
}


x86 assembly (clang, -O0):
<cfgetispeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <_DIAGASSERT@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfgetispeed>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <_DIAGASSERT@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @cfgetispeed(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = icmp ne %struct.termios* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @_DIAGASSERT(i32 %5)
%7 = load %struct.termios*, %struct.termios** %2
%8 = getelementptr inbounds %struct.termios, %struct.termios* %7, i32 0, i32 0
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @cfgetispeed(%struct.termios* %0) {
%2 = icmp ne %struct.termios* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @_DIAGASSERT(i32 %3)
%5 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ convert(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  printf("Binary of 23: ");
  convert(79, 2);
  puts("");
  convert(79, 8);
  puts("");
  convert(79, 16);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1050 <printf@plt>
mov    $0x4f,%edi
mov    $0x2,%esi
call   1030 <convert@plt>
lea    0xead(%rip),%rdi
call   1040 <puts@plt>
mov    $0x4f,%edi
mov    $0x8,%esi
call   1030 <convert@plt>
lea    0xe92(%rip),%rdi
call   1040 <puts@plt>
mov    $0x4f,%edi
mov    $0x10,%esi
call   1030 <convert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <printf@plt>
mov    $0x4f,%edi
mov    $0x2,%esi
call   1040 <convert@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x4f,%edi
mov    $0x8,%esi
call   1040 <convert@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x4f,%edi
mov    $0x10,%esi
call   1040 <convert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Binary of 23: \00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @convert(i32 79, i32 2)
%4 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @convert(i32 79, i32 8)
%6 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @convert(i32 79, i32 16)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Binary of 23: \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @convert(i32 79, i32 2)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @convert(i32 79, i32 8)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @convert(i32 79, i32 16)
ret i32 0
}
int do_nothing_printf(char const *format __attribute__((unused)), ...) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @do_nothing_printf(i8* nocapture readnone %0, ...) {
ret i32 0
}
int tmin(void) { return 1 << 31; }


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

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

LLVM IR (-O0):
define i32 @tmin() {
ret i32 -2147483648
}

LLVM IR (-O2):
define i32 @tmin() {
ret i32 -2147483648
}
int GetCacheLineSize(VOID) {
  unsigned _eax, _ebx, _ecx, _edx;
  __asm__ __volatile__("cpuid"
                       : "=a"(_eax), "=b"(_ebx), "=c"(_ecx), "=d"(_edx)
                       : "a"(1));
  return ((_ebx >> 8) & 0xFF) * 8;
}


x86 assembly (clang, -O0):
<GetCacheLineSize>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    $0x1,%eax
cpuid
mov    %eax,-0x10(%rbp)
mov    %ebx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
shl    $0x3,%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCacheLineSize>:
push   %rbx
mov    $0x1,%eax
cpuid
mov    %ebx,%eax
shr    $0x5,%eax
and    $0x7f8,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @GetCacheLineSize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 1)
%8 = extractvalue { i32, i32, i32, i32 } %7, 0
%9 = extractvalue { i32, i32, i32, i32 } %7, 1
%10 = extractvalue { i32, i32, i32, i32 } %7, 2
%11 = extractvalue { i32, i32, i32, i32 } %7, 3
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
store i32 %11, i32* %6
%12 = load i32, i32* %4
%13 = lshr i32 %12, 8
%14 = and i32 %13, 255
%15 = mul i32 %14, 8
ret i32 %15
}

LLVM IR (-O2):
define i32 @GetCacheLineSize(i32 %0) {
%2 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 1)
%3 = extractvalue { i32, i32, i32, i32 } %2, 1
%4 = lshr i32 %3, 5
%5 = and i32 %4, 2040
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CompileArgument();
int /*<<< orphan*/ WriteInstruction(char *);
void CR_Delay(void) {
  CompileArgument();
  WriteInstruction("ld b,a");
  WriteInstruction("call delay");
}


x86 assembly (clang, -O0):
<CR_Delay>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CompileArgument@plt>
lea    0xece(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec9(%rip),%rdi
call   1040 <WriteInstruction@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_Delay>:
push   %rax
xor    %eax,%eax
call   1030 <CompileArgument@plt>
lea    0xed1(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <WriteInstruction@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ld b,a\00"
@.str.1 = [11 x i8] c"call delay\00"
define void @CR_Delay() {
%1 = call i32 (...) @CompileArgument()
%2 = call i32 @WriteInstruction(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ld b,a\00"
@.str.1 = [11 x i8] c"call delay\00"
define void @CR_Delay() {
%1 = tail call i32 (...) @CompileArgument()
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct BX_Set {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BX_Set_EQ(struct BX_Set *, struct BX_Set *);
bool BX_Set_NE(struct BX_Set *self, struct BX_Set *other) {
  return !BX_Set_EQ(self, other);
}


x86 assembly (clang, -O0):
<BX_Set_NE>:
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 <BX_Set_EQ@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BX_Set_NE>:
push   %rax
call   1030 <BX_Set_EQ@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.BX_Set = type { i32 }
define i32 @BX_Set_NE(%struct.BX_Set* %0, %struct.BX_Set* %1) {
%3 = alloca %struct.BX_Set*
%4 = alloca %struct.BX_Set*
store %struct.BX_Set* %0, %struct.BX_Set** %3
store %struct.BX_Set* %1, %struct.BX_Set** %4
%5 = load %struct.BX_Set*, %struct.BX_Set** %3
%6 = load %struct.BX_Set*, %struct.BX_Set** %4
%7 = call i32 @BX_Set_EQ(%struct.BX_Set* %5, %struct.BX_Set* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.BX_Set = type { i32 }
define i32 @BX_Set_NE(%struct.BX_Set* %0, %struct.BX_Set* %1) {
%3 = tail call i32 @BX_Set_EQ(%struct.BX_Set* %0, %struct.BX_Set* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int sizes_equal(size_t a, size_t b) { return a == b; }


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

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

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

LLVM IR (-O2):
define i32 @sizes_equal(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
char *adfGetVersionDate() { return ("January 20th, 2007"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"January 20th, 2007\00"
define i8* @adfGetVersionDate() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"January 20th, 2007\00"
define i8* @adfGetVersionDate() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ write_log(char *, char, char const *, char);
void write_block_sep_log(const char *name) {
  write_log("%c\n=== %s ===\n%c\n", '#', name, '#');
}


x86 assembly (clang, -O0):
<write_block_sep_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
mov    $0x23,%ecx
mov    %ecx,%esi
call   1030 <write_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_block_sep_log>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
mov    $0x23,%esi
mov    $0x23,%ecx
jmp    1030 <write_log@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%c\0A=== %s ===\0A%c\0A\00"
define void @write_block_sep_log(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write_log(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext 35, i8* %3, i8 signext 35)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%c\0A=== %s ===\0A%c\0A\00"
define void @write_block_sep_log(i8* %0) {
%2 = tail call i32 @write_log(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext 35, i8* %0, i8 signext 35)
ret void
}
/* Variables and functions */
int rand();
int r4() { return rand() % 4; }


x86 assembly (clang, -O0):
<r4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r4>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @r4() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 4
ret i32 %2
}

LLVM IR (-O2):
define i32 @r4() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 4
ret i32 %2
}
/* Variables and functions */
scalar_t__ islower(char);
int isTerminal(char x) {
  if (islower(x))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isTerminal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113d <isTerminal+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <isTerminal+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isTerminal>:
push   %rax
call   1030 <islower@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isTerminal(i8 signext %0) {
%2 = tail call i64 @islower(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t ld_u32_le(const void *x) {
  return ((((((uint32_t)(((uint8_t *)x)[3])) << 8) |
            ((uint32_t)(((uint8_t *)x)[2])))
           << 16) |
          ((((uint32_t)(((uint8_t *)x)[1])) << 8) |
           ((uint32_t)(((uint8_t *)x)[0]))));
}


x86 assembly (clang, -O0):
<ld_u32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
or     %ecx,%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rdx
or     %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_u32_le>:
mov    0x18(%rdi),%ecx
mov    0x8(%rdi),%edx
mov    0x10(%rdi),%eax
shl    $0x18,%ecx
shl    $0x10,%eax
or     %ecx,%eax
shl    $0x8,%edx
or     (%rdi),%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @ld_u32_le(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = getelementptr inbounds i64, i64* %4, i64 3
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = bitcast i8* %9 to i64*
%11 = getelementptr inbounds i64, i64* %10, i64 2
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = or i32 %8, %13
%15 = shl i32 %14, 16
%16 = load i8*, i8** %2
%17 = bitcast i8* %16 to i64*
%18 = getelementptr inbounds i64, i64* %17, i64 1
%19 = load i64, i64* %18
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 8
%22 = load i8*, i8** %2
%23 = bitcast i8* %22 to i64*
%24 = getelementptr inbounds i64, i64* %23, i64 0
%25 = load i64, i64* %24
%26 = trunc i64 %25 to i32
%27 = or i32 %21, %26
%28 = or i32 %15, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @ld_u32_le(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 24
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds i8, i8* %0, i64 16
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %6, 24
%12 = shl i32 %10, 16
%13 = getelementptr inbounds i8, i8* %0, i64 8
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 8
%18 = load i64, i64* %2
%19 = trunc i64 %18 to i32
%20 = or i32 %12, %11
%21 = or i32 %20, %19
%22 = or i32 %21, %17
ret i32 %22
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
bool mii_can_100_mbps_full_dp(uint16_t bmsr) {
  return (bmsr & (0x00004000 | 0x00000400));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4400,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edi,%eax
and    $0x4400,%eax
ret

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

LLVM IR (-O2):
define i32 @mii_can_100_mbps_full_dp(i32 %0) {
%2 = and i32 %0, 17408
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ grace(int /*<<< orphan*/);
int fn2(int i) {
  switch (i) {
  case 1:
    if (i == 5)
      grace(0);
    else
      goto done;
  case 2:
    --i;
  }
done:;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1140 <fn2+0x30>
jmp    112f <fn2+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1160 <fn2+0x50>
jmp    1169 <fn2+0x59>
cmpl   $0x5,-0x8(%rbp)
jne    1156 <fn2+0x46>
xor    %edi,%edi
call   1030 <grace@plt>
jmp    115b <fn2+0x4b>
jmp    116e <fn2+0x5e>
jmp    1160 <fn2+0x50>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    116e <fn2+0x5e>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %15 [
i32 1, label %5
i32 2, label %12
]
5: ; preds = %1
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 5
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @grace(i32 0)
br label %11
10: ; preds = %5
br label %16
11: ; preds = %8
br label %12
12: ; preds = %1, %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, -1
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %1
br label %16
16: ; preds = %15, %10
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @fn2(i32 %0) {
ret i32 undef
}
long f(int s, long c) {
  int a1, a2, a3;
  long x1, x2, x3, x;
  a1 = 2 * s;
  x1 = c + a1;
  a2 = 4 * s;
  x2 = c + a2;
  a3 = 6 * s;
  x3 = c + a3;
  x = x1 + x2 + x3;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
imul   $0x6,-0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
add    -0x30(%rbp),%rax
add    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rdi,1),%eax
movslq %eax,%rcx
shl    $0x2,%edi
movslq %edi,%rdx
lea    (%rcx,%rcx,2),%eax
cltq
lea    (%rsi,%rsi,2),%rsi
add    %rcx,%rax
add    %rdx,%rax
add    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @f(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%12 = load i32, i32* %3
%13 = mul nsw i32 2, %12
store i32 %13, i32* %5
%14 = load i64, i64* %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = add nsw i64 %14, %16
store i64 %17, i64* %8
%18 = load i32, i32* %3
%19 = mul nsw i32 4, %18
store i32 %19, i32* %6
%20 = load i64, i64* %4
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = add nsw i64 %20, %22
store i64 %23, i64* %9
%24 = load i32, i32* %3
%25 = mul nsw i32 6, %24
store i32 %25, i32* %7
%26 = load i64, i64* %4
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = add nsw i64 %26, %28
store i64 %29, i64* %10
%30 = load i64, i64* %8
%31 = load i64, i64* %9
%32 = add nsw i64 %30, %31
%33 = load i64, i64* %10
%34 = add nsw i64 %32, %33
store i64 %34, i64* %11
%35 = load i64, i64* %11
ret i64 %35
}

LLVM IR (-O2):
define i64 @f(i32 %0, i64 %1) {
%3 = shl nsw i32 %0, 1
%4 = sext i32 %3 to i64
%5 = shl nsw i32 %0, 2
%6 = sext i32 %5 to i64
%7 = mul nsw i32 %0, 6
%8 = sext i32 %7 to i64
%9 = mul i64 %1, 3
%10 = add nsw i64 %4, %8
%11 = add nsw i64 %10, %6
%12 = add i64 %11, %9
ret i64 %12
}