xunge/DecIR huggingface dataset:
int my_strcmp(const char *s1, const char *s2) {
  while (*s1 == *s2) {
    if (!(*s1))
      return (0);
    ++s1;
    ++s2;
  }
  return (*s1 - *s2);
}


x86 assembly (clang, -O0):
<my_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1158 <my_strcmp+0x58>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113b <my_strcmp+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    116b <my_strcmp+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <my_strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcmp>:
mov    (%rdi),%al
mov    (%rsi),%dl
cmp    %dl,%al
jne    1124 <my_strcmp+0x24>
mov    $0x1,%ecx
nopl   (%rax)
test   %al,%al
je     112d <my_strcmp+0x2d>
movzbl (%rdi,%rcx,1),%eax
movzbl (%rsi,%rcx,1),%edx
add    $0x1,%rcx
cmp    %dl,%al
je     1110 <my_strcmp+0x10>
movsbl %dl,%ecx
movsbl %al,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %19 to i32
%21 = sext i8 %18 to i32
%22 = sub nsw i32 %21, %20
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *ftk_strcpy(char *dst, const char *src) { return strcpy(dst, src); }


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

x86 assembly (clang, -O2):
<ftk_strcpy>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define i8* @ftk_strcpy(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
void makeanswermove() {}


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

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

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

LLVM IR (-O2):
define void @makeanswermove() {
ret void
}
void __clear_cache(char *beginning, char *end) {}


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

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

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

LLVM IR (-O2):
define void @__clear_cache(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRSETTEXTCHAREXTRA_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 1, torev);
}


