xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_7713() {
  Assert_real((isqrt(7713) == 87),
              "/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/stdlib/isqrt.c",
              1435, ("Integer square root of 7713 should be 87"));
}


x86 assembly (clang, -O0):
<t_sqrt_7713>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e21,%edi
call   1030 <isqrt@plt>
cmp    $0x57,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x59b,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_7713>:
push   %rax
mov    $0x1e21,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x57,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x59b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 7713 should be 87\00"
define void @t_sqrt_7713() {
%1 = call i32 @isqrt(i32 7713)
%2 = icmp eq i32 %1, 87
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1435, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 7713 should be 87\00"
define void @t_sqrt_7713() {
%1 = tail call i32 @isqrt(i32 7713)
%2 = icmp eq i32 %1, 87
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1435, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hello();
void test() { hello(); }


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

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

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

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @hello()
ret void
}
void reverse_string(char *c, int from, int to) {
  while (from < to) {
    char temp = c[from];
    c[from++] = c[to];
    c[to--] = temp;
  }
}


x86 assembly (clang, -O0):
<reverse_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1165 <reverse_string+0x65>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0xc(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0xffffffff,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    110e <reverse_string+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_string>:
cmp    %edx,%esi
jge    1131 <reverse_string+0x31>
movslq %esi,%rax
movslq %edx,%rcx
add    $0x1,%rax
xchg   %ax,%ax
movzbl -0x1(%rdi,%rax,1),%esi
movzbl (%rdi,%rcx,1),%edx
mov    %dl,-0x1(%rdi,%rax,1)
mov    %sil,(%rdi,%rcx,1)
add    $0xffffffffffffffff,%rcx
lea    0x1(%rax),%rdx
cmp    %rcx,%rax
mov    %rdx,%rax
jl     1110 <reverse_string+0x10>
ret

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

LLVM IR (-O2):
define void @reverse_string(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %16, %8 ]
%10 = phi i64 [ %6, %5 ], [ %15, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %9
%14 = load i8, i8* %13
%15 = add nsw i64 %10, 1
store i8 %14, i8* %11
%16 = add nsw i64 %9, -1
store i8 %12, i8* %13
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GLUT_HAS_OVERLAY;
int /*<<< orphan*/ GLUT_NORMAL;
int /*<<< orphan*/ GLUT_OVERLAY;
scalar_t__ glutLayerGet(int /*<<< orphan*/);
int /*<<< orphan*/ glutUseLayer(int /*<<< orphan*/);
int /*<<< orphan*/ render_normal();
int /*<<< orphan*/ render_overlay();
void render(void) {
  glutUseLayer(GLUT_NORMAL);
  render_normal();
  if (glutLayerGet(GLUT_HAS_OVERLAY)) {
    glutUseLayer(GLUT_OVERLAY);
    render_overlay();
  }
}


x86 assembly (clang, -O0):
<render>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1060 <glutUseLayer@plt>
mov    $0x0,%al
call   1030 <render_normal@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <glutLayerGet@plt>
cmp    $0x0,%rax
je     1186 <render+0x46>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1060 <glutUseLayer@plt>
mov    $0x0,%al
call   1040 <render_overlay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<render>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1060 <glutUseLayer@plt>
xor    %eax,%eax
call   1030 <render_normal@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <glutLayerGet@plt>
test   %rax,%rax
je     117f <render+0x3f>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1060 <glutUseLayer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <render_overlay@plt>
pop    %rax
ret

LLVM IR (-O0):
@GLUT_NORMAL = global i32 0
@GLUT_HAS_OVERLAY = global i32 0
@GLUT_OVERLAY = global i32 0
define void @render() {
%1 = load i32, i32* @GLUT_NORMAL
%2 = call i32 @glutUseLayer(i32 %1)
%3 = call i32 (...) @render_normal()
%4 = load i32, i32* @GLUT_HAS_OVERLAY
%5 = call i64 @glutLayerGet(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* @GLUT_OVERLAY
%9 = call i32 @glutUseLayer(i32 %8)
%10 = call i32 (...) @render_overlay()
br label %11
11: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@GLUT_NORMAL = global i32 0
@GLUT_HAS_OVERLAY = global i32 0
@GLUT_OVERLAY = global i32 0
define void @render() {
%1 = load i32, i32* @GLUT_NORMAL
%2 = tail call i32 @glutUseLayer(i32 %1)
%3 = tail call i32 (...) @render_normal()
%4 = load i32, i32* @GLUT_HAS_OVERLAY
%5 = tail call i64 @glutLayerGet(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = load i32, i32* @GLUT_OVERLAY
%9 = tail call i32 @glutUseLayer(i32 %8)
%10 = tail call i32 (...) @render_overlay()
br label %11
11: ; preds = %7, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displayBits(unsigned int);
unsigned packCharacters(char c1, char c2) {
  unsigned pack;
  pack = c1;
  pack <<= 8;
  pack |= c2;
  displayBits(pack);
  return pack;
}


x86 assembly (clang, -O0):
<packCharacters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <displayBits@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packCharacters>:
push   %rbx
mov    %edi,%ebx
shl    $0x8,%ebx
or     %esi,%ebx
mov    %ebx,%edi
call   1030 <displayBits@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @packCharacters(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = shl i32 %8, 8
store i32 %9, i32* %5
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = load i32, i32* %5
%13 = or i32 %12, %11
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = call i32 @displayBits(i32 %14)
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @packCharacters(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = shl nsw i32 %3, 8
%5 = sext i8 %1 to i32
%6 = or i32 %4, %5
%7 = tail call i32 @displayBits(i32 %6)
ret i32 %6
}
int extfunc() { return 3; }


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

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

LLVM IR (-O0):
define i32 @extfunc() {
ret i32 3
}

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

/* Variables and functions */
int fwrite(int *, int, int, int /*<<< orphan*/ *);
int htonl(int);
char svd_writeBinInt(FILE *file, int x) {
  int y = htonl(x);
  if (fwrite(&y, sizeof(int), 1, file) != 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<svd_writeBinInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
cmp    $0x1,%eax
je     1163 <svd_writeBinInt+0x43>
movb   $0x1,-0x1(%rbp)
jmp    1167 <svd_writeBinInt+0x47>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svd_writeBinInt>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
cmp    $0x1,%eax
setne  %al
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @svd_writeBinInt(i32* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htonl(i32 %1)
store i32 %5, i32* %3
%6 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
%7 = icmp ne i32 %6, 1
%8 = zext i1 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void line_char(char ch, int length) {
  while (length--)
    putchar(ch);
  putchar('\n');
}


x86 assembly (clang, -O0):
<line_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1143 <line_char+0x33>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
jmp    1121 <line_char+0x11>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_char>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
je     112c <line_char+0x1c>
mov    %esi,%ebx
movsbl %dil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <line_char+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @line_char(i8 signext %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @putchar(i8 signext %0)
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ modularExponential(long long, long, long long);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  long long base = 2;
  long power = 10;
  long long mod = 100000;
  printf("%lld\n", modularExponential(base, power, mod));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0xa,-0x18(%rbp)
movq   $0x186a0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <modularExponential@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x186a0,%edx
call   1040 <modularExponential@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = tail call i32 @modularExponential(i64 2, i64 10, i64 100000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int cairo_code_draw_reel_get_width() { return 381; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_reel_get_width() {
ret i32 381
}

LLVM IR (-O2):
define i32 @cairo_code_draw_reel_get_width() {
ret i32 381
}
/* Type definitions */
struct animal_builder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void animal_builder_ops_build_body(struct animal_builder *animal_builder) {
  printf("animal_builder::build_body()\n");
}


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

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

LLVM IR (-O0):
%struct.animal_builder = type { i32 }
@.str = [30 x i8] c"animal_builder::build_body()\0A\00"
define void @animal_builder_ops_build_body(%struct.animal_builder* %0) {
%2 = alloca %struct.animal_builder*
store %struct.animal_builder* %0, %struct.animal_builder** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.animal_builder = type { i32 }
@str = [29 x i8] c"animal_builder::build_body()\00"
define void @animal_builder_ops_build_body(%struct.animal_builder* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, int, int);
void putc(char c) { syscall(1, 1, (int)&c, 1); }


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rax
mov    %eax,%edx
mov    $0x1,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdx
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%ecx
call   1030 <syscall@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = ptrtoint i8* %2 to i32
%4 = call i32 @syscall(i32 1, i32 1, i32 %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = ptrtoint i8* %2 to i64
%4 = trunc i64 %3 to i32
%5 = call i32 @syscall(i32 1, i32 1, i32 %4, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
void csub(int *i, float *r) {
  if (*i == 257 && *r == 1.0)
    setenv("MOSTF90CALL", "csub", 1);
}


x86 assembly (clang, -O0):
<csub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x101,(%rax)
jne    116c <csub+0x5c>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    116c <csub+0x5c>
jp     116c <csub+0x5c>
lea    0xead(%rip),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csub>:
cmpl   $0x101,(%rdi)
jne    113f <csub+0x2f>
movss  (%rsi),%xmm0
ucomiss 0xedd(%rip),%xmm0
jne    113f <csub+0x2f>
jp     113f <csub+0x2f>
lea    0xed6(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <setenv@plt>
ret

LLVM IR (-O0):
@.str = [12 x i8] c"MOSTF90CALL\00"
@.str.1 = [5 x i8] c"csub\00"
define void @csub(i32* %0, float* %1) {
%3 = alloca i32*
%4 = alloca float*
store i32* %0, i32** %3
store float* %1, float** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 257
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load float*, float** %4
%10 = load float, float* %9
%11 = fpext float %10 to double
%12 = fcmp oeq double %11, 1.000000e+00
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @setenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %15
15: ; preds = %13, %8, %2
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"MOSTF90CALL\00"
@.str.1 = [5 x i8] c"csub\00"
define void @csub(i32* nocapture %0, float* nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 257
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load float, float* %1
%7 = fcmp oeq float %6, 1.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @setenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %10
10: ; preds = %8, %5, %2
ret void
}
int fun179() { return 179; }


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

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

LLVM IR (-O0):
define i32 @fun179() {
ret i32 179
}

LLVM IR (-O2):
define i32 @fun179() {
ret i32 179
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_set_source_output_volume() {
  printf("NOT IMPLEMENTED:"
         "pa_context_set_source_output_volume"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"NOT IMPLEMENTED:pa_context_set_source_output_volume\0A\00"
define i32 @pa_context_set_source_output_volume() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [52 x i8] c"NOT IMPLEMENTED:pa_context_set_source_output_volume\00"
define i32 @pa_context_set_source_output_volume() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1 & 2;
}


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

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aa_map_add(void *, void *, void *);
void __add_to_another(void *cc, void *k, void *v) { aa_map_add(cc, k, v); }


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

x86 assembly (clang, -O2):
<__add_to_another>:
jmp    1030 <aa_map_add@plt>

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

LLVM IR (-O2):
define void @__add_to_another(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @aa_map_add(i8* %0, i8* %1, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ namcoSetN163(int /*<<< orphan*/);
int /*<<< orphan*/ namco_getParams50XX(int /*<<< orphan*/);
uint8_t namco_getParams50XX_SetN163(uint16_t addr) {
  namcoSetN163(addr);
  return namco_getParams50XX(addr);
}


x86 assembly (clang, -O0):
<namco_getParams50XX_SetN163>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <namcoSetN163@plt>
mov    -0x4(%rbp),%edi
call   1040 <namco_getParams50XX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<namco_getParams50XX_SetN163>:
push   %rbx
mov    %edi,%ebx
call   1030 <namcoSetN163@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <namco_getParams50XX@plt>

LLVM IR (-O0):
define i32 @namco_getParams50XX_SetN163(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @namcoSetN163(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @namco_getParams50XX(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @namco_getParams50XX_SetN163(i32 %0) {
%2 = tail call i32 @namcoSetN163(i32 %0)
%3 = tail call i32 @namco_getParams50XX(i32 %0)
ret i32 %3
}
int test_imm_62uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x62 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_62uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6422528
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ disasm(char *, int /*<<< orphan*/);
uint32_t dbg_disassemble(uint32_t addr, char *buf, size_t bufsize) {
  return disasm(buf, addr);
}


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

x86 assembly (clang, -O2):
<dbg_disassemble>:
mov    %edi,%eax
mov    %rsi,%rdi
mov    %eax,%esi
jmp    1030 <disasm@plt>

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

LLVM IR (-O2):
define i32 @dbg_disassemble(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @disasm(i8* %1, i32 %0)
ret i32 %4
}
int index_for_hash(int hash, int count) { return hash & (count - 1); }


x86 assembly (clang, -O0):
<index_for_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_for_hash>:
lea    -0x1(%rsi),%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @index_for_hash(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 = sub nsw i32 %6, 1
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @index_for_hash(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = and i32 %3, %0
ret i32 %4
}
void RTVfsFsStrmNext(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsFsStrmNext() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *notImplemented();
char *serverExistsDocument(char *key, char *unused1, char *unused2) {
  assert(key != NULL);
  (void)(unused1);
  (void)(unused2);
  return notImplemented();
}


x86 assembly (clang, -O0):
<serverExistsDocument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x0,%al
call   1040 <notImplemented@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serverExistsDocument>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <notImplemented@plt>

LLVM IR (-O0):
define i8* @serverExistsDocument(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call i8* (...) @notImplemented()
ret i8* %13
}

LLVM IR (-O2):
define i8* @serverExistsDocument(i8* readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = icmp ne i8* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i8* (...) @notImplemented()
ret i8* %7
}
struct s3c24x0_usb_device *s3c24x0_get_base_usb_device(void) {
  return (struct s3c24x0_usb_device *)0x15200140;
}


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

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

LLVM IR (-O0):
%struct.s3c24x0_usb_device = type opaque
define %struct.s3c24x0_usb_device* @s3c24x0_get_base_usb_device() {
ret %struct.s3c24x0_usb_device* inttoptr (i64 354419008 to %struct.s3c24x0_usb_device*)
}

LLVM IR (-O2):
%struct.s3c24x0_usb_device = type opaque
define %struct.s3c24x0_usb_device* @s3c24x0_get_base_usb_device() {
ret %struct.s3c24x0_usb_device* inttoptr (i64 354419008 to %struct.s3c24x0_usb_device*)
}
/* Variables and functions */
int /*<<< orphan*/ testSuggestions();
void runTests() { testSuggestions(); }


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

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

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

LLVM IR (-O2):
define void @runTests() {
%1 = tail call i32 (...) @testSuggestions()
ret void
}
/* Type definitions */
struct ipr_ses_config_pg {
  int dummy;
};

/* Variables and functions */
int ipr_elem_offset(struct ipr_ses_config_pg *, int);
int ipr_dev_elem_offset(struct ipr_ses_config_pg *ses_cfg) {
  return ipr_elem_offset(ses_cfg, 0x01);
}


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

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

LLVM IR (-O0):
%struct.ipr_ses_config_pg = type { i32 }
define i32 @ipr_dev_elem_offset(%struct.ipr_ses_config_pg* %0) {
%2 = alloca %struct.ipr_ses_config_pg*
store %struct.ipr_ses_config_pg* %0, %struct.ipr_ses_config_pg** %2
%3 = load %struct.ipr_ses_config_pg*, %struct.ipr_ses_config_pg** %2
%4 = call i32 @ipr_elem_offset(%struct.ipr_ses_config_pg* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.ipr_ses_config_pg = type { i32 }
define i32 @ipr_dev_elem_offset(%struct.ipr_ses_config_pg* %0) {
%2 = tail call i32 @ipr_elem_offset(%struct.ipr_ses_config_pg* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int allocateLabel();
int allocateTemp() { return allocateLabel(); }


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

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

LLVM IR (-O0):
define i32 @allocateTemp() {
%1 = call i32 (...) @allocateLabel()
ret i32 %1
}

LLVM IR (-O2):
define i32 @allocateTemp() {
%1 = tail call i32 (...) @allocateLabel()
ret i32 %1
}
/* Variables and functions */
scalar_t__ fabs(float);
float fabsf(float x) { return (float)fabs(x); }


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

x86 assembly (clang, -O2):
<fabsf>:
push   %rax
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fabsf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @fabs(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @fabsf(float %0) {
%2 = tail call i64 @fabs(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ c_plspause(int /*<<< orphan*/);
int opt_np(const char *opt, const char *myoptarg, void *client_data) {
  (void)opt;
  (void)myoptarg;
  (void)client_data;
  c_plspause(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<opt_np>:
push   %rax
xor    %edi,%edi
call   1030 <c_plspause@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @opt_np(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @c_plspause(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_utf8_to_locale() {
  printf("NOT IMPLEMENTED:"
         "pa_utf8_to_locale"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_utf8_to_locale\0A\00"
define i32 @pa_utf8_to_locale() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_utf8_to_locale\00"
define i32 @pa_utf8_to_locale() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void hide_mouse(int x1, int x2, int iy1, int y2) {
  (void)x1;
  (void)x2;
  (void)iy1;
  (void)y2;
}


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

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

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

LLVM IR (-O2):
define void @hide_mouse(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
wchar_t test25(void) { return L'\x333'; }


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

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

LLVM IR (-O0):
define i32 @test25() {
ret i32 819
}

LLVM IR (-O2):
define i32 @test25() {
ret i32 819
}
cmd_unalias(arg) char *arg;
{ remove_alias(arg); }


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

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

LLVM IR (-O0):
define i32 @cmd_unalias(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @remove_alias to i32 (i8*, ...)*)(i8* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @cmd_unalias(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @remove_alias to i32 (i8*, ...)*)(i8* %0)
ret i32 undef
}
void atomic_dec(int *v) { asm("lock decl %0" : "+m"(*v)); }


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

x86 assembly (clang, -O2):
<atomic_dec>:
lock decl (%rdi)
ret

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

LLVM IR (-O2):
define void @atomic_dec(i32* %0) {
tail call void asm "lock decl $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32* elementtype(i32) %0)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t swab16(uint16_t x) { return (x & 0xff00U >> 8) | (x & 0x00ffU << 8); }


x86 assembly (clang, -O0):
<swab16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swab16>:
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @swab16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = load i32, i32* %2
%6 = and i32 %5, 65280
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @swab16(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
int test_imm_8Fuint16_mem(unsigned short *val) {
  return ((*val) & (0x8F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Fuint16_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, 143
%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_8Fuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 143
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f14(long j) {
  if ((j & ((1UL << (14)) - 1)) >= ((1UL << ((14) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3fff,%rax
cmp    $0x2002,%rax
jb     1139 <f14+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f14>:
and    $0x3ffe,%edi
cmp    $0x2002,%edi
jae    111f <f14+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f14(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 16383
%5 = icmp uge i64 %4, 8194
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f14(i64 %0) {
%2 = and i64 %0, 16382
%3 = icmp ugt i64 %2, 8193
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
size_t digit_count(size_t x) {
  size_t result = 1;
  size_t number = 10;
  while (number < x) {
    number *= 10;
    result++;
  }
  return result;
}


x86 assembly (clang, -O0):
<digit_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0xa,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1140 <digit_count+0x40>
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <digit_count+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_count>:
mov    $0x1,%eax
cmp    $0xb,%rdi
jb     1130 <digit_count+0x30>
mov    $0x1,%eax
mov    $0xa,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    %rcx,%rcx
lea    (%rcx,%rcx,4),%rcx
add    $0x1,%rax
cmp    %rdi,%rcx
jb     1120 <digit_count+0x20>
ret

LLVM IR (-O0):
define i64 @digit_count(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
store i64 10, i64* %4
br label %5
5: ; preds = %9, %1
%6 = load i64, i64* %4
%7 = load i64, i64* %2
%8 = icmp ult i64 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i64, i64* %4
%11 = mul i64 %10, 10
store i64 %11, i64* %4
%12 = load i64, i64* %3
%13 = add i64 %12, 1
store i64 %13, i64* %3
br label %5
14: ; preds = %5
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @digit_count(i64 %0) {
%2 = icmp ugt i64 %0, 10
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 10, %1 ]
%5 = phi i64 [ %7, %3 ], [ 1, %1 ]
%6 = mul i64 %4, 10
%7 = add i64 %5, 1
%8 = icmp ult i64 %6, %0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i64 [ 1, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Type definitions */
typedef void thread_io_list;

/* Variables and functions */
int thread_io_list_sz(void *);
struct thread_io_list *io_list_next(struct thread_io_list *s) {
  return (void *)s + thread_io_list_sz(s);
}


x86 assembly (clang, -O0):
<io_list_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <thread_io_list_sz@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_list_next>:
push   %rbx
mov    %rdi,%rbx
call   1030 <thread_io_list_sz@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.thread_io_list = type opaque
define %struct.thread_io_list* @io_list_next(%struct.thread_io_list* %0) {
%2 = alloca %struct.thread_io_list*
store %struct.thread_io_list* %0, %struct.thread_io_list** %2
%3 = load %struct.thread_io_list*, %struct.thread_io_list** %2
%4 = bitcast %struct.thread_io_list* %3 to i8*
%5 = load %struct.thread_io_list*, %struct.thread_io_list** %2
%6 = bitcast %struct.thread_io_list* %5 to i8*
%7 = call i32 @thread_io_list_sz(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr i8, i8* %4, i64 %8
%10 = bitcast i8* %9 to %struct.thread_io_list*
ret %struct.thread_io_list* %10
}

LLVM IR (-O2):
%struct.thread_io_list = type opaque
define %struct.thread_io_list* @io_list_next(%struct.thread_io_list* %0) {
%2 = bitcast %struct.thread_io_list* %0 to i8*
%3 = tail call i32 @thread_io_list_sz(i8* %2)
%4 = sext i32 %3 to i64
%5 = getelementptr i8, i8* %2, i64 %4
%6 = bitcast i8* %5 to %struct.thread_io_list*
ret %struct.thread_io_list* %6
}
void rop3_53_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ S;
  stk3 = ~stk3;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_53_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_53_1_1>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %sil,%cl
or     %esi,%edx
or     %dl,%cl
not    %cl
and    %dl,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_53_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = xor i32 %18, -1
%20 = trunc i32 %19 to i8
store i8 %20, i8* %9
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = load i8, i8* %8
%30 = zext i8 %29 to i32
%31 = xor i32 %28, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %5
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = load i8*, i8** %4
%51 = load i8, i8* %50
%52 = zext i8 %51 to i32
%53 = load i8, i8* %6
%54 = zext i8 %53 to i32
%55 = and i32 %52, %54
%56 = or i32 %49, %55
%57 = trunc i32 %56 to i8
%58 = load i8*, i8** %4
store i8 %57, i8* %58
ret void
}

LLVM IR (-O2):
define void @rop3_53_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = or i8 %2, %1
%7 = or i8 %6, %5
%8 = xor i8 %7, -1
%9 = and i8 %4, %6
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
unsigned long GPIOPinIntStatus(void) {
  return ((*((volatile unsigned long *)(0x40010414))));
}


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

x86 assembly (clang, -O2):
<GPIOPinIntStatus>:
mov    0x40010414,%rax
40
ret

LLVM IR (-O0):
define i64 @GPIOPinIntStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1073808404 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @GPIOPinIntStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1073808404 to i64*)
ret i64 %1
}
unsigned long stack_return(char *bp) { return *(unsigned long *)(bp + 16); }


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

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

LLVM IR (-O0):
define i64 @stack_return(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 16
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @stack_return(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 16
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int f10_t();
int f12(int arg) { return arg ? 0 : f10_t(); }


x86 assembly (clang, -O0):
<f12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <f12+0x1f>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <f12+0x29>
mov    $0x0,%al
call   1030 <f10_t@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f12>:
test   %edi,%edi
je     1117 <f12+0x7>
xor    %eax,%eax
ret
xor    %eax,%eax
jmp    1030 <f10_t@plt>

LLVM IR (-O0):
define i32 @f12(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = call i32 (...) @f10_t()
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 0, %5 ], [ %7, %6 ]
ret i32 %9
}

LLVM IR (-O2):
define i32 @f12(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @f10_t()
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}