xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int strlen(char const *);
char *enquote_string(const char *str) {
  char *enquote = (char *)malloc(sizeof(char) * strlen(str) + 3);
  sprintf(enquote, "\"%s\"", str);
  return enquote;
}


x86 assembly (clang, -O0):
<enquote_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cltq
shl    $0x0,%rax
add    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe97(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enquote_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x3(%rax),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xeb2(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\22%s\22\00"
define i8* @enquote_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = mul i64 1, %6
%8 = add i64 %7, 3
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"\22%s\22\00"
define i8* @enquote_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add i32 %2, 3
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %5
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int spi_write_cmd(struct flashrom_flashctx *, int, int, unsigned int,
                  int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int spi_block_erase_52(struct flashrom_flashctx *flash, unsigned int addr,
                       unsigned int blocklen) {
  return spi_write_cmd(flash, 0x52, false, addr, NULL, 0, 100 * 1000);
}


x86 assembly (clang, -O0):
<spi_block_erase_52>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x52,%esi
xor    %r9d,%r9d
xor    %eax,%eax
mov    %eax,%r8d
mov    %r9d,%edx
movl   $0x186a0,(%rsp)
call   1030 <spi_write_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_block_erase_52>:
push   %rax
mov    %esi,%ecx
movl   $0x186a0,(%rsp)
mov    $0x52,%esi
xor    %edx,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <spi_write_cmd@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_block_erase_52(%struct.flashrom_flashctx* %0, i32 %1, i32 %2) {
%4 = alloca %struct.flashrom_flashctx*
%5 = alloca i32
%6 = alloca i32
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %4
%8 = load i32, i32* %5
%9 = call i32 @spi_write_cmd(%struct.flashrom_flashctx* %7, i32 82, i32 0, i32 %8, i32* null, i32 0, i32 100000)
ret i32 %9
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_block_erase_52(%struct.flashrom_flashctx* %0, i32 %1, i32 %2) {
%4 = tail call i32 @spi_write_cmd(%struct.flashrom_flashctx* %0, i32 82, i32 0, i32 %1, i32* null, i32 0, i32 100000)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ arg_long2(long, long);
void arg_long1(long i) { arg_long2(i, i + 1); }


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

x86 assembly (clang, -O2):
<arg_long1>:
lea    0x1(%rdi),%rsi
jmp    1030 <arg_long2@plt>

LLVM IR (-O0):
define void @arg_long1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = add nsw i64 %4, 1
%6 = call i32 @arg_long2(i64 %3, i64 %5)
ret void
}

LLVM IR (-O2):
define void @arg_long1(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = tail call i32 @arg_long2(i64 %0, i64 %2)
ret void
}
/* Variables and functions */
short *BGBMID_LoadWAV_RateStereo16(char const *, int *, int);
short *BGBMID_LoadWAV_8Stereo16(const char *name, int *rlen) {
  return (BGBMID_LoadWAV_RateStereo16(name, rlen, 8000));
}


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

x86 assembly (clang, -O2):
<BGBMID_LoadWAV_8Stereo16>:
mov    $0x1f40,%edx
jmp    1030 <BGBMID_LoadWAV_RateStereo16@plt>

LLVM IR (-O0):
define i16* @BGBMID_LoadWAV_8Stereo16(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = call i16* @BGBMID_LoadWAV_RateStereo16(i8* %5, i32* %6, i32 8000)
ret i16* %7
}

LLVM IR (-O2):
define i16* @BGBMID_LoadWAV_8Stereo16(i8* %0, i32* %1) {
%3 = tail call i16* @BGBMID_LoadWAV_RateStereo16(i8* %0, i32* %1, i32 8000)
ret i16* %3
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void sigchld(int s) { _exit(0); }


x86 assembly (clang, -O0):
<sigchld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<sigchld>:
push   %rax
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @sigchld(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigchld(i32 %0) {
%2 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
void *intel_flash_init(int);
void *intel_flash_bxb_init() { return intel_flash_init(2); }


x86 assembly (clang, -O0):
<intel_flash_bxb_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <intel_flash_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intel_flash_bxb_init>:
mov    $0x2,%edi
jmp    1030 <intel_flash_init@plt>

LLVM IR (-O0):
define i8* @intel_flash_bxb_init() {
%1 = call i8* @intel_flash_init(i32 2)
ret i8* %1
}

LLVM IR (-O2):
define i8* @intel_flash_bxb_init() {
%1 = tail call i8* @intel_flash_init(i32 2)
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bios_printf(int, char *, int /*<<< orphan*/);
void keyboard_panic(uint16_t status) {
  bios_printf((2 | 4 | 1), "Keyboard error:%u\n", status);
}


x86 assembly (clang, -O0):
<keyboard_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x7,%edi
lea    0xed6(%rip),%rsi
call   1030 <bios_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_panic>:
mov    %edi,%edx
lea    0xee7(%rip),%rsi
mov    $0x7,%edi
jmp    1030 <bios_printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Keyboard error:%u\0A\00"
define void @keyboard_panic(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bios_printf(i32 7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Keyboard error:%u\0A\00"
define void @keyboard_panic(i32 %0) {
%2 = tail call i32 @bios_printf(i32 7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, unsigned int);
scalar_t__ pthread_self();
int /*<<< orphan*/ sleep(int);
void *PrintHello(void *name) {
  while (1) {
    printf("Hello World! It's me, thread %s!, (thread: %x)\n", (char *)name,
           (unsigned)pthread_self());
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<PrintHello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    113c <PrintHello+0xc>

x86 assembly (clang, -O2):
<PrintHello>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xec2(%rip),%r14
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1140 <PrintHello+0x10>

LLVM IR (-O0):
@.str = [48 x i8] c"Hello World! It's me, thread %s!, (thread: %x)\0A\00"
define i8* @PrintHello(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = load i8*, i8** %2
%5 = call i64 (...) @pthread_self()
%6 = trunc i64 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6)
%8 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
@.str = [48 x i8] c"Hello World! It's me, thread %s!, (thread: %x)\0A\00"
define noalias i8* @PrintHello(i8* %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i64 (...) @pthread_self()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
%6 = tail call i32 @sleep(i32 1)
br label %2
}
long long uzuz() { return 0x7fff00007fff0000LL; }


x86 assembly (clang, -O0):
<uzuz>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fff00007fff0000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uzuz>:
movabs $0x7fff00007fff0000,%rax
ret

LLVM IR (-O0):
define i64 @uzuz() {
ret i64 9223090564025483264
}

LLVM IR (-O2):
define i64 @uzuz() {
ret i64 9223090564025483264
}
/* Variables and functions */
int __builtin_mips_cabs_ngl_d(double, double);
int test11(double a, double b) { return __builtin_mips_cabs_ngl_d(a, b); }


x86 assembly (clang, -O0):
<test11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__builtin_mips_cabs_ngl_d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test11>:
jmp    1030 <__builtin_mips_cabs_ngl_d@plt>

LLVM IR (-O0):
define i32 @test11(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @__builtin_mips_cabs_ngl_d(double %5, double %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test11(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_ngl_d(double %0, double %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ clock();
void delay(unsigned int mseconds) {
  clock_t goal = mseconds + clock();
  while (goal > clock())
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jle    115b <delay+0x4b>
jmp    1137 <delay+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
add    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <clock@plt>
cmp    %rax,%rbx
jg     1130 <delay+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = call i64 (...) @clock()
%7 = add nsw i64 %5, %6
store i64 %7, i64* %3
br label %8
8: ; preds = %12, %1
%9 = load i64, i64* %3
%10 = call i64 (...) @clock()
%11 = icmp sgt i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i64 (...) @clock()
%4 = add nsw i64 %3, %2
br label %5
5: ; preds = %5, %1
%6 = tail call i64 (...) @clock()
%7 = icmp sgt i64 %4, %6
br i1 %7, label %5, label %8
8: ; preds = %5
ret void
}
int fun469() { return 469; }


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

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

LLVM IR (-O0):
define i32 @fun469() {
ret i32 469
}

LLVM IR (-O2):
define i32 @fun469() {
ret i32 469
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void burn_stack(int bytes) {
  char buf[64];
  memset(buf, 0, sizeof buf);
  bytes -= sizeof buf;
  if (bytes > 0)
    burn_stack(bytes);
}


x86 assembly (clang, -O0):
<burn_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movslq -0x4(%rbp),%rax
sub    $0x40,%rax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1158 <burn_stack+0x38>
mov    -0x4(%rbp),%edi
call   1040 <burn_stack@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<burn_stack>:
push   %rbx
sub    $0x40,%rsp
mov    %edi,%ebx
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
add    $0xffffffc0,%ebx
test   %ebx,%ebx
jle    1144 <burn_stack+0x24>
mov    %ebx,%edi
call   1040 <burn_stack@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @burn_stack(i32 %0) {
%2 = alloca i32
%3 = alloca [64 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 64)
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = sub i64 %7, 64
%9 = trunc i64 %8 to i32
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
define void @burn_stack(i32 %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 64)
%5 = add i32 %0, -64
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %1
ret void
}
void decrease_debuglevel() {}


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

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

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

LLVM IR (-O2):
define void @decrease_debuglevel() {
ret void
}
/* Variables and functions */
unsigned char I2C_read();
int /*<<< orphan*/ I2C_start();
int /*<<< orphan*/ I2C_stop();
int /*<<< orphan*/ I2C_write(int);
unsigned char DS1307_get(unsigned char addr) {
  unsigned char ret;
  I2C_start();
  I2C_write(0xD0);
  I2C_write(addr);
  I2C_start();
  I2C_write(0xD0 + 1);
  ret = I2C_read();
  I2C_stop();
  return ret;
}


x86 assembly (clang, -O0):
<DS1307_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1050 <I2C_start@plt>
mov    $0xd0,%edi
call   1060 <I2C_write@plt>
movzbl -0x1(%rbp),%edi
call   1060 <I2C_write@plt>
mov    $0x0,%al
call   1050 <I2C_start@plt>
mov    $0xd1,%edi
call   1060 <I2C_write@plt>
mov    $0x0,%al
call   1040 <I2C_read@plt>
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1030 <I2C_stop@plt>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DS1307_get>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <I2C_start@plt>
mov    $0xd0,%edi
call   1060 <I2C_write@plt>
mov    %ebx,%edi
call   1060 <I2C_write@plt>
xor    %eax,%eax
call   1050 <I2C_start@plt>
mov    $0xd1,%edi
call   1060 <I2C_write@plt>
xor    %eax,%eax
call   1040 <I2C_read@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <I2C_stop@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @DS1307_get(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call i32 (...) @I2C_start()
%5 = call i32 @I2C_write(i32 208)
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = call i32 @I2C_write(i32 %7)
%9 = call i32 (...) @I2C_start()
%10 = call i32 @I2C_write(i32 209)
%11 = call zeroext i8 (...) @I2C_read()
store i8 %11, i8* %3
%12 = call i32 (...) @I2C_stop()
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @DS1307_get(i8 zeroext %0) {
%2 = tail call i32 (...) @I2C_start()
%3 = tail call i32 @I2C_write(i32 208)
%4 = zext i8 %0 to i32
%5 = tail call i32 @I2C_write(i32 %4)
%6 = tail call i32 (...) @I2C_start()
%7 = tail call i32 @I2C_write(i32 209)
%8 = tail call zeroext i8 (...) @I2C_read()
%9 = tail call i32 (...) @I2C_stop()
ret i8 %8
}
/* Variables and functions */
double exp(int);
int log(int /*<<< orphan*/);
int /*<<< orphan*/ randfrac();
double randpar(double mu, double s) {
  return mu * (1 - 1 / s) / exp((1 / s) * log(randfrac()));
}


x86 assembly (clang, -O0):
<randpar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm2
divsd  -0x10(%rbp),%xmm2
movsd  0xea4(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe8f(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <randfrac@plt>
mov    %eax,%edi
call   1050 <log@plt>
movsd  -0x20(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randpar>:
sub    $0x18,%rsp
movsd  0xec4(%rip),%xmm2
movapd %xmm2,%xmm3
divsd  %xmm1,%xmm3
movsd  %xmm3,0x8(%rsp)
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1040 <randfrac@plt>
mov    %eax,%edi
call   1050 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @randpar(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double 1.000000e+00, %6
%8 = fsub double 1.000000e+00, %7
%9 = fmul double %5, %8
%10 = load double, double* %4
%11 = fdiv double 1.000000e+00, %10
%12 = call i32 (...) @randfrac()
%13 = call i32 @log(i32 %12)
%14 = sitofp i32 %13 to double
%15 = fmul double %11, %14
%16 = fptosi double %15 to i32
%17 = call double @exp(i32 %16)
%18 = fdiv double %9, %17
ret double %18
}

LLVM IR (-O2):
define double @randpar(double %0, double %1) {
%3 = fdiv double 1.000000e+00, %1
%4 = fsub double 1.000000e+00, %3
%5 = fmul double %4, %0
%6 = tail call i32 (...) @randfrac()
%7 = tail call i32 @log(i32 %6)
%8 = sitofp i32 %7 to double
%9 = fmul double %3, %8
%10 = fptosi double %9 to i32
%11 = tail call double @exp(i32 %10)
%12 = fdiv double %5, %11
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ platform_linux_echoOn();
extern void platform_echoOn(void) {
  platform_linux_echoOn();
  return;
}


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

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

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

LLVM IR (-O2):
define void @platform_echoOn() {
%1 = tail call i32 (...) @platform_linux_echoOn()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
void printlnShort(short data) { printf("%hd\n", data); }


x86 assembly (clang, -O0):
<printlnShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    0xeda(%rip),%rdi
movswl -0x2(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%hd\0A\00"
define void @printlnShort(i16 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i16 signext %0)
ret void
}
int check_prime(int num) {
  int i = 1;
  for (i = 2; i < num; i = i + 1) {
    if (num % i == 0)
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1150 <check_prime+0x50>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113d <check_prime+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1157 <check_prime+0x57>
jmp    1142 <check_prime+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <check_prime+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <check_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <check_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <check_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int Cyc_Lex_strng_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_Lex_strng(struct Cyc_Lexing_lexbuf *lexbuf) {
  int _T0;
  _T0 = Cyc_Lex_strng_rec(lexbuf, 3);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_Lex_strng>:
mov    $0x3,%esi
jmp    1030 <Cyc_Lex_strng_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_strng(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_Lex_strng_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 3)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_strng(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_Lex_strng_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 3)
ret i32 %2
}
int foo(int *a, int *b, int c) {
  *a = 2 * (*a);
  *b = (*b) / 2;
  c = (*a) + (*b);
  return c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
shll   (%rdi)
mov    (%rsi),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
mov    %eax,(%rsi)
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = mul nsw i32 2, %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = sdiv i32 %12, 2
%14 = load i32*, i32** %5
store i32 %13, i32* %14
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = add nsw i32 %16, %18
store i32 %19, i32* %6
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %0
%5 = shl nsw i32 %4, 1
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = sdiv i32 %6, 2
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = add nsw i32 %8, %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fatal(char *, char const *, int /*<<< orphan*/);
int mkdir(char const *, int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void cli_mkdir(const char *fpath, int mode) {
  if (mkdir(fpath, mode) == -1)
    fatal("cli_mkdir(%s): %s", fpath, strerror(errno));
}


x86 assembly (clang, -O0):
<cli_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
jne    117c <cli_mkdir+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xe89(%rip),%rdi
call   1050 <fatal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_mkdir>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
je     1140 <cli_mkdir+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1050 <fatal@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"cli_mkdir(%s): %s\00"
@errno = global i32 0
define void @cli_mkdir(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @mkdir(i8* %5, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i32, i32* @errno
%12 = call i32 @strerror(i32 %11)
%13 = call i32 @fatal(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %12)
br label %14
14: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"cli_mkdir(%s): %s\00"
@errno = global i32 0
define void @cli_mkdir(i8* %0, i32 %1) {
%3 = tail call i32 @mkdir(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @fatal(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %7)
br label %9
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insert(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rev();
int /*<<< orphan*/ trav();
void main() {
  int i;
  for (i = 0; i <= 5; i++) {
    insert(i);
  }
  trav();
  printf("\n");
  rev();
  trav();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jg     116f <main+0x2f>
mov    -0x4(%rbp),%edi
call   1050 <insert@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <main+0xf>
mov    $0x0,%al
call   1060 <trav@plt>
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <rev@plt>
mov    $0x0,%al
call   1060 <trav@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <insert@plt>
mov    $0x1,%edi
call   1050 <insert@plt>
mov    $0x2,%edi
call   1050 <insert@plt>
mov    $0x3,%edi
call   1050 <insert@plt>
mov    $0x4,%edi
call   1050 <insert@plt>
mov    $0x5,%edi
call   1050 <insert@plt>
xor    %eax,%eax
call   1060 <trav@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <rev@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <trav@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @insert(i32 0)
%2 = tail call i32 @insert(i32 1)
%3 = tail call i32 @insert(i32 2)
%4 = tail call i32 @insert(i32 3)
%5 = tail call i32 @insert(i32 4)
%6 = tail call i32 @insert(i32 5)
%7 = tail call i32 (...) @trav()
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 (...) @rev()
%10 = tail call i32 (...) @trav()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
scalar_t__ fputc_unlocked(int /*<<< orphan*/, int /*<<< orphan*/ *);
int fputs_unlocked(const char *restrict s, FILE *restrict file) {
  while (*s) {
    if (fputc_unlocked(*s++, file) < 0)
      return EOF;
  }
  return 1;
}


x86 assembly (clang, -O0):
<fputs_unlocked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <fputs_unlocked+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
mov    -0x18(%rbp),%rsi
call   1030 <fputc_unlocked@plt>
cmp    $0x0,%rax
jge    1163 <fputs_unlocked+0x53>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <fputs_unlocked+0x5f>
jmp    1120 <fputs_unlocked+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs_unlocked>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
test   %edi,%edi
je     1143 <fputs_unlocked+0x33>
add    $0x1,%rbx
mov    %r14,%rsi
call   1030 <fputc_unlocked@plt>
test   %rax,%rax
jns    1120 <fputs_unlocked+0x10>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
jmp    1148 <fputs_unlocked+0x38>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fputs_unlocked(i8* noalias nocapture %0, i32* noalias nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = sext i8 %5 to i32
%10 = tail call i64 @fputc_unlocked(i32 %9, i32* %1)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %7
%13 = load i32, i32* @EOF
br label %14
14: ; preds = %3, %12
%15 = phi i32 [ %13, %12 ], [ 1, %3 ]
ret i32 %15
}
void gtk_tree_view_column_get_expand() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_get_expand() {
ret void
}
/* Variables and functions */
int hamming_distance(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", hamming_distance(1, 4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <hamming_distance@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @hamming_distance(i32 1, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned int makehash(char *name) {
  unsigned int hash = 0;
  while (*name) {
    hash = (*name++) + (hash << 6) + (hash << 16) - hash;
  }
  return (hash & 0x7FFFFFFF) % 1000;
}


x86 assembly (clang, -O0):
<makehash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <makehash+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <makehash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<makehash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113f <makehash+0x3f>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <makehash+0x10>
and    $0x7fffffff,%eax
imul   $0x10624dd3,%rax,%rcx
shr    $0x26,%rcx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @makehash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = mul i32 %6, 65599
%11 = add i32 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
%16 = urem i32 %15, 1000
br label %17
17: ; preds = %14, %1
%18 = phi i32 [ 0, %1 ], [ %16, %14 ]
ret i32 %18
}
unsigned xrop3_179_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_179_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_179_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_179_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %7
%45 = and i32 %43, %44
%46 = or i32 %42, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_179_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int TruncStrCmp(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ len(char *);
int IsHalt(char *str) {
  int retVal;
  retVal = TruncStrCmp(len("halt"), str, "halt");
  if (retVal < 1)
    return 0;
  return retVal;
}


x86 assembly (clang, -O0):
<IsHalt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <len@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
lea    0xebb(%rip),%rdx
call   1040 <TruncStrCmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jge    1163 <IsHalt+0x43>
movl   $0x0,-0x4(%rbp)
jmp    1169 <IsHalt+0x49>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsHalt>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1030 <len@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <TruncStrCmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovs  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"halt\00"
define i32 @IsHalt(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = call i32 @len(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i32 @TruncStrCmp(i32 %5, i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"halt\00"
define i32 @IsHalt(i8* %0) {
%2 = tail call i32 @len(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @TruncStrCmp(i32 %2, i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ logCmdOption(char *, char *);
void logOwnerPassCmdOption() { logCmdOption("-o, --pwdo", "Owner password"); }


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

x86 assembly (clang, -O2):
<logOwnerPassCmdOption>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <logCmdOption@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"-o, --pwdo\00"
@.str.1 = [15 x i8] c"Owner password\00"
define void @logOwnerPassCmdOption() {
%1 = call i32 @logCmdOption(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"-o, --pwdo\00"
@.str.1 = [15 x i8] c"Owner password\00"
define void @logOwnerPassCmdOption() {
%1 = tail call i32 @logCmdOption(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void gen_key(char *buf, int len) {
  srand(time(NULL));
  for (int i = 0; i < len; i++) {
    buf[i] = rand() % 256;
  }
}


x86 assembly (clang, -O0):
<gen_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118a <gen_key+0x5a>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <gen_key+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_key>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
test   %ebp,%ebp
jle    1164 <gen_key+0x34>
mov    %ebp,%ebp
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1050 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <gen_key+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @gen_key(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
store i32 0, i32* %5
br label %8
8: ; preds = %20, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = call i32 (...) @rand()
%14 = srem i32 %13, 256
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 %15, i8* %19
br label %20
20: ; preds = %12
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @gen_key(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %9
8: ; preds = %9, %2
ret void
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %14, %9 ]
%11 = tail call i32 (...) @rand()
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %12, i8* %13
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %8, label %9
}