xunge/DecIR huggingface dataset:
int test_imm_6Bint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x6B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Bint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7012352
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int void_func(void *arg) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @void_func(i8* nocapture readnone %0) {
ret i32 0
}
int priority(unsigned int size) {
  if (size <= 965816)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<priority>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xebcb8,-0x8(%rbp)
ja     1120 <priority+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1127 <priority+0x27>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<priority>:
xor    %eax,%eax
cmp    $0xebcb9,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @priority(i32 %0) {
%2 = icmp ult i32 %0, 965817
%3 = zext i1 %2 to i32
ret i32 %3
}
void reset_load_game_data_cnf(void) {}


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

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

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

LLVM IR (-O2):
define void @reset_load_game_data_cnf() {
ret void
}
unsigned int imx_gpc_is_m4_sleeping(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @imx_gpc_is_m4_sleeping() {
ret i32 0
}

LLVM IR (-O2):
define i32 @imx_gpc_is_m4_sleeping() {
ret i32 0
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int checkWinner();
int *checkwinner_1_svc(void *argp, struct svc_req *rqstp) {
  static int result;
  result = checkWinner();
  return &result;
}


x86 assembly (clang, -O0):
<checkwinner_1_svc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <checkWinner@plt>
mov    %eax,0x2eff(%rip)
lea    0x2ef8(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkwinner_1_svc>:
push   %rax
xor    %eax,%eax
call   1030 <checkWinner@plt>
mov    %eax,0x2f0e(%rip)
lea    0x2f07(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.svc_req = type { i32 }
@checkwinner_1_svc.result = internal global i32 0
define i32* @checkwinner_1_svc(i8* %0, %struct.svc_req* %1) {
%3 = alloca i8*
%4 = alloca %struct.svc_req*
store i8* %0, i8** %3
store %struct.svc_req* %1, %struct.svc_req** %4
%5 = call i32 (...) @checkWinner()
store i32 %5, i32* @checkwinner_1_svc.result
ret i32* @checkwinner_1_svc.result
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
@checkwinner_1_svc.result = internal global i32 0
define i32* @checkwinner_1_svc(i8* nocapture readnone %0, %struct.svc_req* nocapture readnone %1) {
%3 = tail call i32 (...) @checkWinner()
store i32 %3, i32* @checkwinner_1_svc.result
ret i32* @checkwinner_1_svc.result
}
/* Type definitions */
typedef int /*<<< orphan*/ s;
typedef int /*<<< orphan*/ l;
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, int);
int main() {
  int l = 0xdeadbeef;
  short s = 0xdeadbeaf;
  unsigned char c = 257;
  printf("l = 0x%x (%d bit)\n", l, sizeof(l) * 8);
  printf("s = 0x%x (%d bit)\n", s, sizeof(s) * 8);
  printf("c = 0x%x (%d bit)\n", c, sizeof(c) * 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xdeadbeef,-0x8(%rbp)
movw   $0xbeaf,-0xa(%rbp)
movb   $0x1,-0xb(%rbp)
mov    -0x8(%rbp),%eax
lea    0xec6(%rip),%rdi
mov    $0x20,%edx
movzbl %al,%esi
call   1030 <printf@plt>
mov    -0xa(%rbp),%ax
lea    0xec1(%rip),%rdi
mov    $0x10,%edx
movzbl %al,%esi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x8,%edx
movzbl -0xb(%rbp),%esi
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    $0xef,%esi
mov    $0x20,%edx
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0xaf,%esi
mov    $0x10,%edx
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"l = 0x%x (%d bit)\0A\00"
@.str.1 = [19 x i8] c"s = 0x%x (%d bit)\0A\00"
@.str.2 = [19 x i8] c"c = 0x%x (%d bit)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
%4 = alloca i8
store i32 0, i32* %1
store i32 -559038737, i32* %2
store i16 -16721, i16* %3
store i8 1, i8* %4
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 zeroext %6, i32 32)
%8 = load i16, i16* %3
%9 = trunc i16 %8 to i8
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %9, i32 16)
%11 = load i8, i8* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %11, i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"l = 0x%x (%d bit)\0A\00"
@.str.1 = [19 x i8] c"s = 0x%x (%d bit)\0A\00"
@.str.2 = [19 x i8] c"c = 0x%x (%d bit)\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 zeroext -17, i32 32)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8 zeroext -81, i32 16)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8 zeroext 1, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *itoa(int i, char *a, int radix) {
  switch (radix) {
  case 10:
    sprintf(a, "%d", i);
    break;
  case 16:
    sprintf(a, "%x", i);
    break;
  }
  return a;
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0xa,%eax
je     1147 <itoa+0x37>
jmp    1136 <itoa+0x26>
mov    -0x18(%rbp),%eax
sub    $0x10,%eax
je     115f <itoa+0x4f>
jmp    1172 <itoa+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeab(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1172 <itoa+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe96(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%eax
cmp    $0xa,%edx
je     1129 <itoa+0x19>
cmp    $0x10,%edx
jne    113a <itoa+0x2a>
lea    0xedc(%rip),%rsi
jmp    1130 <itoa+0x20>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%x\00"
define i8* @itoa(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
switch i32 %7, label %16 [
i32 10, label %8
i32 16, label %12
]
8: ; preds = %3
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %16
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i32, i32* %4
%15 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %3, %12, %8
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%x\00"
define i8* @itoa(i32 %0, i8* returned writeonly %1, i32 %2) {
switch i32 %2, label %8 [
i32 10, label %5
i32 16, label %4
]
4: ; preds = %3
br label %5
5: ; preds = %3, %4
%6 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %3 ]
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) %6, i32 %0)
br label %8
8: ; preds = %5, %3
ret i8* %1
}
/* Variables and functions */
char *os_perf_chain_entryname(void *buf __attribute__((unused)),
                              int depth_idx __attribute__((unused))) {
  return (NULL);
}


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

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

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

LLVM IR (-O2):
define noalias i8* @os_perf_chain_entryname(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
int other_variable_style_function(ansi_header) const char *ansi_header;
{ return substr(ansi_header, "...") != 0; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"...\00"
define i32 @other_variable_style_function(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @substr to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double fmod(double, double);
double sawf(double x) {
  return -(fmod(x + 3.14159265358979323846, 6.28318530717958647693) /
               3.14159265358979323846 -
           1.0);
}


x86 assembly (clang, -O0):
<sawf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <fmod@plt>
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb5(%rip),%xmm1
subsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sawf>:
push   %rax
addsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
call   1030 <fmod@plt>
divsd  0xed2(%rip),%xmm0
addsd  0xeda(%rip),%xmm0
xorpd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sawf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 0x400921FB54442D18
%5 = call double @fmod(double %4, double 0x401921FB54442D18)
%6 = fdiv double %5, 0x400921FB54442D18
%7 = fsub double %6, 1.000000e+00
%8 = fneg double %7
ret double %8
}

LLVM IR (-O2):
define double @sawf(double %0) {
%2 = fadd double %0, 0x400921FB54442D18
%3 = tail call double @fmod(double %2, double 0x401921FB54442D18)
%4 = fdiv double %3, 0x400921FB54442D18
%5 = fadd double %4, -1.000000e+00
%6 = fneg double %5
ret double %6
}
int request_module(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @request_module(i8* nocapture readnone %0) {
ret i32 0
}
void outsl(unsigned short port, const void *addr, unsigned long count) {
  asm volatile("cld ; rep ; outsl"
               : "=S"(addr), "=c"(count)
               : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
cld
rep outsl %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsl>:
mov    %rdx,%rcx
mov    %edi,%edx
cld
rep outsl %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsl(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "cld ; rep ; outsl", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsl(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "cld ; rep ; outsl", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
const char *get_lame_short_version(void) {
  static const char *const str = "3"
                                 "."
                                 "93";
  return str;
}


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

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

LLVM IR (-O0):
@get_lame_short_version.str = internal constant i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0)
@.str = [5 x i8] c"3.93\00"
define i8* @get_lame_short_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"3.93\00"
define i8* @get_lame_short_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void labelWhileCond(int number) { printf(".L%dC:\n", number); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c".L%dC:\0A\00"
define void @labelWhileCond(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _zlog_buffer_lock();
int /*<<< orphan*/ _zlog_buffer_unlock();
int /*<<< orphan*/ _zlog_flush_buffer();
void zlog_flush_buffer(void) {
  _zlog_buffer_lock();
  _zlog_flush_buffer();
  _zlog_buffer_unlock();
}


x86 assembly (clang, -O0):
<zlog_flush_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_zlog_buffer_lock@plt>
mov    $0x0,%al
call   1040 <_zlog_flush_buffer@plt>
mov    $0x0,%al
call   1050 <_zlog_buffer_unlock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zlog_flush_buffer>:
push   %rax
xor    %eax,%eax
call   1030 <_zlog_buffer_lock@plt>
xor    %eax,%eax
call   1040 <_zlog_flush_buffer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <_zlog_buffer_unlock@plt>

LLVM IR (-O0):
define void @zlog_flush_buffer() {
%1 = call i32 (...) @_zlog_buffer_lock()
%2 = call i32 (...) @_zlog_flush_buffer()
%3 = call i32 (...) @_zlog_buffer_unlock()
ret void
}

LLVM IR (-O2):
define void @zlog_flush_buffer() {
%1 = tail call i32 (...) @_zlog_buffer_lock()
%2 = tail call i32 (...) @_zlog_flush_buffer()
%3 = tail call i32 (...) @_zlog_buffer_unlock()
ret void
}
/* Type definitions */
struct nlattr {
  int dummy;
};

/* Variables and functions */
int NLA_HDRLEN;
struct nlattr *nla_data(struct nlattr *nla) {
  return (struct nlattr *)((void *)nla + NLA_HDRLEN);
}


x86 assembly (clang, -O0):
<nla_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ecd(%rip),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_data>:
mov    0x2ed9(%rip),%rax
movslq (%rax),%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
@NLA_HDRLEN = global i32 0
define %struct.nlattr* @nla_data(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = bitcast %struct.nlattr* %3 to i8*
%5 = load i32, i32* @NLA_HDRLEN
%6 = sext i32 %5 to i64
%7 = getelementptr i8, i8* %4, i64 %6
%8 = bitcast i8* %7 to %struct.nlattr*
ret %struct.nlattr* %8
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
@NLA_HDRLEN = global i32 0
define %struct.nlattr* @nla_data(%struct.nlattr* readnone %0) {
%2 = bitcast %struct.nlattr* %0 to i8*
%3 = load i32, i32* @NLA_HDRLEN
%4 = sext i32 %3 to i64
%5 = getelementptr i8, i8* %2, i64 %4
%6 = bitcast i8* %5 to %struct.nlattr*
ret %struct.nlattr* %6
}
/* Variables and functions */
float floor(float);
float call_floorf(float x) { return floor((float)x); }


x86 assembly (clang, -O0):
<call_floorf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_floorf>:
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define float @call_floorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @floor(float %3)
ret float %4
}

LLVM IR (-O2):
define float @call_floorf(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
ret float %2
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t prv_lt_int32_fn(int32_t a, int32_t b) { return a < b ? -1 : 0; }


x86 assembly (clang, -O0):
<prv_lt_int32_fn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovl  %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_lt_int32_fn>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
neg    %rax
ret

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

LLVM IR (-O2):
define i64 @prv_lt_int32_fn(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = sext i1 %3 to i64
ret i64 %4
}
int g(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 42
}

LLVM IR (-O2):
define i32 @g() {
ret i32 42
}
double funct2(double A, double B, double C, double x) {
  return (A + C - 2 * B) / 2.0 * x * x + (A - C) / 2.0 * x + B;
}


x86 assembly (clang, -O0):
<funct2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  0xea9(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<funct2>:
movapd %xmm0,%xmm4
addsd  %xmm2,%xmm4
movapd %xmm1,%xmm5
addsd  %xmm1,%xmm5
subsd  %xmm5,%xmm4
movsd  0xee4(%rip),%xmm5
mulsd  %xmm5,%xmm4
mulsd  %xmm3,%xmm4
subsd  %xmm2,%xmm0
mulsd  %xmm5,%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm4
addsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @funct2(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fadd double %9, %10
%12 = load double, double* %6
%13 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %12, double %11)
%14 = fdiv double %13, 2.000000e+00
%15 = load double, double* %8
%16 = fmul double %14, %15
%17 = load double, double* %8
%18 = load double, double* %5
%19 = load double, double* %7
%20 = fsub double %18, %19
%21 = fdiv double %20, 2.000000e+00
%22 = load double, double* %8
%23 = fmul double %21, %22
%24 = call double @llvm.fmuladd.f64(double %16, double %17, double %23)
%25 = load double, double* %6
%26 = fadd double %24, %25
ret double %26
}

LLVM IR (-O2):
define double @funct2(double %0, double %1, double %2, double %3) {
%5 = fadd double %0, %2
%6 = tail call double @llvm.fmuladd.f64(double %1, double -2.000000e+00, double %5)
%7 = fmul double %6, 5.000000e-01
%8 = fmul double %7, %3
%9 = fsub double %0, %2
%10 = fmul double %9, 5.000000e-01
%11 = fmul double %10, %3
%12 = tail call double @llvm.fmuladd.f64(double %8, double %3, double %11)
%13 = fadd double %12, %1
ret double %13
}
/* Variables and functions */
int sci_get_chip_id();
int soc_id_is_sc7720v0(void) {
  return ((sci_get_chip_id() & (0xFFFF0000)) == ((0x88600000) & (0xFFFF0000)));
}


x86 assembly (clang, -O0):
<soc_id_is_sc7720v0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sci_get_chip_id@plt>
and    $0xffff0000,%eax
cmp    $0x88600000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_id_is_sc7720v0>:
push   %rax
xor    %eax,%eax
call   1030 <sci_get_chip_id@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x88600000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @soc_id_is_sc7720v0() {
%1 = call i32 (...) @sci_get_chip_id()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, -2006974464
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @soc_id_is_sc7720v0() {
%1 = tail call i32 (...) @sci_get_chip_id()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, -2006974464
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main() {
  system("ls -al >./out");
  printf("Bye\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xed7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <system@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"ls -al >./out\00"
@.str.1 = [5 x i8] c"Bye\0A\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"ls -al >./out\00"
@str = [4 x i8] c"Bye\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void mydelay() {
  volatile unsigned int i = 0xfffff;
  while (i--)
    ;
}


x86 assembly (clang, -O0):
<mydelay>:
push   %rbp
mov    %rsp,%rbp
movl   $0xfffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1124 <mydelay+0x24>
jmp    110b <mydelay+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mydelay>:
movl   $0xfffff,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
subl   $0x1,-0x4(%rsp)
jae    1110 <mydelay+0x10>
ret

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

LLVM IR (-O2):
define void @mydelay() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1048575, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* %1
%5 = add i32 %4, -1
store volatile i32 %5, i32* %1
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
int /*<<< orphan*/ changeMethaneLevel();
int /*<<< orphan*/ timeShift();
int /*<<< orphan*/ waterRise();
int main(void) {
  while (1) {
    if (__VERIFIER_nondet_int()) {
      waterRise();
    }
    if (__VERIFIER_nondet_int()) {
      changeMethaneLevel();
    }
    timeShift();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     1167 <main+0x27>
mov    $0x0,%al
call   1030 <waterRise@plt>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     117f <main+0x3f>
mov    $0x0,%al
call   1050 <changeMethaneLevel@plt>
mov    $0x0,%al
call   1060 <timeShift@plt>
jmp    114f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
jmp    1157 <main+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1060 <timeShift@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     116a <main+0x2a>
xor    %eax,%eax
call   1030 <waterRise@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     1150 <main+0x10>
xor    %eax,%eax
call   1050 <changeMethaneLevel@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %12
%3 = call i64 (...) @__VERIFIER_nondet_int()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = call i32 (...) @waterRise()
br label %7
7: ; preds = %5, %2
%8 = call i64 (...) @__VERIFIER_nondet_int()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @changeMethaneLevel()
br label %12
12: ; preds = %10, %7
%13 = call i32 (...) @timeShift()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %11
%2 = tail call i64 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @waterRise()
br label %6
6: ; preds = %4, %1
%7 = tail call i64 (...) @__VERIFIER_nondet_int()
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 (...) @changeMethaneLevel()
br label %11
11: ; preds = %9, %6
%12 = tail call i32 (...) @timeShift()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ outop2str(char *);
void outstore() { outop2str("ST"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"ST\00"
define void @outstore() {
%1 = call i32 @outop2str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ST\00"
define void @outstore() {
%1 = tail call i32 @outop2str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int range_decode_culshift(int);
int /*<<< orphan*/ range_decode_update(int, int);
unsigned short range_decode_short(void) {
  int tmp = range_decode_culshift(16);
  range_decode_update(1, tmp);
  return tmp;
}


x86 assembly (clang, -O0):
<range_decode_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1030 <range_decode_culshift@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1040 <range_decode_update@plt>
mov    -0x4(%rbp),%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_decode_short>:
push   %rbx
mov    $0x10,%edi
call   1030 <range_decode_culshift@plt>
mov    %eax,%ebx
mov    $0x1,%edi
mov    %eax,%esi
call   1040 <range_decode_update@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @range_decode_short() {
%1 = alloca i32
%2 = call i32 @range_decode_culshift(i32 16)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @range_decode_update(i32 1, i32 %3)
%5 = load i32, i32* %1
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @range_decode_short() {
%1 = tail call i32 @range_decode_culshift(i32 16)
%2 = tail call i32 @range_decode_update(i32 1, i32 %1)
%3 = trunc i32 %1 to i16
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%i\n", 105 % (3 * 4) - (3 * 4) % (101 / 10)); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}
__attribute__((no, noclone)) int J1(int A, int B) {
  volatile int C = A | B;
  volatile int D = A & B;
  return C | D;
}


x86 assembly (clang, -O0):
<J1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<J1>:
mov    %esi,%eax
or     %edi,%eax
mov    %eax,-0x4(%rsp)
and    %edi,%esi
mov    %esi,-0x8(%rsp)
mov    -0x4(%rsp),%eax
or     -0x8(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @J1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = or i32 %7, %8
store volatile i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = and i32 %10, %11
store volatile i32 %12, i32* %6
%13 = load volatile i32, i32* %5
%14 = load volatile i32, i32* %6
%15 = or i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @J1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = or i32 %1, %0
store volatile i32 %6, i32* %3
%7 = bitcast i32* %4 to i8*
%8 = and i32 %1, %0
store volatile i32 %8, i32* %4
%9 = load volatile i32, i32* %3
%10 = load volatile i32, i32* %4
%11 = or i32 %10, %9
ret i32 %11
}
void default_isr_handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<default_isr_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <default_isr_handler+0x9>
jmp    1109 <default_isr_handler+0x9>

x86 assembly (clang, -O2):
<default_isr_handler>:
jmp    1100 <default_isr_handler>

LLVM IR (-O0):
define void @default_isr_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @default_isr_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int open(char const *, int, int /*<<< orphan*/);
int zopen(const char *pathname, int flags, mode_t mode) {
  int ret;
  do {
    ret = open(pathname, flags, mode);
  } while ((ret < 0) && (errno == EINTR));
  return ret;
  ;
}


x86 assembly (clang, -O0):
<zopen>:
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),%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jge    115d <zopen+0x4d>
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1122 <zopen+0x12>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zopen>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <open@plt>
test   %eax,%eax
jns    114a <zopen+0x3a>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <zopen+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @zopen(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %8
8: ; preds = %20, %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @open(i8* %9, i32 %10, i32 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @zopen(i8* nocapture %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
%6 = icmp slt i32 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
double m_to_ft(double h) { return h * 3.28; }


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

x86 assembly (clang, -O2):
<m_to_ft>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @m_to_ft(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.280000e+00
ret double %4
}

LLVM IR (-O2):
define double @m_to_ft(double %0) {
%2 = fmul double %0, 3.280000e+00
ret double %2
}
unsigned xrop3_155_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;
  unsigned stk3;
  stk3 = T | S;
  stk2 = D & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_155_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    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -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_155_1_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
or     %edi,%esi
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_155_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 i8 %1, %0
%8 = zext i8 %7 to i32
%9 = or i32 %4, %8
%10 = or i32 %9, %6
%11 = xor i32 %10, -1
%12 = or i32 %8, %11
ret i32 %12
}
label(s) register char *s;
{
  putchar(037);
  while (*s)
    putchar(*s++);
}


x86 assembly (clang, -O0):
<label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x1f,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <label+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    1128 <label+0x18>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<label>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1f,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    (%rbx),%al
test   %al,%al
je     1145 <label+0x35>
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <label+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @label(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 31)
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %13)
br label %5
15: ; preds = %5
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @label(i8* nocapture %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 31)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %11, %5 ], [ %3, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %9)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) {
  (void)signal(SIGINT, SIG_IGN);
  (void)signal(SIGQUIT, SIG_IGN);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
jmp    114d <main+0x3d>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1030 <signal@plt>
nopl   0x0(%rax,%rax,1)
jmp    1140 <main+0x30>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIGQUIT = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SIGINT
%3 = load i32, i32* @SIG_IGN
%4 = call i32 @signal(i32 %2, i32 %3)
%5 = load i32, i32* @SIGQUIT
%6 = load i32, i32* @SIG_IGN
%7 = call i32 @signal(i32 %5, i32 %6)
br label %8
8: ; preds = %0, %8
br label %8
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIGQUIT = global i32 0
define i32 @main() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGQUIT
%5 = load i32, i32* @SIG_IGN
%6 = tail call i32 @signal(i32 %4, i32 %5)
br label %7
7: ; preds = %0, %7
br label %7
}
void use_spi() {
  *(volatile unsigned long *)((void *)0xfffff400 + 0x04) =
      ((1 << 12) | (1 << 13) | (1 << 14));
}


x86 assembly (clang, -O0):
<use_spi>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff400,%eax
movq   $0x7000,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_spi>:
mov    $0xfffff404,%eax
movq   $0x7000,(%rax)
ret

LLVM IR (-O0):
define void @use_spi() {
store volatile i64 28672, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294964224 to i8*), i64 4) to i64*)
ret void
}

LLVM IR (-O2):
define void @use_spi() {
store volatile i64 28672, i64* inttoptr (i64 4294964228 to i64*)
ret void
}
/* Type definitions */
struct stat64 {
  int dummy;
};
struct stat {
  int dummy;
};

/* Variables and functions */
int __xstat(int, char const *, struct stat *);
int __lxstat64(int ver, const char *argpath, struct stat64 *buf) {
  return __xstat(ver, argpath, (struct stat *)buf);
}


x86 assembly (clang, -O0):
<__lxstat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__xstat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lxstat64>:
jmp    1030 <__xstat@plt>

LLVM IR (-O0):
%struct.stat64 = type { i32 }
%struct.stat = type { i32 }
define i32 @__lxstat64(i32 %0, i8* %1, %struct.stat64* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.stat64*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.stat64* %2, %struct.stat64** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load %struct.stat64*, %struct.stat64** %6
%10 = bitcast %struct.stat64* %9 to %struct.stat*
%11 = call i32 @__xstat(i32 %7, i8* %8, %struct.stat* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.stat64 = type { i32 }
%struct.stat = type { i32 }
define i32 @__lxstat64(i32 %0, i8* %1, %struct.stat64* %2) {
%4 = bitcast %struct.stat64* %2 to %struct.stat*
%5 = tail call i32 @__xstat(i32 %0, i8* %1, %struct.stat* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int del_handler(char **save) {
  write_instr(0x00);
  write_imm(0x4C);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<del_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x4c,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x4c,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @del_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 76)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @del_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 76)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RTC_Zero();
void RTC_Init(void) {
  (*(volatile unsigned long *)(0xE0024000 + 0x80)) =
      (((5 * 11059200) / 32768) - 1);
  (*(volatile unsigned long *)(0xE0024000 + 0x84)) =
      ((5 * 11059200) - (((((5 * 11059200) / 32768) - 1) + 1) * 32768));
  (*(volatile unsigned long *)(0xE0024000 + 0x08)) = (1 << 0);
  RTC_Zero();
}


x86 assembly (clang, -O0):
<RTC_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0024080,%eax
movq   $0x696,(%rax)
mov    $0xe0024084,%eax
movq   $0x4000,(%rax)
mov    $0xe0024008,%eax
movq   $0x1,(%rax)
mov    $0x0,%al
call   1030 <RTC_Zero@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTC_Init>:
mov    $0xe0024008,%eax
movq   $0x696,0x78(%rax)
movq   $0x4000,0x7c(%rax)
movq   $0x1,(%rax)
xor    %eax,%eax
jmp    1030 <RTC_Zero@plt>

LLVM IR (-O0):
define void @RTC_Init() {
store volatile i64 1686, i64* inttoptr (i64 3758243968 to i64*)
store volatile i64 16384, i64* inttoptr (i64 3758243972 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758243848 to i64*)
%1 = call i32 (...) @RTC_Zero()
ret void
}

LLVM IR (-O2):
define void @RTC_Init() {
store volatile i64 1686, i64* inttoptr (i64 3758243968 to i64*)
store volatile i64 16384, i64* inttoptr (i64 3758243972 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758243848 to i64*)
%1 = tail call i32 (...) @RTC_Zero()
ret void
}