x86 assembly (clang, -O0):
<U_WMRSETTEXTCHAREXTRA_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1030 <U_WMRCORE_N16_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRSETTEXTCHAREXTRA_swap>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRSETTEXTCHAREXTRA_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 1, i32 %1)
ret void
}
/* Variables and functions */
int strlen(const char *s) {
  const char *save = s + 1;
  while (*s++ != '\0')
    ;
  return (s - save);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1134 <strlen+0x34>
jmp    1114 <strlen+0x14>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %3
br label %6
6: ; preds = %12, %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %2
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %6
br label %6
13: ; preds = %6
%14 = load i8*, i8** %2
%15 = load i8*, i8** %3
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
void bochsbp(void) { __asm__ __volatile__("xchgw %bx, %bx"); }


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

x86 assembly (clang, -O2):
<bochsbp>:
xchg   %bx,%bx
ret

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

LLVM IR (-O2):
define void @bochsbp() {
tail call void asm sideeffect "xchgw %bx, %bx", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_PROF(int /*<<< orphan*/);
int gen_PROF() { handle_PROF(0); }


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

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

LLVM IR (-O0):
define i32 @gen_PROF() {
%1 = alloca i32
%2 = call i32 @handle_PROF(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_PROF() {
%1 = tail call i32 @handle_PROF(i32 0)
ret i32 undef
}
int test_imm_41uint8_mem(unsigned char *val) {
  return ((*val) & (-0x41 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_41uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -65
%7 = icmp ne i32 %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_41uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -65
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int dynamic_flips_per_assignment_per_mille();
int very_high_agility(void) {
  return dynamic_flips_per_assignment_per_mille() >= 250;
}


x86 assembly (clang, -O0):
<very_high_agility>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dynamic_flips_per_assignment_per_mille@plt>
cmp    $0xfa,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<very_high_agility>:
push   %rax
xor    %eax,%eax
call   1030 <dynamic_flips_per_assignment_per_mille@plt>
xor    %ecx,%ecx
cmp    $0xfa,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @very_high_agility() {
%1 = call i32 (...) @dynamic_flips_per_assignment_per_mille()
%2 = icmp sge i32 %1, 250
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @very_high_agility() {
%1 = tail call i32 (...) @dynamic_flips_per_assignment_per_mille()
%2 = icmp sgt i32 %1, 249
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SetCursorPosition(int /*<<< orphan*/, int /*<<< orphan*/);
void clearscreen() { SetCursorPosition(0, 0); }


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

x86 assembly (clang, -O2):
<clearscreen>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <SetCursorPosition@plt>

LLVM IR (-O0):
define void @clearscreen() {
%1 = call i32 @SetCursorPosition(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @clearscreen() {
%1 = tail call i32 @SetCursorPosition(i32 0, i32 0)
ret void
}
void gdk_window_get_update_area() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_get_update_area() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int is_null_or_empty(const char *s) {
  if (!s)
    return 1;
  if (!strlen(s))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_null_or_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <is_null_or_empty+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1158 <is_null_or_empty+0x48>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jne    1151 <is_null_or_empty+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1158 <is_null_or_empty+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_null_or_empty>:
test   %rdi,%rdi
je     1129 <is_null_or_empty+0x19>
push   %rax
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_null_or_empty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ endian_(int *);
int /*<<< orphan*/ swabytes(void **, int, int);
void swap_(void *vp, int *fendian, int *n, int *dsize) {
  int swab, i, nval;
  endian_(&nval);
  swab = *fendian ^ nval;
  if (swab)
    swabytes(&vp, *n, *dsize);
}


x86 assembly (clang, -O0):
<swap_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x2c(%rbp),%rdi
call   1030 <endian_@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
xor    -0x2c(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     116c <swap_+0x4c>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rdi
call   1040 <swabytes@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,0x8(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <endian_@plt>
mov    (%rbx),%eax
cmp    0x4(%rsp),%eax
je     1159 <swap_+0x39>
mov    (%r15),%esi
mov    (%r14),%edx
lea    0x8(%rsp),%rdi
call   1040 <swabytes@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @swap_(i8* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%12 = call i32 @endian_(i32* %11)
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = load i32, i32* %11
%16 = xor i32 %14, %15
store i32 %16, i32* %9
%17 = load i32, i32* %9
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %4
%20 = load i32*, i32** %7
%21 = load i32, i32* %20
%22 = load i32*, i32** %8
%23 = load i32, i32* %22
%24 = call i32 @swabytes(i8** %5, i32 %21, i32 %23)
br label %25
25: ; preds = %19, %4
ret void
}

LLVM IR (-O2):
define void @swap_(i8* %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %5
%7 = bitcast i32* %6 to i8*
%8 = call i32 @endian_(i32* %6)
%9 = load i32, i32* %1
%10 = load i32, i32* %6
%11 = icmp eq i32 %9, %10
br i1 %11, label %16, label %12
12: ; preds = %4
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @swabytes(i8** %5, i32 %13, i32 %14)
br label %16
16: ; preds = %12, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void do_question(char *start, int lineno) {
  if (*start == '\0') {
    printf("Error: invalid line %d\n", lineno);
    exit(1);
  }
  printf("\tif (cliAddQuestion(node, \"%s\")) return RCPERR;\n", start);
  printf("\n");
}


x86 assembly (clang, -O0):
<do_question>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    115a <do_question+0x3a>
mov    -0xc(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_question>:
push   %rax
cmpb   $0x0,(%rdi)
je     1155 <do_question+0x25>
mov    %rdi,%rax
lea    0xed8(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Error: invalid line %d\0A\00"
@.str.1 = [49 x i8] c"\09if (cliAddQuestion(node, \22%s\22)) return RCPERR;\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @do_question(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Error: invalid line %d\0A\00"
@.str.1 = [49 x i8] c"\09if (cliAddQuestion(node, \22%s\22)) return RCPERR;\0A\00"
define void @do_question(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%10 = tail call i32 @putchar(i32 10)
ret void
}
void remove_proc_entry(void) { nsc_assert(0, __func__); }


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

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

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void digitalWrite(int led, int state) {
  FILE *f1;
  f1 = fopen("/sys/class/gpio/gpio29/value", "w");
  fprintf(f1, "%d", state);
  fclose(f1);
}


x86 assembly (clang, -O0):
<digitalWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xebb(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitalWrite>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
lea    0xec4(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xecd(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"/sys/class/gpio/gpio29/value\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"%d\00"
define void @digitalWrite(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32* @fopen(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %4
%9 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %5
%11 = call i32 @fclose(i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"/sys/class/gpio/gpio29/value\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"%d\00"
define void @digitalWrite(i32 %0, i32 %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long mstime() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_sec * 1000 + t.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<mstime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @mstime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @mstime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
int test_imm_BEuint16_mem(unsigned short *val) {
  return ((*val) & (-0xBE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BEuint16_mem>:
movzwl (%rdi),%eax
test   $0xff42,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BEuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -190
%7 = icmp ne i32 %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_BEuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -190
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void i2d_PROXY_CERT_INFO_EXTENSION(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_PROXY_CERT_INFO_EXTENSION() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drv_generic_serial_write(char *, int);
void drv_FW8888_send_cmd(const unsigned int cmd) {
  char cmd_str[2];
  cmd_str[0] = 0x10;
  cmd_str[1] = cmd;
  drv_generic_serial_write(cmd_str, 2);
}


x86 assembly (clang, -O0):
<drv_FW8888_send_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x10,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rdi
mov    $0x2,%esi
call   1030 <drv_generic_serial_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_FW8888_send_cmd>:
push   %rax
movb   $0x10,0x6(%rsp)
mov    %dil,0x7(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <drv_generic_serial_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @drv_FW8888_send_cmd(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 16, i8* %4
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %6, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%9 = call i32 @drv_generic_serial_write(i8* %8, i32 2)
ret void
}

LLVM IR (-O2):
define void @drv_FW8888_send_cmd(i32 %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 16, i8* %3
%4 = trunc i32 %0 to i8
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 %4, i8* %5
%6 = call i32 @drv_generic_serial_write(i8* %3, i32 2)
ret void
}
void gdk_error_trap_push() {}


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

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

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

LLVM IR (-O2):
define void @gdk_error_trap_push() {
ret void
}
void _iswritepg(fd, buf) int fd;
char *buf;
{
  if (write(fd, buf, 1024) != 1024)
    _isfatal_error("write failed");
}


x86 assembly (clang, -O0):
<_iswritepg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x400,%edx
mov    $0x0,%al
call   1040 <write@plt>
cmp    $0x400,%eax
je     115b <_iswritepg+0x3b>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <_isfatal_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_iswritepg>:
push   %rax
mov    $0x400,%edx
xor    %eax,%eax
call   1040 <write@plt>
cmp    $0x400,%eax
jne    1136 <_iswritepg+0x16>
pop    %rax
ret
lea    0xec3(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <_isfatal_error@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"write failed\00"
define void @_iswritepg(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %5, i8* %6, i32 1024)
%8 = icmp ne i32 %7, 1024
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @_isfatal_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"write failed\00"
define void @_iswritepg(i32 %0, i8* %1) {
%3 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %1, i32 1024)
%4 = icmp eq i32 %3, 1024
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @_isfatal_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ aio_context_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_io_setup;
int syscall(int /*<<< orphan*/, unsigned int, int /*<<< orphan*/ *);
int io_setup(unsigned nr, aio_context_t *ctxp) {
  return syscall(__NR_io_setup, nr, ctxp);
}


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

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

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

LLVM IR (-O2):
@__NR_io_setup = global i32 0
define i32 @io_setup(i32 %0, i32* %1) {
%3 = load i32, i32* @__NR_io_setup
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32* %1)
ret i32 %4
}
/* Type definitions */
struct CmpOri {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cmp_ori_deinit(struct CmpOri *);
int /*<<< orphan*/ free_or_die(struct CmpOri *);
void cmp_ori_free(struct CmpOri *cmp_ori) {
  cmp_ori_deinit(cmp_ori);
  free_or_die(cmp_ori);
}


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

x86 assembly (clang, -O2):
<cmp_ori_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <cmp_ori_deinit@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free_or_die@plt>

LLVM IR (-O0):
%struct.CmpOri = type { i32 }
define void @cmp_ori_free(%struct.CmpOri* %0) {
%2 = alloca %struct.CmpOri*
store %struct.CmpOri* %0, %struct.CmpOri** %2
%3 = load %struct.CmpOri*, %struct.CmpOri** %2
%4 = call i32 @cmp_ori_deinit(%struct.CmpOri* %3)
%5 = load %struct.CmpOri*, %struct.CmpOri** %2
%6 = call i32 @free_or_die(%struct.CmpOri* %5)
ret void
}

LLVM IR (-O2):
%struct.CmpOri = type { i32 }
define void @cmp_ori_free(%struct.CmpOri* %0) {
%2 = tail call i32 @cmp_ori_deinit(%struct.CmpOri* %0)
%3 = tail call i32 @free_or_die(%struct.CmpOri* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printn(int);
void main() {
  int i;
  for (i = -3; i < 4; i++)
    if (!i)
      printn(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xfffffffd,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    114e <main+0x3e>
cmpl   $0x0,-0x4(%rbp)
jne    113b <main+0x2b>
mov    -0x4(%rbp),%edi
call   1030 <printn@plt>
jmp    1140 <main+0x30>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @printn(i32 0)
ret void
}
void none_init(int width, int height, int levels) {}


x86 assembly (clang, -O0):
<none_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @none_init(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
ret void
}

LLVM IR (-O2):
define void @none_init(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *us) {
  fprintf(stderr,
          "Usage: %s [-env <var> <value>] [-out <file>] [-pid <file>] "
          "<program> <args...>\n",
          us);
  return 1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [80 x i8] c"Usage: %s [-env <var> <value>] [-out <file>] [-pid <file>] <program> <args...>\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [80 x i8] c"Usage: %s [-env <var> <value>] [-out <file>] [-pid <file>] <program> <args...>\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
int fun917() { return 917; }


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

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

LLVM IR (-O0):
define i32 @fun917() {
ret i32 917
}

LLVM IR (-O2):
define i32 @fun917() {
ret i32 917
}
int never_called(int i) {
  if (i) {
  }
  for (i = 0; i < 100; ++i) {
  }
  while (--i) {
  }
  do {
  } while (i++ < 75);
  switch (i) {
  case 12:
    return 3;
  case 82:
    return 0;
  default:
    return 89;
  }
}


x86 assembly (clang, -O0):
<never_called>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1116 <never_called+0x16>
jmp    1116 <never_called+0x16>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    113a <never_called+0x3a>
jmp    112c <never_called+0x2c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111d <never_called+0x1d>
jmp    113f <never_called+0x3f>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1156 <never_called+0x56>
jmp    113f <never_called+0x3f>
jmp    115b <never_called+0x5b>
jmp    1160 <never_called+0x60>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x4b,%eax
jl     115b <never_called+0x5b>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xc,%eax
je     1199 <never_called+0x99>
jmp    1188 <never_called+0x88>
mov    -0xc(%rbp),%eax
sub    $0x52,%eax
je     11a5 <never_called+0xa5>
jmp    11b1 <never_called+0xb1>
movl   $0x3,-0x4(%rbp)
jmp    11b8 <never_called+0xb8>
movl   $0x0,-0x4(%rbp)
jmp    11b8 <never_called+0xb8>
movl   $0x59,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @never_called(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %1
store i32 0, i32* %3
br label %8
8: ; preds = %12, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 100
br i1 %10, label %11, label %15
11: ; preds = %8
br label %12
12: ; preds = %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %8
15: ; preds = %8
br label %16
16: ; preds = %20, %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16
br label %16
21: ; preds = %16
br label %22
22: ; preds = %23, %21
br label %23
23: ; preds = %22
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
%26 = icmp slt i32 %24, 75
br i1 %26, label %22, label %27
27: ; preds = %23
%28 = load i32, i32* %3
switch i32 %28, label %31 [
i32 12, label %29
i32 82, label %30
]
29: ; preds = %27
store i32 3, i32* %2
br label %32
30: ; preds = %27
store i32 0, i32* %2
br label %32
31: ; preds = %27
store i32 89, i32* %2
br label %32
32: ; preds = %31, %30, %29
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @never_called(i32 %0) {
ret i32 89
}
/* Variables and functions */
int /*<<< orphan*/ nes6502_nmi();
void nes_nmi(void) { nes6502_nmi(); }


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

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

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

LLVM IR (-O2):
define void @nes_nmi() {
%1 = tail call i32 (...) @nes6502_nmi()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *exti_get_RTSR() { return mem_get_reg32(0x40010400 + 0x8); }


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

x86 assembly (clang, -O2):
<exti_get_RTSR>:
mov    $0x40010408,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @exti_get_RTSR() {
%1 = call i32* @mem_get_reg32(i32 1073808392)
ret i32* %1
}

LLVM IR (-O2):
define i32* @exti_get_RTSR() {
%1 = tail call i32* @mem_get_reg32(i32 1073808392)
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ parse_version(char *);
void call_parse() { parse_version("fubar"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"fubar\00"
define void @call_parse() {
%1 = tail call i32 @parse_version(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x47() {
  Assert_real((ispunct(71) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              360, ("ispunct should be 0 for G"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x47>:
push   %rbp
mov    %rsp,%rbp
mov    $0x47,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x168,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x47>:
push   %rax
mov    $0x47,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x168,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for G\00"
define void @t_ispunct_0x47() {
%1 = call i64 @ispunct(i32 71)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 360, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for G\00"
define void @t_ispunct_0x47() {
%1 = tail call i64 @ispunct(i32 71)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 360, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
unsigned char CheckId_PO3030K(void) {
  unsigned char temp1, temp2;
  VIM_SIF_I2cReadByte(0x00, &temp1);
  VIM_SIF_I2cReadByte(0x01, &temp2);
  if (temp1 == 0x30 && temp2 == 0x30)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<CheckId_PO3030K>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    $0x1,%edi
lea    -0x3(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jne    1154 <CheckId_PO3030K+0x44>
movzbl -0x3(%rbp),%eax
cmp    $0x30,%eax
jne    1154 <CheckId_PO3030K+0x44>
movb   $0x1,-0x1(%rbp)
jmp    1158 <CheckId_PO3030K+0x48>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckId_PO3030K>:
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
lea    0x6(%rsp),%rsi
mov    $0x1,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    0x7(%rsp),%al
xor    $0x30,%al
mov    0x6(%rsp),%cl
xor    $0x30,%cl
or     %al,%cl
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @CheckId_PO3030K() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = call i32 @VIM_SIF_I2cReadByte(i32 0, i8* %2)
%5 = call i32 @VIM_SIF_I2cReadByte(i32 1, i8* %3)
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 48
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %11, 48
br i1 %12, label %13, label %14
13: ; preds = %9
store i8 1, i8* %1
br label %15
14: ; preds = %9, %0
store i8 0, i8* %1
br label %15
15: ; preds = %14, %13
%16 = load i8, i8* %1
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @CheckId_PO3030K() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 0, i8* %1)
%4 = call i32 @VIM_SIF_I2cReadByte(i32 1, i8* %2)
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 48
%7 = load i8, i8* %2
%8 = icmp eq i8 %7, 48
%9 = select i1 %6, i1 %8, i1 false
%10 = zext i1 %9 to i8
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: flash save|load [dest]|erase|upgrade\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: flash save|load [dest]|erase|upgrade\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: flash save|load [dest]|erase|upgrade\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int i2c_read_byte(int pi, unsigned handle) {
  return pigpio_command(pi, 59, handle, 0, 1);
}


x86 assembly (clang, -O0):
<i2c_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x3b,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_read_byte>:
mov    %esi,%edx
mov    $0x3b,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @i2c_read_byte(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 = load i32, i32* %4
%7 = call i32 @pigpio_command(i32 %5, i32 59, i32 %6, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @i2c_read_byte(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 59, i32 %1, i32 0, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ displayRawData();
int /*<<< orphan*/ frameFilename(char *, int);
int /*<<< orphan*/ loadRawData(char *, char *);
void displayVideoFrame(int i, char *dirname) {
  char filename[] = "00000.DAT";
  frameFilename(filename, i);
  loadRawData(filename, dirname);
  displayRawData();
}


x86 assembly (clang, -O0):
<displayVideoFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <frameFilename@plt>
lea    -0x1a(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <loadRawData@plt>
mov    $0x0,%al
call   1050 <displayRawData@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayVideoFrame>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%esi
movabs $0x41442e3030303030,%rax
2e 44 41
mov    %rax,0x8(%rsp)
movw   $0x54,0x10(%rsp)
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1030 <frameFilename@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <loadRawData@plt>
xor    %eax,%eax
call   1050 <displayRawData@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.displayVideoFrame.filename = [10 x i8] c"00000.DAT\00"
define void @displayVideoFrame(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [10 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = bitcast [10 x i8]* %5 to i8*
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @frameFilename(i8* %7, i32 %8)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @loadRawData(i8* %10, i8* %11)
%13 = call i32 (...) @displayRawData()
ret void
}

LLVM IR (-O2):
@__const.displayVideoFrame.filename = [10 x i8] c"00000.DAT\00"
define void @displayVideoFrame(i32 %0, i8* %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @frameFilename(i8* %4, i32 %0)
%6 = call i32 @loadRawData(i8* %4, i8* %1)
%7 = call i32 (...) @displayRawData()
ret void
}