xunge/DecIR huggingface dataset:
int pe_as_lit_kw_map_chareq(char a, char b) {
  return (a & ~('a' - 'A')) == (b & ~('a' - 'A'));
}


x86 assembly (clang, -O0):
<pe_as_lit_kw_map_chareq>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xffffffdf,%eax
movsbl -0x2(%rbp),%ecx
and    $0xffffffdf,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pe_as_lit_kw_map_chareq>:
xor    %esi,%edi
xor    %eax,%eax
test   $0xdf,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @pe_as_lit_kw_map_chareq(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = and i32 %6, -33
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = and i32 %9, -33
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @pe_as_lit_kw_map_chareq(i8 signext %0, i8 signext %1) {
%3 = xor i8 %1, %0
%4 = and i8 %3, -33
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct ottery_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ottery_st_wipe_nolock(struct ottery_state *);
void ottery_st_wipe(struct ottery_state *st) {
  ((void)0);
  ottery_st_wipe_nolock(st);
}


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

x86 assembly (clang, -O2):
<ottery_st_wipe>:
jmp    1030 <ottery_st_wipe_nolock@plt>

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

LLVM IR (-O2):
%struct.ottery_state = type { i32 }
define void @ottery_st_wipe(%struct.ottery_state* %0) {
%2 = tail call i32 @ottery_st_wipe_nolock(%struct.ottery_state* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trainer_sdt_3(int /*<<< orphan*/);
void trainer_sdt_3_launcher(void) { trainer_sdt_3(0); }


x86 assembly (clang, -O0):
<trainer_sdt_3_launcher>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <trainer_sdt_3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trainer_sdt_3_launcher>:
xor    %edi,%edi
jmp    1030 <trainer_sdt_3@plt>

LLVM IR (-O0):
define void @trainer_sdt_3_launcher() {
%1 = call i32 @trainer_sdt_3(i32 0)
ret void
}

LLVM IR (-O2):
define void @trainer_sdt_3_launcher() {
%1 = tail call i32 @trainer_sdt_3(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int signal(int num, void *handler) {
  assert(0);
  return -1;
}


x86 assembly (clang, -O0):
<signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @signal(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 -1
}
void writeInt(unsigned char **pptr, int anInt) {
  **pptr = (unsigned char)(anInt / 256);
  (*pptr)++;
  **pptr = (unsigned char)(anInt % 256);
  (*pptr)++;
}


x86 assembly (clang, -O0):
<writeInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeInt>:
lea    0xff(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    (%rdi),%rcx
mov    %ah,(%rcx)
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    %sil,0x1(%rax)
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @writeInt(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 256
%7 = trunc i32 %6 to i8
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
store i8 %7, i8* %9
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
%13 = load i32, i32* %4
%14 = srem i32 %13, 256
%15 = trunc i32 %14 to i8
%16 = load i8**, i8*** %3
%17 = load i8*, i8** %16
store i8 %15, i8* %17
%18 = load i8**, i8*** %3
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %18
ret void
}

LLVM IR (-O2):
define void @writeInt(i8** nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 256
%4 = trunc i32 %3 to i8
%5 = load i8*, i8** %0
store i8 %4, i8* %5
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %0
%8 = trunc i32 %1 to i8
store i8 %8, i8* %7
%9 = load i8*, i8** %0
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %0
ret void
}
void atomic_inc(volatile int *p) { asm volatile("lock; incl %0" : "+m"(*p)); }


x86 assembly (clang, -O0):
<atomic_inc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lock incl (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_inc>:
lock incl (%rdi)
ret

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

LLVM IR (-O2):
define void @atomic_inc(i32* %0) {
tail call void asm sideeffect "lock; incl $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32* elementtype(i32) %0)
ret void
}
int host_is_little_endian(void) {
  const union {
    unsigned char c[4];
    unsigned int i;
  } fixed = {{0x10, 0x20, 0x40, 0x80}};
  const unsigned int i = 0x80402010U;
  if (fixed.i == i) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<host_is_little_endian>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x80402010,-0xc(%rbp)
cmpl   $0x80402010,-0x8(%rbp)
jne    112d <host_is_little_endian+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <host_is_little_endian+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
@__const.host_is_little_endian.fixed = { [4 x i8] } { [4 x i8] c"\10 @\80" }
define i32 @host_is_little_endian() {
%1 = alloca i32
%2 = alloca %union.anon
%3 = alloca i32
%4 = bitcast %union.anon* %2 to i8*
store i32 -2143281136, i32* %3
%5 = bitcast %union.anon* %2 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, -2143281136
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @host_is_little_endian() {
ret i32 1
}
void test16_Mod_bar__I() {}


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

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

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

LLVM IR (-O2):
define void @test16_Mod_bar__I() {
ret void
}
/* Variables and functions */
int diskscan_cli(int, char **);
int main(int argc, char **argv) { return diskscan_cli(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <diskscan_cli@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <diskscan_cli@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @diskscan_cli(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int *a, int sz) {
  int i;
  for (i = 0; i < sz; ++i) {
    printf("%12d", a[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
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 <print+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 <print+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+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 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%12d\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print(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 ([5 x i8], [5 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 = [5 x i8] c"%12d\00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
long PEOPS_SPUshutdown(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @PEOPS_SPUshutdown() {
ret i64 0
}

LLVM IR (-O2):
define i64 @PEOPS_SPUshutdown() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ flush_stdin();
void signal_handler(int sig) {
  flush_stdin();
  exit(sig);
}


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

x86 assembly (clang, -O2):
<signal_handler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <flush_stdin@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @flush_stdin()
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
%2 = tail call i32 (...) @flush_stdin()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
long get_total_retransmits(struct iperf_interval_results *irp) { return -1; }


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

x86 assembly (clang, -O2):
<get_total_retransmits>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
%struct.iperf_interval_results = type opaque
define i64 @get_total_retransmits(%struct.iperf_interval_results* %0) {
%2 = alloca %struct.iperf_interval_results*
store %struct.iperf_interval_results* %0, %struct.iperf_interval_results** %2
ret i64 -1
}

LLVM IR (-O2):
%struct.iperf_interval_results = type opaque
define i64 @get_total_retransmits(%struct.iperf_interval_results* nocapture readnone %0) {
ret i64 -1
}
int main(void) {
  int a = 5;
  *(&a - (-1));
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage(void) {
  fprintf(
      stderr,
      "Usage: <-c column> <-t title> <-p> <-s> <-S float,float> Celagram file "
      "...\n"
      "-c column uses the specified column for count data\n"
      "-t string uses the string as the histogram title\n"
      "-s has each accumulated count replaced by 100*log(count)/log(10)\n"
      "-S m,b has each accumulated count replaced by m*log(count)/log(base)\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [310 x i8] c"Usage: <-c column> <-t title> <-p> <-s> <-S float,float> Celagram file ...\0A-c column uses the specified column for count data\0A-t string uses the string as the histogram title\0A-s has each accumulated count replaced by 100*log(count)/log(10)\0A-S m,b has each accumulated count replaced by m*log(count)/log(base)\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([310 x i8], [310 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [310 x i8] c"Usage: <-c column> <-t title> <-p> <-s> <-S float,float> Celagram file ...\0A-c column uses the specified column for count data\0A-t string uses the string as the histogram title\0A-s has each accumulated count replaced by 100*log(count)/log(10)\0A-S m,b has each accumulated count replaced by m*log(count)/log(base)\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([310 x i8], [310 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printOddInts(int);
int main(void) {
  printOddInts(5);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <printOddInts@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <printOddInts@plt>
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printOddInts(i32 5)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printOddInts(i32 5)
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ aes_cbc_decrypt(void *, unsigned char *, unsigned char *);
void crypto_cbc_decrypt(void *ctx, int cipher, unsigned char *ciphertxt,
                        unsigned char *plaintxt) {
  switch (cipher) {
  case 10:
  case 11:
  case 12:
    aes_cbc_decrypt(ctx, ciphertxt, plaintxt);
    break;
  }
}


x86 assembly (clang, -O0):
<crypto_cbc_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0xfffffff6,%eax
sub    $0x2,%eax
ja     114c <crypto_cbc_decrypt+0x3c>
jmp    113b <crypto_cbc_decrypt+0x2b>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <aes_cbc_decrypt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_cbc_decrypt>:
add    $0xfffffff6,%esi
cmp    $0x2,%esi
ja     1123 <crypto_cbc_decrypt+0x13>
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <aes_cbc_decrypt@plt>
ret

LLVM IR (-O0):
define void @crypto_cbc_decrypt(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
switch i32 %9, label %15 [
i32 10, label %10
i32 11, label %10
i32 12, label %10
]
10: ; preds = %4, %4, %4
%11 = load i8*, i8** %5
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i32 @aes_cbc_decrypt(i8* %11, i8* %12, i8* %13)
br label %15
15: ; preds = %4, %10
ret void
}

LLVM IR (-O2):
define void @crypto_cbc_decrypt(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = add i32 %1, -10
%6 = icmp ult i32 %5, 3
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @aes_cbc_decrypt(i8* %0, i8* %2, i8* %3)
br label %9
9: ; preds = %4, %7
ret void
}
void ignore_action() {}


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

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

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

LLVM IR (-O2):
define void @ignore_action() {
ret void
}
int test_imm_06uint32_mem(unsigned int *val) {
  return ((*val) & (0x06 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_06uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 6
%6 = icmp ne i32 %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_06uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 6
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _xabort(int /*<<< orphan*/);
unsigned int _xbegin();
int /*<<< orphan*/ _xend();
int /*<<< orphan*/ mm_pause();
int /*<<< orphan*/ trans_func(unsigned int, unsigned int);
void trans_Intel_HTM_func(unsigned int a, unsigned int b) {
  while (1) {
    unsigned status = _xbegin();
    if (status == 1) {
      _xabort(0);
      trans_func(a, b);
      _xend();
      return;
    }
    mm_pause();
  }
}


x86 assembly (clang, -O0):
<trans_Intel_HTM_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1060 <_xbegin@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1191 <trans_Intel_HTM_func+0x41>
xor    %edi,%edi
call   1070 <_xabort@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <trans_func@plt>
mov    $0x0,%al
call   1050 <_xend@plt>
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1030 <mm_pause@plt>
jmp    115e <trans_Intel_HTM_func+0xe>

x86 assembly (clang, -O2):
<trans_Intel_HTM_func>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <_xbegin@plt>
cmp    $0x1,%eax
je     1175 <trans_Intel_HTM_func+0x25>
xor    %eax,%eax
call   1030 <mm_pause@plt>
jmp    1160 <trans_Intel_HTM_func+0x10>
xor    %edi,%edi
call   1070 <_xabort@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <trans_func@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <_xend@plt>

LLVM IR (-O0):
define void @trans_Intel_HTM_func(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %2, %16
%7 = call i32 (...) @_xbegin()
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = call i32 @_xabort(i32 0)
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @trans_func(i32 %12, i32 %13)
%15 = call i32 (...) @_xend()
ret void
16: ; preds = %6
%17 = call i32 (...) @mm_pause()
br label %6
}

LLVM IR (-O2):
define void @trans_Intel_HTM_func(i32 %0, i32 %1) {
%3 = tail call i32 (...) @_xbegin()
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2, %5
%6 = tail call i32 (...) @mm_pause()
%7 = tail call i32 (...) @_xbegin()
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %5
9: ; preds = %5, %2
%10 = tail call i32 @_xabort(i32 0)
%11 = tail call i32 @trans_func(i32 %0, i32 %1)
%12 = tail call i32 (...) @_xend()
ret void
}
unsigned int fibonacci_recursive(unsigned int number) {
  if (number == 0 || number == 1) {
    return number;
  }
  return fibonacci_recursive(number - 1) + fibonacci_recursive(number - 2);
}


x86 assembly (clang, -O0):
<fibonacci_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <fibonacci_recursive+0x1f>
cmpl   $0x1,-0x8(%rbp)
jne    113a <fibonacci_recursive+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <fibonacci_recursive+0x4d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci_recursive@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci_recursive@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci_recursive>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jb     1132 <fibonacci_recursive+0x22>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fibonacci_recursive@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1120 <fibonacci_recursive+0x10>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci_recursive(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add i32 %4, -1
%7 = tail call i32 @fibonacci_recursive(i32 %6)
%8 = add i32 %4, -2
%9 = add i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add i32 %13, %12
ret i32 %14
}
int tests_hardware_getround(void) {
  { return (-1); }
}


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

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

LLVM IR (-O0):
define i32 @tests_hardware_getround() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @tests_hardware_getround() {
ret i32 -1
}
void X11_Close(void) {}


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

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

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

LLVM IR (-O2):
define void @X11_Close() {
ret void
}
/* Variables and functions */
double fabs(double);
double percentError(double measured, double actual) {
  double error = 0.0;
  error = fabs((measured - actual) / actual);
  return error;
}


x86 assembly (clang, -O0):
<percentError>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movaps 0xed4(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<percentError>:
subsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
andpd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @percentError(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
%9 = load double, double* %4
%10 = fdiv double %8, %9
%11 = call double @llvm.fabs.f64(double %10)
store double %11, double* %5
%12 = load double, double* %5
ret double %12
}

LLVM IR (-O2):
define double @percentError(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fdiv double %3, %1
%5 = tail call double @llvm.fabs.f64(double %4)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void SetBankColorA(char a, char b, char c, char e) {
  unsigned char d[] = {0x92, a, b, c, e};
  oled_SendCommand(d, sizeof(d));
}


x86 assembly (clang, -O0):
<SetBankColorA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movb   $0x92,-0x9(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x7(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%al
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rdi
mov    $0x5,%esi
call   1030 <oled_SendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetBankColorA>:
push   %rax
movb   $0x92,0x3(%rsp)
mov    %dil,0x4(%rsp)
mov    %sil,0x5(%rsp)
mov    %dl,0x6(%rsp)
mov    %cl,0x7(%rsp)
lea    0x3(%rsp),%rdi
mov    $0x5,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SetBankColorA(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca [5 x i8]
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
store i8 -110, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %5
store i8 %12, i8* %11
%13 = getelementptr inbounds i8, i8* %11, i64 1
%14 = load i8, i8* %6
store i8 %14, i8* %13
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = load i8, i8* %7
store i8 %16, i8* %15
%17 = getelementptr inbounds i8, i8* %15, i64 1
%18 = load i8, i8* %8
store i8 %18, i8* %17
%19 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%20 = call i32 @oled_SendCommand(i8* %19, i32 5)
ret void
}

LLVM IR (-O2):
define void @SetBankColorA(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca [5 x i8]
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
store i8 -110, i8* %6
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 1
store i8 %0, i8* %7
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 2
store i8 %1, i8* %8
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 3
store i8 %2, i8* %9
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 4
store i8 %3, i8* %10
%11 = call i32 @oled_SendCommand(i8* %6, i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void err_exit(char *str) {
  perror(str);
  exit(1);
}


x86 assembly (clang, -O0):
<err_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @err_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @err_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void ec_sleep(double seconds) {}


x86 assembly (clang, -O0):
<ec_sleep>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ec_sleep(double %0) {
ret void
}
int main(void) {
  int x = 0;
  int *p = &x;
  5 / *p;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int findIndexOfRun(unsigned char *level, int start, int count, int tlevel) {
  int i;
  for (i = start; i < count; i++) {
    if (tlevel == level[i]) {
      return i;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<findIndexOfRun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1158 <findIndexOfRun+0x58>
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1145 <findIndexOfRun+0x45>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <findIndexOfRun+0x5e>
jmp    114a <findIndexOfRun+0x4a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1117 <findIndexOfRun+0x17>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findIndexOfRun>:
mov    %edx,%eax
cmp    %edx,%esi
jge    1122 <findIndexOfRun+0x22>
movslq %esi,%rdx
add    %rdx,%rdi
nopl   0x0(%rax)
movzbl (%rdi),%edx
cmp    %ecx,%edx
je     1123 <findIndexOfRun+0x23>
add    $0x1,%esi
add    $0x1,%rdi
cmp    %esi,%eax
jne    1110 <findIndexOfRun+0x10>
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @findIndexOfRun(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %1, %2
br i1 %5, label %6, label %20
6: ; preds = %4
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %6, %14
%9 = phi i64 [ %7, %6 ], [ %15, %14 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, %3
br i1 %13, label %18, label %14
14: ; preds = %8
%15 = add nsw i64 %9, 1
%16 = trunc i64 %15 to i32
%17 = icmp eq i32 %16, %2
br i1 %17, label %20, label %8
18: ; preds = %8
%19 = trunc i64 %9 to i32
br label %20
20: ; preds = %14, %18, %4
%21 = phi i32 [ %2, %4 ], [ %19, %18 ], [ %2, %14 ]
ret i32 %21
}
/* Type definitions */
typedef int /*<<< orphan*/ XColor;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XColor(void) {
  XColor *_p = (XColor *)malloc(sizeof(XColor));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XColor+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XColor>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XColor+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XColor() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XColor() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void __aos_mdelay(int msecs) {
  usleep(1000 * msecs);
  return;
}


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

x86 assembly (clang, -O2):
<__aos_mdelay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @__aos_mdelay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1000, %3
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @__aos_mdelay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int drand48();
void get_randoms(int *numbers, int upper) {
  int i;
  for (i = upper - 1; i > 0; i -= 1) {
    numbers[i] = drand48() * i;
  }
}


x86 assembly (clang, -O0):
<get_randoms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1158 <get_randoms+0x48>
mov    $0x0,%al
call   1030 <drand48@plt>
mov    %eax,%edx
imul   -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <get_randoms+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_randoms>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     113f <get_randoms+0x2f>
mov    %rdi,%r14
mov    %esi,%ebx
nop
lea    -0x1(%rbx),%r15
xor    %eax,%eax
call   1030 <drand48@plt>
imul   %r15d,%eax
mov    %r15d,%ecx
mov    %eax,(%r14,%rcx,4)
cmp    $0x2,%rbx
mov    %r15,%rbx
ja     1120 <get_randoms+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @get_randoms(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = call i32 (...) @drand48()
%13 = load i32, i32* %5
%14 = mul nsw i32 %12, %13
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
store i32 %14, i32* %18
br label %19
19: ; preds = %11
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
store i32 %21, i32* %5
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @get_randoms(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = trunc i64 %8 to i32
%10 = tail call i32 (...) @drand48()
%11 = mul nsw i32 %10, %9
%12 = and i64 %8, 4294967295
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 %11, i32* %13
%14 = icmp ugt i64 %7, 2
br i1 %14, label %6, label %15
15: ; preds = %6, %2
ret void
}
void pushArrayValue(int *array, int length, int value) {
  for (int i = 0; i < length - 1; i++) {
    array[i] = array[i + 1];
  }
  array[length - 1] = value;
}


x86 assembly (clang, -O0):
<pushArrayValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    114f <pushArrayValue+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <pushArrayValue+0x15>
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushArrayValue>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rdi,%rbx
lea    -0x1(%rsi),%ebp
cmp    $0x2,%esi
jl     1134 <pushArrayValue+0x24>
lea    0x4(%rbx),%rsi
mov    %ebp,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
call   1030 <memmove@plt>
movslq %ebp,%rax
mov    %r14d,(%rbx,%rax,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @pushArrayValue(i32* nocapture %0, i32 %1, i32 %2) {
%4 = add i32 %1, -1
%5 = icmp sgt i32 %1, 1
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = bitcast i32* %0 to i8*
%8 = getelementptr i32, i32* %0, i64 1
%9 = bitcast i32* %8 to i8*
%10 = zext i32 %4 to i64
%11 = shl nuw nsw i64 %10, 2
br label %12
12: ; preds = %6, %3
%13 = sext i32 %4 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
store i32 %2, i32* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void print_usage(const char *prog) {
  printf("Usage: %s [-v] [command,..]\n", prog);
  puts("  -b --beaglebone  Beaglebone\n"
       "  -i --ioboard     I/O Board\n"
       "  -a --asic=N      ASIC card\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Usage: %s [-v] [command,..]\0A\00"
@.str.1 = [89 x i8] c" -b --beaglebone Beaglebone\0A -i --ioboard I/O Board\0A -a --asic=N ASIC card\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"Usage: %s [-v] [command,..]\0A\00"
@.str.1 = [89 x i8] c" -b --beaglebone Beaglebone\0A -i --ioboard I/O Board\0A -a --asic=N ASIC card\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int main(int argc, char **argv) {
  int count = 0;
  char *pointer = NULL;
  for (count = 0; count < 10; count++) {
    pointer = (char *)malloc(sizeof(char) * 256);
  }
  free(pointer);
  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)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1172 <main+0x52>
mov    $0x100,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <main+0x2c>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 256)
%4 = tail call i64 @malloc(i32 256)
%5 = tail call i64 @malloc(i32 256)
%6 = tail call i64 @malloc(i32 256)
%7 = tail call i64 @malloc(i32 256)
%8 = tail call i64 @malloc(i32 256)
%9 = tail call i64 @malloc(i32 256)
%10 = tail call i64 @malloc(i32 256)
%11 = tail call i64 @malloc(i32 256)
%12 = tail call i64 @malloc(i32 256)
%13 = inttoptr i64 %12 to i8*
%14 = tail call i32 @free(i8* %13)
ret i32 0
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char *argv[]) {
  char c = 0;
  do {
    c = (getchar() != EOF);
    printf("%d\n", c);
  } while (c);
  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)
movb   $0x0,-0x11(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea0(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x11(%rbp)
lea    0xea3(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
cmpb   $0x0,-0x11(%rbp)
jne    113a <main+0x1a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2eb9(%rip),%r15
lea    0xeca(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %rax,%r12
mov    (%r15),%rbx
xor    %esi,%esi
cmp    %rbx,%rax
setne  %sil
mov    %r14,%rdi
call   1030 <printf@plt>
cmp    %rbx,%r12
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
%7 = zext i1 %6 to i8
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %7)
br i1 %6, label %3, label %9
9: ; preds = %3
ret i32 0
}
int counter(void) {
  static int ctr = 1;
  return ++ctr;
}


x86 assembly (clang, -O0):
<counter>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0d(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<counter>:
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
ret

LLVM IR (-O0):
@counter.ctr = internal global i32 1
define i32 @counter() {
%1 = load i32, i32* @counter.ctr
%2 = add nsw i32 %1, 1
store i32 %2, i32* @counter.ctr
ret i32 %2
}

LLVM IR (-O2):
@counter.ctr = internal unnamed_addr global i32 1
define i32 @counter() {
%1 = load i32, i32* @counter.ctr
%2 = add nsw i32 %1, 1
store i32 %2, i32* @counter.ctr
ret i32 %2
}