xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ C64Keyboard_init();
int /*<<< orphan*/ init_stdlibtools();
int /*<<< orphan*/ mainLoop();
int /*<<< orphan*/ mos6510_init();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setupScreen(int, int, int);
int /*<<< orphan*/ vic6569_init();
int vicmain(void) {
  setupScreen(640, 480, 16);
  init_stdlibtools();
  printf("* Pi64 *");
  vic6569_init();
  mos6510_init();
  C64Keyboard_init();
  mainLoop();
  return 1;
}


x86 assembly (clang, -O0):
<vicmain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x280,%edi
mov    $0x1e0,%esi
mov    $0x10,%edx
call   1060 <setupScreen@plt>
mov    $0x0,%al
call   1050 <init_stdlibtools@plt>
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <vic6569_init@plt>
mov    $0x0,%al
call   1080 <mos6510_init@plt>
mov    $0x0,%al
call   1030 <C64Keyboard_init@plt>
mov    $0x0,%al
call   1090 <mainLoop@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vicmain>:
push   %rax
mov    $0x280,%edi
mov    $0x1e0,%esi
mov    $0x10,%edx
call   1060 <setupScreen@plt>
xor    %eax,%eax
call   1050 <init_stdlibtools@plt>
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <vic6569_init@plt>
xor    %eax,%eax
call   1080 <mos6510_init@plt>
xor    %eax,%eax
call   1030 <C64Keyboard_init@plt>
xor    %eax,%eax
call   1090 <mainLoop@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"* Pi64 *\00"
define i32 @vicmain() {
%1 = call i32 @setupScreen(i32 640, i32 480, i32 16)
%2 = call i32 (...) @init_stdlibtools()
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @vic6569_init()
%5 = call i32 (...) @mos6510_init()
%6 = call i32 (...) @C64Keyboard_init()
%7 = call i32 (...) @mainLoop()
ret i32 1
}

LLVM IR (-O2):
@.str = [9 x i8] c"* Pi64 *\00"
define i32 @vicmain() {
%1 = tail call i32 @setupScreen(i32 640, i32 480, i32 16)
%2 = tail call i32 (...) @init_stdlibtools()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @vic6569_init()
%5 = tail call i32 (...) @mos6510_init()
%6 = tail call i32 (...) @C64Keyboard_init()
%7 = tail call i32 (...) @mainLoop()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ intrflush(int /*<<< orphan*/, int);
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
void initial() {
  initscr();
  cbreak();
  nonl();
  noecho();
  intrflush(stdscr, false);
  keypad(stdscr, true);
  refresh();
}


x86 assembly (clang, -O0):
<initial>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1070 <nonl@plt>
mov    $0x0,%al
call   1090 <noecho@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1060 <intrflush@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <keypad@plt>
mov    $0x0,%al
call   1080 <refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initial>:
push   %rbx
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1070 <nonl@plt>
xor    %eax,%eax
call   1090 <noecho@plt>
mov    0x2e54(%rip),%rbx
mov    (%rbx),%edi
xor    %esi,%esi
call   1060 <intrflush@plt>
mov    (%rbx),%edi
mov    $0x1,%esi
call   1040 <keypad@plt>
xor    %eax,%eax
pop    %rbx
jmp    1080 <refresh@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @initial() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = call i32 (...) @nonl()
%4 = call i32 (...) @noecho()
%5 = load i32, i32* @stdscr
%6 = call i32 @intrflush(i32 %5, i32 0)
%7 = load i32, i32* @stdscr
%8 = call i32 @keypad(i32 %7, i32 1)
%9 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @initial() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @nonl()
%4 = tail call i32 (...) @noecho()
%5 = load i32, i32* @stdscr
%6 = tail call i32 @intrflush(i32 %5, i32 0)
%7 = load i32, i32* @stdscr
%8 = tail call i32 @keypad(i32 %7, i32 1)
%9 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_varid(char const *);
int /*<<< orphan*/ write_instr(int);
int /*<<< orphan*/ write_varid(int /*<<< orphan*/);
void incVar(const char *name) {
  write_instr(0x04);
  write_varid(get_varid(name));
}


x86 assembly (clang, -O0):
<incVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1050 <write_instr@plt>
mov    -0x8(%rbp),%rdi
call   1040 <get_varid@plt>
mov    %eax,%edi
call   1030 <write_varid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incVar>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1050 <write_instr@plt>
mov    %rbx,%rdi
call   1040 <get_varid@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <write_varid@plt>

LLVM IR (-O0):
define void @incVar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @write_instr(i32 4)
%4 = load i8*, i8** %2
%5 = call i32 @get_varid(i8* %4)
%6 = call i32 @write_varid(i32 %5)
ret void
}

