xunge/DecIR huggingface dataset:
int check_prime(int num) {
  int i = 2, div;
  while (i <= (num / 2)) {
    div = num % i;
    if (div == 0)
      return 0;
    else
      i = i + 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jg     115a <check_prime+0x5a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    114c <check_prime+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1161 <check_prime+0x61>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <check_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x1,%r8d
cmp    $0x4,%edi
jl     1137 <check_prime+0x37>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <check_prime+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <check_prime+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
int test_imm_AEint64_midword_reg(long long val) {
  return ((val >> 16) & (0xAE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_AEint64_midword_reg>:
test   $0xae0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_AEint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 174
%6 = icmp ne i64 %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_AEint64_midword_reg(i64 %0) {
%2 = and i64 %0, 11403264
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int hello_world() {
  volatile char *msg = "Hello, World!";
  long msi = (long)msg;
  asm("movq 1, %%rax\n\t"
      "movq 13, %%rdx\n\t"
      "movq %0 , %%rsi\n\t"
      "movq 1 , %%rdi\n\t"
      "syscall" ::"r"(msi)
      : "rax", "rdx", "rsi", "rdi");
  return 0;
}


x86 assembly (clang, -O0):
<hello_world>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    0x1,%rax
mov    0xd,%rdx
mov    %rcx,%rsi
mov    0x1,%rdi
syscall
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello_world>:
lea    0xef9(%rip),%rcx
mov    0x1,%rax
mov    0xd,%rdx
mov    %rcx,%rsi
mov    0x1,%rdi
syscall
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @hello_world() {
%1 = alloca i8*
%2 = alloca i64
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = ptrtoint i8* %3 to i64
store i64 %4, i64* %2
%5 = load i64, i64* %2
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @hello_world() {
tail call void asm sideeffect "movq 1, %rax\0A\09movq 13, %rdx\0A\09movq $0 , %rsi\0A\09movq 1 , %rdi\0A\09syscall", "r,~{rax},~{rdx},~{rsi},~{rdi},~{dirflag},~{fpsr},~{flags}"(i64 ptrtoint ([14 x i8]* @.str to i64))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int libsoc_get_debug() {
  printf("libsoc-debug: warning debug support missing!\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"libsoc-debug: warning debug support missing!\0A\00"
define i32 @libsoc_get_debug() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"libsoc-debug: warning debug support missing!\00"
define i32 @libsoc_get_debug() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void two(const int grade) {
  if (grade > 70)
    printf("You passed!\n");
}


x86 assembly (clang, -O0):
<two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x46,-0x4(%rbp)
jle    1131 <two+0x21>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two>:
cmp    $0x47,%edi
jl     1121 <two+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [13 x i8] c"You passed!\0A\00"
define void @two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 70
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"You passed!\00"
define void @two(i32 %0) {
%2 = icmp sgt i32 %0, 70
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ M83Sync();
void M83StateRestore(int version) { M83Sync(); }


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

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

LLVM IR (-O0):
define void @M83StateRestore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @M83Sync()
ret void
}

LLVM IR (-O2):
define void @M83StateRestore(i32 %0) {
%2 = tail call i32 (...) @M83Sync()
ret void
}
/* Type definitions */
struct sigcontext {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ error(char *, int);
void handler(int sig, int code, struct sigcontext *scp) {
  error("wrote to pipe with closed read end", 206);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
mov    $0xce,%esi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
lea    0xee9(%rip),%rdi
mov    $0xce,%esi
jmp    1030 <error@plt>

LLVM IR (-O0):
%struct.sigcontext = type { i32 }
@.str = [35 x i8] c"wrote to pipe with closed read end\00"
define void @handler(i32 %0, i32 %1, %struct.sigcontext* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sigcontext*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.sigcontext* %2, %struct.sigcontext** %6
%7 = call i32 @error(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 206)
ret void
}

LLVM IR (-O2):
%struct.sigcontext = type { i32 }
@.str = [35 x i8] c"wrote to pipe with closed read end\00"
define void @handler(i32 %0, i32 %1, %struct.sigcontext* nocapture readnone %2) {
%4 = tail call i32 @error(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 206)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uwsgi_sudirription_set_algo(char *);
void uwsgi_opt_ssa(char *opt, char *value, void *foobar) {
  uwsgi_sudirription_set_algo(value);
}


x86 assembly (clang, -O0):
<uwsgi_opt_ssa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <uwsgi_sudirription_set_algo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_opt_ssa>:
mov    %rsi,%rdi
jmp    1030 <uwsgi_sudirription_set_algo@plt>

LLVM IR (-O0):
define void @uwsgi_opt_ssa(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = call i32 @uwsgi_sudirription_set_algo(i8* %7)
ret void
}

LLVM IR (-O2):
define void @uwsgi_opt_ssa(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @uwsgi_sudirription_set_algo(i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void WriteLE32(unsigned char *ptr, uint32_t x) { *((uint32_t *)ptr) = x; }


x86 assembly (clang, -O0):
<WriteLE32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteLE32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @WriteLE32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @WriteLE32(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int strncmp(char *, char *, int);
int comp_key(char *s, char *t) {
  int ret;
  ret = strncmp(s, t, 30);
  return ret;
}


x86 assembly (clang, -O0):
<comp_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1e,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_key>:
mov    $0x1e,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @comp_key(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @strncmp(i8* %6, i8* %7, i32 30)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @comp_key(i8* %0, i8* %1) {
%3 = tail call i32 @strncmp(i8* %0, i8* %1, i32 30)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ xsi_register_didat(char *, char *);
extern void std_textio_init() {
  xsi_register_didat("std_textio", "isim/precompiled.exe.sim/std/textio.didat");
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"std_textio\00"
@.str.1 = [42 x i8] c"isim/precompiled.exe.sim/std/textio.didat\00"
define void @std_textio_init() {
%1 = call i32 @xsi_register_didat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"std_textio\00"
@.str.1 = [42 x i8] c"isim/precompiled.exe.sim/std/textio.didat\00"
define void @std_textio_init() {
%1 = tail call i32 @xsi_register_didat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t max(size_t a, size_t b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max(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 ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int test_imm_A3uint32_mem(unsigned int *val) {
  return ((*val) & (0xA3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A3uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 163
%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_A3uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 163
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main() {
  int a;
  int b;
  int result;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void reportSolutionFound(int solution_found) {}


x86 assembly (clang, -O0):
<reportSolutionFound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @reportSolutionFound(i32 %0) {
ret void
}
__attribute__((weak)) void fd_nrf8001_set_key_success(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_set_key_success() {
ret void
}
int open(const char *filename, int flags, ...) {
  int r;
  __asm__ __volatile__("\tint $0x80\n"
                       : "=a"(r)
                       : "a"(5), "b"(filename), "c"(flags)
                       : "memory");
  return set_errno(r);
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x14(%rbp),%ecx
mov    $0x5,%eax
int    $0x80
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
xor    %eax,%eax
call   1030 <set_errno@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
push   %rbx
mov    %esi,%ecx
mov    %rdi,%rbx
mov    $0x5,%eax
int    $0x80
mov    %eax,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <set_errno@plt>

LLVM IR (-O0):
define i32 @open(i8* %0, i32 %1, ...) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 5, i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1, ...) {
%3 = tail call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 5, i8* %0, i32 %1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}
/* Variables and functions */
int close(int);
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void close_or_exit(int fd) {
  int result = -1;
  errno = 0;
  result = close(fd);
  if (result < 0) {
    perror("Can't close");
    exit(5);
  }
}


x86 assembly (clang, -O0):
<close_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    0x2e97(%rip),%rax
movq   $0x0,(%rax)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    117b <close_or_exit+0x4b>
lea    0xe94(%rip),%rdi
call   1040 <perror@plt>
mov    $0x5,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_or_exit>:
push   %rax
mov    0x2ea8(%rip),%rax
movq   $0x0,(%rax)
call   1030 <close@plt>
test   %eax,%eax
js     114a <close_or_exit+0x1a>
pop    %rax
ret
lea    0xeaf(%rip),%rdi
call   1040 <perror@plt>
mov    $0x5,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [12 x i8] c"Can't close\00"
define void @close_or_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
store i64 0, i64* @errno
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 5)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [12 x i8] c"Can't close\00"
define void @close_or_exit(i32 %0) {
store i64 0, i64* @errno
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 5)
unreachable
7: ; preds = %1
ret void
}
void cpu_delay250ns() {
  asm volatile("nop" ::);
  asm volatile("nop" ::);
}


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

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

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

LLVM IR (-O2):
define void @cpu_delay250ns() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void UninitI420toRGB565() {}


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

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

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

LLVM IR (-O2):
define void @UninitI420toRGB565() {
ret void
}
unsigned int lshift(unsigned int x, unsigned int s) {
  x &= 0xFFFFFFFF;
  return ((x << s) & 0xFFFFFFFF) | (x >> (32 - s));
}


x86 assembly (clang, -O0):
<lshift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
and    $0xffffffff,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lshift>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @lshift(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ VLM_loxo_distance_angle(double, double, double, double,
                                           double *, double *);
double VLM_loxo_heading(double latitude, double longitude, double target_lat,
                        double target_long) {
  double distance, heading;
  VLM_loxo_distance_angle(latitude, longitude, target_lat, target_long,
                          &distance, &heading);
  return heading;
}


x86 assembly (clang, -O0):
<VLM_loxo_heading>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <VLM_loxo_distance_angle@plt>
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VLM_loxo_heading>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <VLM_loxo_distance_angle@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @VLM_loxo_heading(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %5
%12 = load double, double* %6
%13 = load double, double* %7
%14 = load double, double* %8
%15 = call i32 @VLM_loxo_distance_angle(double %11, double %12, double %13, double %14, double* %9, double* %10)
%16 = load double, double* %10
ret double %16
}

LLVM IR (-O2):
define double @VLM_loxo_heading(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %5 to i8*
%8 = bitcast double* %6 to i8*
%9 = call i32 @VLM_loxo_distance_angle(double %0, double %1, double %2, double %3, double* %5, double* %6)
%10 = load double, double* %6
ret double %10
}
int main(void) {
  int n, m;
  for (n = 0; m > 0; n++, m /= 2)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113d <main+0x3d>
jmp    1121 <main+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int pm8901_mpp_config(unsigned int, int, unsigned int, unsigned int);
int pm8901_mpp_config_dtest_sink(unsigned mpp, unsigned level,
                                 unsigned control) {
  return pm8901_mpp_config(mpp, 6, level, control);
}


x86 assembly (clang, -O0):
<pm8901_mpp_config_dtest_sink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x6,%esi
call   1030 <pm8901_mpp_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8901_mpp_config_dtest_sink>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x6,%esi
jmp    1030 <pm8901_mpp_config@plt>

LLVM IR (-O0):
define i32 @pm8901_mpp_config_dtest_sink(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @pm8901_mpp_config(i32 %7, i32 6, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pm8901_mpp_config_dtest_sink(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8901_mpp_config(i32 %0, i32 6, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ max_heapify(int *, int, int);
void build_max_heap(int nums[], int len) {
  int heap_size = len;
  for (int i = len / 2 - 1; i >= 0; i--) {
    max_heapify(nums, heap_size, i);
  }
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     115d <build_max_heap+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <max_heapify@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <build_max_heap+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1145 <build_max_heap+0x35>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <max_heapify@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @build_max_heap(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* %4
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = sdiv i32 %8, 2
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %6
br label %11
11: ; preds = %19, %2
%12 = load i32, i32* %6
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = call i32 @max_heapify(i32* %15, i32 %16, i32 %17)
br label %19
19: ; preds = %14
%20 = load i32, i32* %6
%21 = add nsw i32 %20, -1
store i32 %21, i32* %6
br label %11
22: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i32 [ %9, %7 ], [ %5, %4 ]
%9 = add nsw i32 %8, -1
%10 = tail call i32 @max_heapify(i32* %0, i32 %1, i32 %9)
%11 = icmp ugt i32 %8, 1
br i1 %11, label %7, label %6
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ lib1_function();
int /*<<< orphan*/ lib2_function();
int /*<<< orphan*/ moveable_function();
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  fprintf(stdout, "Hello from program.c\n");
  fflush(stdout);
  lib1_function();
  lib2_function();
  moveable_function();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <lib1_function@plt>
mov    $0x0,%al
call   1070 <lib2_function@plt>
mov    $0x0,%al
call   1060 <moveable_function@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e88(%rip),%rbx
mov    (%rbx),%edi
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <lib1_function@plt>
xor    %eax,%eax
call   1070 <lib2_function@plt>
xor    %eax,%eax
call   1060 <moveable_function@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [22 x i8] c"Hello from program.c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
%10 = call i32 (...) @lib1_function()
%11 = call i32 (...) @lib2_function()
%12 = call i32 (...) @moveable_function()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [22 x i8] c"Hello from program.c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 (...) @lib1_function()
%8 = tail call i32 (...) @lib2_function()
%9 = tail call i32 (...) @moveable_function()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mystrcpy(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char a[10], s[10];
  printf("请输入一个字符串:");
  scanf("%s", s);
  mystrcpy(a, s);
  printf("%s\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x18(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xe(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <mystrcpy@plt>
lea    -0xe(%rbp),%rsi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%r14
mov    %r14,%rsi
call   1060 <scanf@plt>
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <mystrcpy@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E5\AD\97\E7\AC\A6\E4\B8\B2:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @mystrcpy(i8* %7, i8* %8)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E5\AD\97\E7\AC\A6\E4\B8\B2:\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @mystrcpy(i8* %3, i8* %4)
%8 = call i32 @puts(i8* %3)
ret i32 0
}
char vorz(float z) { return ((z < 0) ? '-' : (z == 0) ? '0' : '+'); }


x86 assembly (clang, -O0):
<vorz>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1123 <vorz+0x23>
mov    $0x2d,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <vorz+0x48>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0x2b,%eax
mov    $0x30,%ecx
ucomiss %xmm1,%xmm0
setnp  %sil
sete   %dl
test   %sil,%dl
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vorz>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setnp  %al
sete   %cl
xor    %edx,%edx
test   %al,%cl
setne  %dl
ucomiss %xmm0,%xmm1
lea    0x2b(%rdx,%rdx,4),%ecx
mov    $0x2d,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @vorz(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load float, float* %2
%8 = fcmp oeq float %7, 0.000000e+00
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 48, i32 43
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ 45, %5 ], [ %10, %6 ]
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @vorz(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp oeq float %0, 0.000000e+00
%4 = select i1 %3, i8 48, i8 43
%5 = select i1 %2, i8 45, i8 %4
ret i8 %5
}
int CountingDifference(int n) {
  int res = 0;
  int sum = (1 + n) * n / 2;
  for (int i = 1; i <= n; i++) {
    res += i * (sum - i);
  }
  return res;
}


x86 assembly (clang, -O0):
<CountingDifference>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
imul   -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1156 <CountingDifference+0x56>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <CountingDifference+0x2a>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountingDifference>:
test   %edi,%edi
jle    1149 <CountingDifference+0x49>
lea    0x1(%rdi),%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
lea    -0x1(%rdi),%ecx
lea    (%rax,%rax,1),%edx
add    $0xfffffffc,%edx
imul   %ecx,%edx
add    %eax,%edx
add    $0xfffffffb,%eax
lea    -0x2(%rdi),%esi
imul   %rcx,%rsi
add    $0xfffffffd,%edi
imul   %rsi,%rdi
shr    %rsi
imul   %eax,%esi
add    %edx,%esi
shr    %rdi
imul   $0xaaaaaaaa,%edi,%eax
add    %esi,%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @CountingDifference(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 1, %6
%8 = load i32, i32* %2
%9 = mul nsw i32 %7, %8
%10 = sdiv i32 %9, 2
store i32 %10, i32* %4
store i32 1, i32* %5
br label %11
11: ; preds = %23, %1
%12 = load i32, i32* %5
%13 = load i32, i32* %2
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %26
15: ; preds = %11
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = sub nsw i32 %17, %18
%20 = mul nsw i32 %16, %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, %20
store i32 %22, i32* %3
br label %23
23: ; preds = %15
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %11
26: ; preds = %11
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @CountingDifference(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
%5 = icmp slt i32 %0, 1
br i1 %5, label %29, label %6
6: ; preds = %1
%7 = add nsw i32 %0, -1
%8 = shl nsw i32 %4, 1
%9 = add i32 %8, -4
%10 = mul i32 %7, %9
%11 = add i32 %4, %10
%12 = add nsw i32 %4, -5
%13 = zext i32 %7 to i33
%14 = add nsw i32 %0, -2
%15 = zext i32 %14 to i33
%16 = mul i33 %13, %15
%17 = lshr i33 %16, 1
%18 = trunc i33 %17 to i32
%19 = mul i32 %12, %18
%20 = add i32 %11, %19
%21 = add nsw i32 %0, -3
%22 = zext i32 %21 to i33
%23 = mul i33 %16, %22
%24 = lshr i33 %23, 1
%25 = trunc i33 %24 to i32
%26 = mul i32 %25, -1431655766
%27 = add i32 %20, -1
%28 = add i32 %26, %27
br label %29
29: ; preds = %6, %1
%30 = phi i32 [ 0, %1 ], [ %28, %6 ]
ret i32 %30
}
int is_uvar(x)
int x;
{
  if (x / 20000000 == 3)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<is_uvar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x1312d00,%ecx
cltd
idiv   %ecx
cmp    $0x3,%eax
jne    1127 <is_uvar+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_uvar+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_uvar>:
add    $0xfc6c7900,%edi
xor    %eax,%eax
cmp    $0x1312d00,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_uvar(i32 %0) {
%2 = add i32 %0, -60000000
%3 = icmp ult i32 %2, 20000000
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int drv_FW8888_list(void) {
  printf("Allnet-FW8888");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Allnet-FW8888\00"
define i32 @drv_FW8888_list() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sdsortrec(int *, size_t, int /*<<< orphan*/, int);
void sdsort(int *a, size_t n) { sdsortrec(a, n, 0, 1); }


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

x86 assembly (clang, -O2):
<sdsort>:
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <sdsortrec@plt>

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

LLVM IR (-O2):
define void @sdsort(i32* %0, i64 %1) {
%3 = tail call i32 @sdsortrec(i32* %0, i64 %1, i32 0, i32 1)
ret void
}
void strcpyl(unsigned char *str1, unsigned char *str2, unsigned long length) {
  asm("rep movsb" ::"S"((unsigned long)str1), "D"((unsigned long)str2),
      "c"(length));
}


x86 assembly (clang, -O0):
<strcpyl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
rep movsb %ds:(%rsi),%es:(%rdi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpyl>:
mov    %rdx,%rcx
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
rep movsb %ds:(%rsi),%es:(%rdi)
ret

LLVM IR (-O0):
define void @strcpyl(i8* %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
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = load i64, i64* %6
ret void
}

LLVM IR (-O2):
define void @strcpyl(i8* %0, i8* %1, i64 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = ptrtoint i8* %1 to i64
tail call void asm sideeffect "rep movsb", "{si},{di},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %4, i64 %5, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int prompt_account_number(void) {
  int temp_value = 0;
  printf("User Account Number? ");
  scanf(" %d", &temp_value);
  return temp_value;
}


x86 assembly (clang, -O0):
<prompt_account_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_account_number>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"User Account Number? \00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @prompt_account_number() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [22 x i8] c"User Account Number? \00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @prompt_account_number() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
double maximum4(double x1, double x2, double x3, double x4) {
  x1 = ((x1) > (x2) ? (x1) : (x2));
  x3 = ((x3) > (x4) ? (x3) : (x4));
  return ((x1) > (x3) ? (x1) : (x3));
}


x86 assembly (clang, -O0):
<maximum4>:
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
ucomisd -0x10(%rbp),%xmm0
jbe    1137 <maximum4+0x37>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1141 <maximum4+0x41>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    116a <maximum4+0x6a>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1174 <maximum4+0x74>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    119d <maximum4+0x9d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    11a7 <maximum4+0xa7>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maximum4>:
maxsd  %xmm1,%xmm0
maxsd  %xmm3,%xmm2
maxsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @maximum4(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* %6
%11 = fcmp ogt double %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load double, double* %5
br label %16
14: ; preds = %4
%15 = load double, double* %6
br label %16
16: ; preds = %14, %12
%17 = phi double [ %13, %12 ], [ %15, %14 ]
store double %17, double* %5
%18 = load double, double* %7
%19 = load double, double* %8
%20 = fcmp ogt double %18, %19
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = load double, double* %7
br label %25
23: ; preds = %16
%24 = load double, double* %8
br label %25
25: ; preds = %23, %21
%26 = phi double [ %22, %21 ], [ %24, %23 ]
store double %26, double* %7
%27 = load double, double* %5
%28 = load double, double* %7
%29 = fcmp ogt double %27, %28
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = load double, double* %5
br label %34
32: ; preds = %25
%33 = load double, double* %7
br label %34
34: ; preds = %32, %30
%35 = phi double [ %31, %30 ], [ %33, %32 ]
ret double %35
}

LLVM IR (-O2):
define double @maximum4(double %0, double %1, double %2, double %3) {
%5 = fcmp ogt double %0, %1
%6 = select i1 %5, double %0, double %1
%7 = fcmp ogt double %2, %3
%8 = select i1 %7, double %2, double %3
%9 = fcmp ogt double %6, %8
%10 = select i1 %9, double %6, double %8
ret double %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int strlen(char const *);
uint32_t hash_dek_str(const void *key) {
  const char *str = key;
  uint32_t hash = strlen(str);
  while (*str++)
    hash = ((hash << 5) ^ (hash >> 27)) ^ *str;
  return hash;
}


x86 assembly (clang, -O0):
<hash_dek_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     1167 <hash_dek_str+0x57>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
mov    -0x14(%rbp),%ecx
sar    $0x1b,%ecx
xor    %ecx,%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <hash_dek_str+0x20>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_dek_str>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmpb   $0x0,(%rbx)
je     1147 <hash_dek_str+0x37>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
shl    $0x5,%ecx
sar    $0x1b,%eax
xor    %ecx,%eax
movsbl (%rbx),%ecx
xor    %ecx,%eax
add    $0x1,%rbx
test   %ecx,%ecx
jne    1130 <hash_dek_str+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @hash_dek_str(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %8, %5 ], [ %0, %1 ]
%7 = phi i32 [ %14, %5 ], [ %2, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = shl i32 %7, 5
%10 = ashr i32 %7, 27
%11 = xor i32 %9, %10
%12 = load i8, i8* %8
%13 = sext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = icmp eq i8 %12, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %1
%17 = phi i32 [ %2, %1 ], [ %14, %5 ]
ret i32 %17
}