xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ cl_program;
typedef int /*<<< orphan*/ cl_int;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clRetainProgram(cl_program program) {
  unsigned int sys_args[1];
  sys_args[0] = (unsigned int)program;
  return (cl_int)syscall(325, 1030, sys_args);
}


x86 assembly (clang, -O0):
<clRetainProgram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdx
mov    $0x145,%edi
mov    $0x406,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clRetainProgram>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x145,%edi
mov    $0x406,%esi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clRetainProgram(i64 %0) {
%2 = alloca i64
%3 = alloca [1 x i32]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%8 = call i32 @syscall(i32 325, i32 1030, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @clRetainProgram(i64 %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = trunc i64 %0 to i32
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 %4, i32* %5
%6 = call i32 @syscall(i32 325, i32 1030, i32* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Msp430AlarmC__0__Msp430TimerControl__disableEvents();
void Msp430AlarmC__0__Alarm__stop(void) {
  Msp430AlarmC__0__Msp430TimerControl__disableEvents();
}


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

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

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

LLVM IR (-O2):
define void @Msp430AlarmC__0__Alarm__stop() {
%1 = tail call i32 (...) @Msp430AlarmC__0__Msp430TimerControl__disableEvents()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *progname) {
  fprintf(stderr, "Usage: %s [-w <bit width>] <filename>\n", progname);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: %s [-w <bit width>] <filename>\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: %s [-w <bit width>] <filename>\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void clear_all_latency_tracing(struct task_struct *p) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @clear_all_latency_tracing(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @clear_all_latency_tracing(%struct.task_struct* nocapture %0) {
ret void
}
void I420ToBGRA() {}


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

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

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

LLVM IR (-O2):
define void @I420ToBGRA() {
ret void
}
void clonefd_install_fd(struct clone4_args *args, struct clonefd_setup *setup) {
}


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

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

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

LLVM IR (-O2):
%struct.clone4_args = type opaque
%struct.clonefd_setup = type opaque
define void @clonefd_install_fd(%struct.clone4_args* nocapture %0, %struct.clonefd_setup* nocapture %1) {
ret void
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/specsfile.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/specsfile.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/specsfile.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
void __xfrm_state_destroy(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__xfrm_state_destroy>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__xfrm_state_destroy>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__xfrm_state_destroy = [21 x i8] c"__xfrm_state_destroy\00"
define void @__xfrm_state_destroy() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.__xfrm_state_destroy, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__xfrm_state_destroy = [21 x i8] c"__xfrm_state_destroy\00"
define void @__xfrm_state_destroy() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.__xfrm_state_destroy, i64 0, i64 0))
ret void
}
/* Type definitions */
struct trans_data_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_trans_data_t_size(struct trans_data_t const *);
int send_data(int, struct trans_data_t const *, int /*<<< orphan*/);
int send_cmd(int sock, const struct trans_data_t *ptrans) {
  return send_data(sock, ptrans, get_trans_data_t_size(ptrans));
}


x86 assembly (clang, -O0):
<send_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <get_trans_data_t_size@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <send_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <get_trans_data_t_size@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <send_data@plt>

LLVM IR (-O0):
%struct.trans_data_t = type { i32 }
define i32 @send_cmd(i32 %0, %struct.trans_data_t* %1) {
%3 = alloca i32
%4 = alloca %struct.trans_data_t*
store i32 %0, i32* %3
store %struct.trans_data_t* %1, %struct.trans_data_t** %4
%5 = load i32, i32* %3
%6 = load %struct.trans_data_t*, %struct.trans_data_t** %4
%7 = load %struct.trans_data_t*, %struct.trans_data_t** %4
%8 = call i32 @get_trans_data_t_size(%struct.trans_data_t* %7)
%9 = call i32 @send_data(i32 %5, %struct.trans_data_t* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.trans_data_t = type { i32 }
define i32 @send_cmd(i32 %0, %struct.trans_data_t* %1) {
%3 = tail call i32 @get_trans_data_t_size(%struct.trans_data_t* %1)
%4 = tail call i32 @send_data(i32 %0, %struct.trans_data_t* %1, i32 %3)
ret i32 %4
}
void pthread_cancel() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ get_date_string(char *);
void fprintdate(FILE *file) {
  char timestring[256];
  get_date_string(timestring);
  fprintf(file, "[%s] ", timestring);
}


x86 assembly (clang, -O0):
<fprintdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
call   1040 <get_date_string@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rdx
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprintdate>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <get_date_string@plt>
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <fprintf@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"[%s] \00"
define void @fprintdate(i32* nocapture %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @get_date_string(i8* %3)
%5 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ const *);
struct tm *my_localtime_r(const time_t *t, struct tm *tp) {
  struct tm *l = localtime(t);
  if (!l)
    return 0;
  *tp = *l;
  return tp;
}


x86 assembly (clang, -O0):
<my_localtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1145 <my_localtime_r+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1159 <my_localtime_r+0x49>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_localtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <localtime@plt>
test   %rax,%rax
je     1124 <my_localtime_r+0x14>
mov    (%rax),%eax
mov    %eax,(%rbx)
jmp    1126 <my_localtime_r+0x16>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @my_localtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca %struct.tm*
%4 = alloca i32*
%5 = alloca %struct.tm*
%6 = alloca %struct.tm*
store i32* %0, i32** %4
store %struct.tm* %1, %struct.tm** %5
%7 = load i32*, i32** %4
%8 = call %struct.tm* @localtime(i32* %7)
store %struct.tm* %8, %struct.tm** %6
%9 = load %struct.tm*, %struct.tm** %6
%10 = icmp ne %struct.tm* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
store %struct.tm* null, %struct.tm** %3
br label %18
12: ; preds = %2
%13 = load %struct.tm*, %struct.tm** %5
%14 = load %struct.tm*, %struct.tm** %6
%15 = bitcast %struct.tm* %13 to i8*
%16 = bitcast %struct.tm* %14 to i8*
%17 = load %struct.tm*, %struct.tm** %5
store %struct.tm* %17, %struct.tm** %3
br label %18
18: ; preds = %12, %11
%19 = load %struct.tm*, %struct.tm** %3
ret %struct.tm* %19
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @my_localtime_r(i32* %0, %struct.tm* writeonly %1) {
%3 = tail call %struct.tm* @localtime(i32* %0)
%4 = icmp eq %struct.tm* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = getelementptr %struct.tm, %struct.tm* %3, i64 0, i32 0
%7 = getelementptr %struct.tm, %struct.tm* %1, i64 0, i32 0
%8 = load i32, i32* %6
store i32 %8, i32* %7
br label %9
9: ; preds = %2, %5
%10 = phi %struct.tm* [ %1, %5 ], [ null, %2 ]
ret %struct.tm* %10
}
/* Variables and functions */
unsigned int pio_inword(unsigned char);
void pio_rep_inword(unsigned char addrDataReg, unsigned char *bufAddr,
                    long wordCnt) {
  while (wordCnt > 0) {
    *(unsigned int *)bufAddr = pio_inword(addrDataReg);
    bufAddr += 2;
    wordCnt--;
  }
}


x86 assembly (clang, -O0):
<pio_rep_inword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    115f <pio_rep_inword+0x4f>
movzbl -0x1(%rbp),%edi
call   1030 <pio_inword@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1126 <pio_rep_inword+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pio_rep_inword>:
push   %rbp
push   %r14
push   %rbx
test   %rdx,%rdx
jle    1147 <pio_rep_inword+0x37>
mov    %rdx,%r14
mov    %rsi,%rbx
add    $0x1,%r14
movzbl %dil,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <pio_inword@plt>
mov    %eax,(%rbx)
add    $0x2,%rbx
add    $0xffffffffffffffff,%r14
cmp    $0x1,%r14
ja     1130 <pio_rep_inword+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @pio_rep_inword(i8 zeroext %0, i8* nocapture writeonly %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %13
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ %2, %3 ]
%7 = phi i8* [ %10, %5 ], [ %1, %3 ]
%8 = tail call i32 @pio_inword(i8 zeroext %0)
%9 = bitcast i8* %7 to i32*
store i32 %8, i32* %9
%10 = getelementptr inbounds i8, i8* %7, i64 2
%11 = add nsw i64 %6, -1
%12 = icmp ugt i64 %6, 1
br i1 %12, label %5, label %13
13: ; preds = %5, %3
ret void
}
/* Variables and functions */
size_t BRBIP32SerializeMasterPrivKey(char *str, size_t strLen, const void *seed,
                                     size_t seedLen) {
  return 0;
}


x86 assembly (clang, -O0):
<BRBIP32SerializeMasterPrivKey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @BRBIP32SerializeMasterPrivKey(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
ret i64 0
}

LLVM IR (-O2):
define i64 @BRBIP32SerializeMasterPrivKey(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2, i64 %3) {
ret i64 0
}
void CalcDerivs(int numDerivs, float *x, float t, float *k1) {
  k1[0] = x[1];
  k1[1] = -x[0];
}


x86 assembly (clang, -O0):
<CalcDerivs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcDerivs>:
movss  0x4(%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  (%rsi),%xmm0
xorps  0xeec(%rip),%xmm0
movss  %xmm0,0x4(%rdx)
ret

LLVM IR (-O0):
define void @CalcDerivs(i32 %0, float* %1, float %2, float* %3) {
%5 = alloca i32
%6 = alloca float*
%7 = alloca float
%8 = alloca float*
store i32 %0, i32* %5
store float* %1, float** %6
store float %2, float* %7
store float* %3, float** %8
%9 = load float*, float** %6
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %8
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
%16 = load float, float* %15
%17 = fneg float %16
%18 = load float*, float** %8
%19 = getelementptr inbounds float, float* %18, i64 1
store float %17, float* %19
ret void
}

LLVM IR (-O2):
define void @CalcDerivs(i32 %0, float* nocapture %1, float %2, float* nocapture writeonly %3) {
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
store float %6, float* %3
%7 = load float, float* %1
%8 = fneg float %7
%9 = getelementptr inbounds float, float* %3, i64 1
store float %8, float* %9
ret void
}
int test_imm_69uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x69 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_69uint64_lowword_reg>:
test   $0x69,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_69uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 105
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
__attribute__((weak)) extern void __aeabi_memclr8(void *dest, size_t n) {
  memset(dest, 0, n);
}


x86 assembly (clang, -O0):
<__aeabi_memclr8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_memclr8>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define weak void @__aeabi_memclr8(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @memset(i8* %5, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define weak void @__aeabi_memclr8(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
int B32ToB256Bytes(int numB32Bytes) { return (numB32Bytes * 5) / 8; }


x86 assembly (clang, -O0):
<B32ToB256Bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x5,-0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<B32ToB256Bytes>:
lea    (%rdi,%rdi,4),%ecx
lea    (%rdi,%rdi,4),%eax
add    $0x7,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @B32ToB256Bytes(i32 %0) {
%2 = mul nsw i32 %0, 5
%3 = sdiv i32 %2, 8
ret i32 %3
}
int owTouchByte(int portnum, int sendbyte) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @owTouchByte(i32 %0, i32 %1) {
ret i32 0
}
int test_imm_26int16_reg(short val) {
  return ((val) & (0x26 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_26int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x26,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_26int16_reg>:
test   $0x26,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_26int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 38
%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_26int16_reg(i16 signext %0) {
%2 = and i16 %0, 38
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned long sqrt(unsigned long);
int is_prime(unsigned long int num) {
  unsigned long int i;
  if (!num || num == 1)
    return 0;
  for (i = 2; i < sqrt(num); i++) {
    if (num % i)
      return 1;
    else
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1132 <is_prime+0x22>
cmpq   $0x1,-0x10(%rbp)
jne    113e <is_prime+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1195 <is_prime+0x85>
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sqrt@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jae    118e <is_prime+0x7e>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    $0x0,%rdx
je     1189 <is_prime+0x79>
movl   $0x1,-0x4(%rbp)
jmp    1195 <is_prime+0x85>
jmp    118e <is_prime+0x7e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %eax,%eax
cmp    $0x2,%rdi
jb     112e <is_prime+0x1e>
push   %rbx
mov    %rdi,%rbx
call   1030 <sqrt@plt>
cmp    $0x3,%rax
setae  %al
and    %al,%bl
movzbl %bl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_prime(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7, %1
store i32 0, i32* %2
br label %28
11: ; preds = %7
store i64 2, i64* %4
br label %12
12: ; preds = %24, %11
%13 = load i64, i64* %4
%14 = load i64, i64* %3
%15 = call i64 @sqrt(i64 %14)
%16 = icmp ult i64 %13, %15
br i1 %16, label %17, label %27
17: ; preds = %12
%18 = load i64, i64* %3
%19 = load i64, i64* %4
%20 = urem i64 %18, %19
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %17
store i32 1, i32* %2
br label %28
23: ; preds = %17
br label %27
24: ; No predecessors!
%25 = load i64, i64* %4
%26 = add i64 %25, 1
store i64 %26, i64* %4
br label %12
27: ; preds = %23, %12
store i32 0, i32* %2
br label %28
28: ; preds = %27, %22, %10
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @is_prime(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @sqrt(i64 %0)
%5 = icmp ugt i64 %4, 2
%6 = and i64 %0, 1
%7 = icmp ne i64 %6, 0
%8 = and i1 %7, %5
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Init();
void reference() { Init(); }


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

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

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

LLVM IR (-O2):
define void @reference() {
%1 = tail call i32 (...) @Init()
ret void
}
void wannabe(void) {}


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

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

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

LLVM IR (-O2):
define void @wannabe() {
ret void
}
void ASN1_put_eoc(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *fprint_cmd_args(int /*<<< orphan*/, int, char **);
int /*<<< orphan*/ stdout;
FILE *print_cmd_args(int argc, char *argv[]) {
  return fprint_cmd_args(stdout, argc, argv);
}


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

x86 assembly (clang, -O2):
<print_cmd_args>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprint_cmd_args@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32* @print_cmd_args(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32* @fprint_cmd_args(i32 %5, i32 %6, i8** %7)
ret i32* %8
}

LLVM IR (-O2):
@stdout = global i32 0
define i32* @print_cmd_args(i32 %0, i8** %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32* @fprint_cmd_args(i32 %3, i32 %0, i8** %1)
ret i32* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
char *timeString(time_t t, char *buf) {
  struct tm *local;
  local = localtime(&t);
  strftime(buf, 50, "%c", local);
  return buf;
}


x86 assembly (clang, -O0):
<timeString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x32,%esi
lea    0xeb0(%rip),%rdx
call   1040 <strftime@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeString>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xec3(%rip),%rdx
mov    %rbx,%rdi
mov    $0x32,%esi
mov    %rax,%rcx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%c\00"
define i8* @timeString(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.tm*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %5
%7 = load i8*, i8** %4
%8 = load %struct.tm*, %struct.tm** %5
%9 = call i32 @strftime(i8* %7, i32 50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
%10 = load i8*, i8** %4
ret i8* %10
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%c\00"
define i8* @timeString(i32 %0, i8* returned %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call %struct.tm* @localtime(i32* %3)
%5 = call i32 @strftime(i8* %1, i32 50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* %1
}
void timespec_now(struct timespec *ts) {}


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

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

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

LLVM IR (-O2):
%struct.timespec = type opaque
define void @timespec_now(%struct.timespec* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rotl_64(uint64_t x) { return (x << 56) | (x >> 8); }


x86 assembly (clang, -O0):
<rotl_64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rotl_64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 56
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rotl_64(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *, int);
int main(void) {
  char x[16];
  foo(x, sizeof x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    %rsp,%rdi
mov    $0x10,%esi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @foo(i8* %3, i32 16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @foo(i8* %2, i32 16)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clrline(int);
void clrreports() {
  static int i;
  for (i = 4; i < 13; i++)
    clrline(i);
}


x86 assembly (clang, -O0):
<clrreports>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,0x2f0e(%rip)
cmpl   $0xd,0x2f07(%rip)
jge    114a <clrreports+0x3a>
mov    0x2efb(%rip),%edi
call   1030 <clrline@plt>
mov    0x2ef0(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee7(%rip)
jmp    111e <clrreports+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrreports>:
push   %rax
movl   $0x4,0x2f11(%rip)
mov    $0x4,%edi
call   1030 <clrline@plt>
mov    0x2f01(%rip),%eax
lea    0x1(%rax),%edi
mov    %edi,0x2ef8(%rip)
cmp    $0xc,%eax
jl     1120 <clrreports+0x10>
pop    %rax
ret

LLVM IR (-O0):
@clrreports.i = internal global i32 0
define void @clrreports() {
store i32 4, i32* @clrreports.i
br label %1
1: ; preds = %7, %0
%2 = load i32, i32* @clrreports.i
%3 = icmp slt i32 %2, 13
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i32, i32* @clrreports.i
%6 = call i32 @clrline(i32 %5)
br label %7
7: ; preds = %4
%8 = load i32, i32* @clrreports.i
%9 = add nsw i32 %8, 1
store i32 %9, i32* @clrreports.i
br label %1
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@clrreports.i = internal unnamed_addr global i32 0
define void @clrreports() {
store i32 4, i32* @clrreports.i
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 4, %0 ], [ %5, %1 ]
%3 = tail call i32 @clrline(i32 %2)
%4 = load i32, i32* @clrreports.i
%5 = add nsw i32 %4, 1
store i32 %5, i32* @clrreports.i
%6 = icmp slt i32 %4, 12
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR4C_set(void) { return U_WMRCORENONE_set("U_WMRRESETDOC"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"U_WMRRESETDOC\00"
define i8* @U_WMR4C_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"U_WMRRESETDOC\00"
define i8* @U_WMR4C_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void fbcon_suspended(struct fb_info *info) {}


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

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

LLVM IR (-O0):
%struct.fb_info = type opaque
define void @fbcon_suspended(%struct.fb_info* %0) {
%2 = alloca %struct.fb_info*
store %struct.fb_info* %0, %struct.fb_info** %2
ret void
}

LLVM IR (-O2):
%struct.fb_info = type opaque
define void @fbcon_suspended(%struct.fb_info* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_version(void) {
  printf("wmacpi-cli version %s\n", "2.2");
  printf(" Using libacpi version %s\n", "0.95");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef5(%rip),%rsi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
lea    0xf01(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef8(%rip),%rsi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    0xf04(%rip),%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"wmacpi-cli version %s\0A\00"
@.str.1 = [4 x i8] c"2.2\00"
@.str.2 = [27 x i8] c" Using libacpi version %s\0A\00"
@.str.3 = [5 x i8] c"0.95\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"wmacpi-cli version %s\0A\00"
@.str.1 = [4 x i8] c"2.2\00"
@.str.2 = [27 x i8] c" Using libacpi version %s\0A\00"
@.str.3 = [5 x i8] c"0.95\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isARG(const char *comm) { return strcmp(comm, "arg") == 0; }


x86 assembly (clang, -O0):
<isARG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isARG>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"arg\00"
define i32 @isARG(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"arg\00"
define i32 @isARG(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rom_address(uint32_t address) { return (address & 0x03fffffc); }


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

x86 assembly (clang, -O2):
<rom_address>:
mov    %edi,%eax
and    $0x3fffffc,%eax
ret

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

LLVM IR (-O2):
define i32 @rom_address(i32 %0) {
%2 = and i32 %0, 67108860
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int64_t input_char() {
  char c;
  if (!scanf(" %c", &c)) {
    printf("Error scanning for input.\n");
  }
  return (int64_t)c;
}


x86 assembly (clang, -O0):
<input_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%eax
jne    114d <input_char+0x2d>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_char>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
test   %eax,%eax
jne    1142 <input_char+0x22>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
movsbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %c\00"
@.str.1 = [27 x i8] c"Error scanning for input.\0A\00"
define i32 @input_char() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c" %c\00"
@str = [26 x i8] c"Error scanning for input.\00"
define i32 @input_char() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void I_Error(const char *error, ...) {
  (void)error;
  exit(-1);
}


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

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

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

LLVM IR (-O2):
define void @I_Error(i8* nocapture readnone %0, ...) {
%2 = tail call i32 @exit(i32 -1)
unreachable
}
int test_imm_55int16_reg(short val) {
  return ((val) & (0x55 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_55int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x55,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_55int16_reg>:
test   $0x55,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_55int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 85
%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_55int16_reg(i16 signext %0) {
%2 = and i16 %0, 85
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int ata_acpi_on_suspend(struct ata_port *ap) { return 0; }


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

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

LLVM IR (-O0):
%struct.ata_port = type opaque
define i32 @ata_acpi_on_suspend(%struct.ata_port* %0) {
%2 = alloca %struct.ata_port*
store %struct.ata_port* %0, %struct.ata_port** %2
ret i32 0
}

LLVM IR (-O2):
%struct.ata_port = type opaque
define i32 @ata_acpi_on_suspend(%struct.ata_port* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int fn_sq_ch_79_ch_110_ch_116_ch_111_ch_108_ch_111_ch_103_ch_121(char const *);
int fn_al_sq_ch_79_ch_110_ch_116_ch_111_ch_108_ch_111_ch_103_ch_121(
    const char *text) {
  int pos = 0;
  pos = fn_sq_ch_79_ch_110_ch_116_ch_111_ch_108_ch_111_ch_103_ch_121(text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_79_ch_110_ch_116_ch_111_ch_108_ch_111_ch_103_ch_121>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_79_ch_110_ch_116_ch_111_ch_108_ch_111_ch_103_ch_121@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_79_ch_110_ch_116_ch_111_ch_108_ch_111_ch_103_ch_121+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_79_ch_110_ch_116_ch_111_ch_108_ch_111_ch_103_ch_121+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_79_ch_110_ch_116_ch_111_ch_108_ch_111_ch_103_ch_121>:
jmp    1030 <fn_sq_ch_79_ch_110_ch_116_ch_111_ch_108_ch_111_ch_103_ch_121@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_79_ch_110_ch_116_ch_111_ch_108_ch_111_ch_103_ch_121(i8* %0) {
%2 = tail call i32 @fn_sq_ch_79_ch_110_ch_116_ch_111_ch_108_ch_111_ch_103_ch_121(i8* %0)
ret i32 %2
}
int ccomp(const void *s1, const void *s2) {
  return (*(unsigned char *)s1 - *(unsigned char *)s2);
}


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

x86 assembly (clang, -O2):
<ccomp>:
movzbl (%rdi),%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ccomp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = load i8, i8* %1
%6 = zext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 340, b = 212, c;
  c = a + b;
  printf("%d", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x154,-0x8(%rbp)
movl   $0xd4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 552)
ret i32 0
}