LLVM IR (-O2):
define void @incVar(i8* %0) {
%2 = tail call i32 @write_instr(i32 4)
%3 = tail call i32 @get_varid(i8* %0)
%4 = tail call i32 @write_varid(i32 %3)
ret void
}
int atoi(char *s) {
  int res = 0;
  while (('0' <= *s) && (*s <= '9')) {
    res = res * 10 + (*s - '0');
    s++;
  }
  return res;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0xd(%rbp)
jg     1138 <atoi+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1148 <atoi+0x48>
jmp    116c <atoi+0x6c>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <atoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %12, %5 ], [ 0, %1 ]
%8 = phi i8* [ %13, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ skip_space(char **);
int read_separator(char **str) {
  int ok = 0;
  char c;
  skip_space(str);
  c = **str;
  if (c == ',') {
    ++(*str);
    ok = 1;
  }
  skip_space(str);
  return ok;
}


x86 assembly (clang, -O0):
<read_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <skip_space@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0x2c,%eax
jne    115a <read_separator+0x4a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <skip_space@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_separator>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <skip_space@plt>
mov    (%rbx),%rax
xor    %ebp,%ebp
cmpb   $0x2c,(%rax)
jne    1131 <read_separator+0x21>
add    $0x1,%rax
mov    %rax,(%rbx)
mov    $0x1,%ebp
mov    %rbx,%rdi
call   1030 <skip_space@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @read_separator(i8** %0) {
%2 = tail call i32 @skip_space(i8** %0)
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 44
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %7, i8** %0
br label %8
8: ; preds = %6, %1
%9 = phi i32 [ 1, %6 ], [ 0, %1 ]
%10 = tail call i32 @skip_space(i8** %0)
ret i32 %9
}
unsigned short complementBit_fun_ushort(unsigned short x, unsigned i) {
  return x ^ 1 << i;
}


x86 assembly (clang, -O0):
<complementBit_fun_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complementBit_fun_ushort>:
mov    %edi,%eax
btc    %esi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @complementBit_fun_ushort(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = xor i32 %6, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @complementBit_fun_ushort(i16 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i16
%5 = xor i16 %4, %0
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int x = 36 / 6 * 6;
  printf("%d\n", x);
}


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

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

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

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


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

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

LLVM IR (-O0):
define i32 @XSetGraphicsExposures() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetGraphicsExposures() {
ret i32 undef
}
void ff_hevc_put_hevc_pel_pixels48_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels48_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printer(int, int, int, int, int, int, int, int, int, int,
                           int /*<<< orphan*/);
int main() {
  printer(10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
xor    %eax,%eax
movl   $0x6,(%rsp)
movl   $0x7,0x8(%rsp)
movl   $0x8,0x10(%rsp)
movl   $0x9,0x18(%rsp)
movl   $0x0,0x20(%rsp)
call   1030 <printer@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
mov    $0xa,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
push   $0x0
push   $0x9
push   $0x8
push   $0x7
push   $0x6
call   1030 <printer@plt>
add    $0x30,%rsp
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printer(i32 10, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 0)
ret i32 0
}
int utfle_length(unsigned char *input, int length) {
  int result = 0;
  int i;
  for (i = 0; i < length; i++) {
    result++;
    if (input[i] >= 0x80) {
      i++;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<utfle_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <utfle_length+0x61>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x80,%eax
jl     114e <utfle_length+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <utfle_length+0x53>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <utfle_length+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utfle_length>:
test   %esi,%esi
jle    1127 <utfle_length+0x27>
xor    %ecx,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
movslq %ecx,%rcx
movzbl (%rdi,%rcx,1),%edx
shr    $0x7,%edx
add    %edx,%ecx
add    $0x1,%ecx
cmp    %esi,%ecx
jl     1110 <utfle_length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @utfle_length(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2, %4
%5 = phi i32 [ %14, %4 ], [ 0, %2 ]
%6 = phi i32 [ %7, %4 ], [ 0, %2 ]
%7 = add nuw nsw i32 %6, 1
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = lshr i8 %10, 7
%12 = zext i8 %11 to i32
%13 = add nsw i32 %5, 1
%14 = add i32 %13, %12
%15 = icmp slt i32 %14, %1
br i1 %15, label %4, label %16
16: ; preds = %4, %2
%17 = phi i32 [ 0, %2 ], [ %7, %4 ]
ret i32 %17
}
int f1(unsigned x) { return x - 1 <= 0x7fffffff - 1; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cmp    $0x7ffffffe,%eax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 1
%5 = icmp ule i32 %4, 2147483646
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t clock_us(void) {
  struct timeval time;
  gettimeofday(&time, NULL);
  return (time.tv_sec * 1000 * 1000) + time.tv_usec;
}


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

x86 assembly (clang, -O2):
<clock_us>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%eax
cltq
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @clock_us() {
%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 = mul nsw i32 %5, 1000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @clock_us() {
%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 i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}
unsigned char GetPort(unsigned short addr) { return 0xAA; }


x86 assembly (clang, -O0):
<GetPort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xaa,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPort>:
mov    $0xaa,%al
ret

LLVM IR (-O0):
define zeroext i8 @GetPort(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
ret i8 -86
}

LLVM IR (-O2):
define zeroext i8 @GetPort(i16 zeroext %0) {
ret i8 -86
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int euclid_pythagorean_triple_perim(int, int);
void euclid_pythagorean_triple_perim_test(void) {
  assert(euclid_pythagorean_triple_perim(9, 6) == 0);
  assert(euclid_pythagorean_triple_perim(9, 7) == 0);
  assert(euclid_pythagorean_triple_perim(2, 1) == 12);
}


x86 assembly (clang, -O0):
<euclid_pythagorean_triple_perim_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
mov    $0x6,%esi
call   1040 <euclid_pythagorean_triple_perim@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x9,%edi
mov    $0x7,%esi
call   1040 <euclid_pythagorean_triple_perim@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <euclid_pythagorean_triple_perim@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclid_pythagorean_triple_perim_test>:
push   %rax
mov    $0x9,%edi
mov    $0x6,%esi
call   1040 <euclid_pythagorean_triple_perim@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x9,%edi
mov    $0x7,%esi
call   1040 <euclid_pythagorean_triple_perim@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <euclid_pythagorean_triple_perim@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @euclid_pythagorean_triple_perim_test() {
%1 = call i32 @euclid_pythagorean_triple_perim(i32 9, i32 6)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @euclid_pythagorean_triple_perim(i32 9, i32 7)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @euclid_pythagorean_triple_perim(i32 2, i32 1)
%10 = icmp eq i32 %9, 12
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
define void @euclid_pythagorean_triple_perim_test() {
%1 = tail call i32 @euclid_pythagorean_triple_perim(i32 9, i32 6)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @euclid_pythagorean_triple_perim(i32 9, i32 7)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @euclid_pythagorean_triple_perim(i32 2, i32 1)
%10 = icmp eq i32 %9, 12
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
void delay(int n) {
  n = 10000 * n;
  for (; n > 0; n--) {
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x2710,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112e <delay+0x2e>
jmp    1120 <delay+0x20>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <delay+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
long long longlong_ignoring_unsignedshortint(long long x,
                                             unsigned short int y) {
  return x;
}


x86 assembly (clang, -O0):
<longlong_ignoring_unsignedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longlong_ignoring_unsignedshortint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @longlong_ignoring_unsignedshortint(i64 %0, i16 zeroext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlong_ignoring_unsignedshortint(i64 returned %0, i16 zeroext %1) {
ret i64 %0
}
int x_socket(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @x_socket() {
ret i32 0
}
char *Hello() { return "Hello"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define i8* @Hello() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i8* @Hello() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
__attribute__((visibility("hidden"))) void
set_pause(struct wait_event *wait_event) {}


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

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

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

LLVM IR (-O2):
%struct.wait_event = type opaque
define hidden void @set_pause(%struct.wait_event* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void bar() {
  int j = 0;
  foo();
  int k = 0;
}


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

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

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

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint16_t biop_uint16(uint8_t byte_order, uint16_t raw) {
  uint8_t *p = (uint8_t *)&raw;
  uint16_t val;
  if (byte_order == 0)
    val = (p[0] << 8) + p[1];
  else
    val = (p[1] << 8) + p[0];
  return val;
}


x86 assembly (clang, -O0):
<biop_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113b <biop_uint16+0x3b>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%rax
mov    -0x18(%rbp),%rcx
add    0x8(%rcx),%rax
mov    %rax,-0x20(%rbp)
jmp    1152 <biop_uint16+0x52>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x8,%rax
mov    -0x18(%rbp),%rcx
add    (%rcx),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @biop_uint16(i64 %0, i64 %1) {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ htv_disable(int /*<<< orphan*/, int);
int plan_cap_stop_channel_0(void *data) {
  htv_disable(0, 1);
  return 0;
}


x86 assembly (clang, -O0):
<plan_cap_stop_channel_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <htv_disable@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plan_cap_stop_channel_0>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <htv_disable@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @plan_cap_stop_channel_0(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @htv_disable(i32 0, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @plan_cap_stop_channel_0(i8* nocapture readnone %0) {
%2 = tail call i32 @htv_disable(i32 0, i32 1)
ret i32 0
}
float self_shadow(float x) { return (x > 0.0) ? 1.0 : 0.0; }


x86 assembly (clang, -O0):
<self_shadow>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm3
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
cmpltsd %xmm1,%xmm0
movaps %xmm0,%xmm1
andpd  %xmm3,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<self_shadow>:
xorps  %xmm1,%xmm1
cmpltss %xmm0,%xmm1
movss  0xef0(%rip),%xmm0
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @self_shadow(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp ogt double %4, 0.000000e+00
%6 = zext i1 %5 to i64
%7 = select i1 %5, double 1.000000e+00, double 0.000000e+00
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @self_shadow(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = select i1 %2, float 1.000000e+00, float 0.000000e+00
ret float %3
}
void ext2fs_fast_set_bit(unsigned int nr, void *addr) {
  unsigned char *ADDR = (unsigned char *)addr;
  ADDR += nr >> 3;
  *ADDR |= (unsigned char)(1 << (nr & 0x07));
}


x86 assembly (clang, -O0):
<ext2fs_fast_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movzbl %al,%edx
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2fs_fast_set_bit>:
mov    %edi,%ecx
mov    %edi,%eax
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
shr    $0x3,%rax
or     %dl,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @ext2fs_fast_set_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
%7 = load i32, i32* %3
%8 = lshr i32 %7, 3
%9 = load i8*, i8** %5
%10 = zext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %5
%12 = load i32, i32* %3
%13 = and i32 %12, 7
%14 = shl i32 1, %13
%15 = trunc i32 %14 to i8
%16 = zext i8 %15 to i32
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = or i32 %19, %16
%21 = trunc i32 %20 to i8
store i8 %21, i8* %17
ret void
}

LLVM IR (-O2):
define void @ext2fs_fast_set_bit(i32 %0, i8* nocapture %1) {
%3 = lshr i32 %0, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = and i32 %0, 7
%7 = shl nuw nsw i32 1, %6
%8 = load i8, i8* %5
%9 = trunc i32 %7 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int data_array[] = {0, 1, 2};
  printf("%d %d %d\n", data_array[0], data_array[1], data_array[2]);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 2)
ret i32 0
}
/* Variables and functions */
int psw_read_bit(int);
int psw_read_cy(void) { return psw_read_bit(7); }


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

x86 assembly (clang, -O2):
<psw_read_cy>:
mov    $0x7,%edi
jmp    1030 <psw_read_bit@plt>

LLVM IR (-O0):
define i32 @psw_read_cy() {
%1 = call i32 @psw_read_bit(i32 7)
ret i32 %1
}

LLVM IR (-O2):
define i32 @psw_read_cy() {
%1 = tail call i32 @psw_read_bit(i32 7)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reccursive_sum_till_0(int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, sum = 0;
  scanf("%d", &num);
  printf("\n");
  reccursive_sum_till_0(num, sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <reccursive_sum_till_0@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%edi
xor    %esi,%esi
call   1050 <reccursive_sum_till_0@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @putchar(i32 10)
%5 = load i32, i32* %1
%6 = call i32 @reccursive_sum_till_0(i32 %5, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("CIM\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"CIM\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 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"CIM\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double binSearch(int, int /*<<< orphan*/, int);
double sqrt_b(int n) {
  if (n <= 0) {
    return 0;
  } else {
    return binSearch(n, 0, n);
  }
}


x86 assembly (clang, -O0):
<sqrt_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1132 <sqrt_b+0x22>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1144 <sqrt_b+0x34>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <binSearch@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_b>:
test   %edi,%edi
jle    111d <sqrt_b+0xd>
xor    %esi,%esi
mov    %edi,%edx
jmp    1030 <binSearch@plt>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @sqrt_b(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = call double @binSearch(i32 %8, i32 0, i32 %9)
store double %10, double* %2
br label %11
11: ; preds = %7, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @sqrt_b(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @binSearch(i32 %0, i32 0, i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ 0.000000e+00, %1 ]
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_QuaternionToMat4_init(void) {
  _hmt_register_covercase("HMM_QuaternionToMat4", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_QuaternionToMat4_init>:
lea    0xee9(%rip),%rdi
lea    0xef7(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"HMM_QuaternionToMat4\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_QuaternionToMat4_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"HMM_QuaternionToMat4\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_QuaternionToMat4_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ al_string_cat(char *, char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *);
void al_ansi_escape_reset(char *dest, int maxlen) {
  char buf[48] = {0};
  snprintf(buf, 48, "\\[\\e[0m\\]");
  al_string_cat(dest, buf, maxlen);
}


x86 assembly (clang, -O0):
<al_ansi_escape_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
lea    -0x40(%rbp),%rdi
mov    $0x30,%esi
lea    0xea1(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <al_string_cat@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<al_ansi_escape_reset>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xebb(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x30,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <al_string_cat@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\\[\\e[0m\\]\00"
define void @al_ansi_escape_reset(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [48 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast [48 x i8]* %5 to i8*
%7 = getelementptr inbounds [48 x i8], [48 x i8]* %5, i64 0, i64 0
%8 = call i32 @snprintf(i8* %7, i32 48, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [48 x i8], [48 x i8]* %5, i64 0, i64 0
%11 = load i32, i32* %4
%12 = call i32 @al_string_cat(i8* %9, i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\\[\\e[0m\\]\00"
define void @al_ansi_escape_reset(i8* %0, i32 %1) {
%3 = alloca [48 x i8]
%4 = getelementptr inbounds [48 x i8], [48 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 48, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @al_string_cat(i8* %0, i8* %4, i32 %1)
ret void
}
int get1c(fd)
int fd;
{
  char c;
  if (read(fd, &c, 1) == 1)
    return (unsigned char)c;
  return -1;
}


x86 assembly (clang, -O0):
<get1c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <read@plt>
cmp    $0x1,%eax
jne    1143 <get1c+0x33>
movzbl -0x9(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <get1c+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get1c>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <read@plt>
cmp    $0x1,%eax
movzbl 0x7(%rsp),%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get1c(i32 %0) {
%2 = alloca i8
%3 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 -1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
float stdlib_strided_snanvariancepn(int /*<<< orphan*/ const, float const,
                                    float const *, int /*<<< orphan*/ const);
float stdlib_strided_snanvariance(const int64_t N, const float correction,
                                  const float *X, const int64_t stride) {
  return stdlib_strided_snanvariancepn(N, correction, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_snanvariance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <stdlib_strided_snanvariancepn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_snanvariance>:
jmp    1030 <stdlib_strided_snanvariancepn@plt>

LLVM IR (-O0):
define float @stdlib_strided_snanvariance(i32 %0, float %1, float* %2, i32 %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float*
%8 = alloca i32
store i32 %0, i32* %5
store float %1, float* %6
store float* %2, float** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load float, float* %6
%11 = load float*, float** %7
%12 = load i32, i32* %8
%13 = call float @stdlib_strided_snanvariancepn(i32 %9, float %10, float* %11, i32 %12)
ret float %13
}

LLVM IR (-O2):
define float @stdlib_strided_snanvariance(i32 %0, float %1, float* %2, i32 %3) {
%5 = tail call float @stdlib_strided_snanvariancepn(i32 %0, float %1, float* %2, i32 %3)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgldsb(int n) { lgen("%s\tal,%c%d", "mov", n); }


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

x86 assembly (clang, -O2):
<cgldsb>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <lgen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09al,%c%d\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgldsb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09al,%c%d\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgldsb(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void _int_callback() {}


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

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

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

LLVM IR (-O2):
define void @_int_callback() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int resolve(int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  scanf(" %d %d %d", &a, &b, &c);
  printf("%c\n", resolve(a, b, c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <resolve@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1040 <resolve@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c" %d %d %d\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @resolve(i32 %8, i32 %9, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}