xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ shell_parse(char *);
int /*<<< orphan*/ stdin;
int main(void) {
  char buf[128] = {};
  while (1) {
    printf("shell # ");
    fgets(buf, 128, stdin);
    shell_parse(buf);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    0x2e69(%rip),%rax
mov    (%rax),%edx
mov    $0x80,%esi
call   1050 <fgets@plt>
lea    -0x90(%rbp),%rdi
call   1060 <shell_parse@plt>
jmp    1165 <main+0x25>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xe93(%rip),%r14
mov    0x2e74(%rip),%r15
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <shell_parse@plt>
jmp    1180 <main+0x50>

LLVM IR (-O0):
@.str = [9 x i8] c"shell # \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
store i32 0, i32* %1
%3 = bitcast [128 x i8]* %2 to i8*
br label %4
4: ; preds = %0, %4
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 128, i32 %7)
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%10 = call i32 @shell_parse(i8* %9)
br label %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"shell # \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %2, i32 128, i32 %5)
%7 = call i32 @shell_parse(i8* %2)
br label %3
}
__attribute__((no)) int subprog() {
  volatile int ret = 0;
  return ret;
}


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

x86 assembly (clang, -O2):
<subprog>:
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @subprog() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
ret i32 %3
}
int addWordwith(int sourceWord, int destinationWord) {
  return sourceWord + destinationWord;
}


x86 assembly (clang, -O0):
<addWordwith>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addWordwith>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @addWordwith(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @addWordwith(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
long gcd(long x, long y) {
  if (y == 0L)
    return x;
  return gcd(y, x % y);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <gcd+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <gcd+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64 [ %5, %4 ], [ %0, %2 ]
%7 = srem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %5, %4 ]
ret i64 %10
}
char *memchr(s, c, n)
char *s;
register int n;
{
  register unsigned char *s1 = (unsigned char *)s;
  c &= 0377;
  while (n-- > 0) {
    if (*s1 == c)
      return (char *)s1;
    s1++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
jle    1163 <memchr+0x63>
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1152 <memchr+0x52>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <memchr+0x6b>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1121 <memchr+0x21>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %edx,%edx
jle    1121 <memchr+0x21>
mov    %rdi,%rax
add    $0x1,%edx
nopw   0x0(%rax,%rax,1)
cmp    %sil,(%rax)
je     1123 <memchr+0x23>
add    $0x1,%rax
add    $0xffffffff,%edx
cmp    $0x1,%edx
jg     1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %16
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %12
%8 = phi i32 [ %2, %5 ], [ %13, %12 ]
%9 = phi i8* [ %0, %5 ], [ %14, %12 ]
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %6
br i1 %11, label %16, label %12
12: ; preds = %7
%13 = add nsw i32 %8, -1
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = icmp sgt i32 %8, 1
br i1 %15, label %7, label %16
16: ; preds = %7, %12, %3
%17 = phi i8* [ null, %3 ], [ null, %12 ], [ %9, %7 ]
ret i8* %17
}
/* Variables and functions */
int cos_fixed(int);
int sin_fixed(int deg) { return cos_fixed(deg + 500); }


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

x86 assembly (clang, -O2):
<sin_fixed>:
add    $0x1f4,%edi
jmp    1030 <cos_fixed@plt>

LLVM IR (-O0):
define i32 @sin_fixed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 500
%5 = call i32 @cos_fixed(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @sin_fixed(i32 %0) {
%2 = add nsw i32 %0, 500
%3 = tail call i32 @cos_fixed(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ baz();
int /*<<< orphan*/ foo();
int main() {
  foo();
  foo();
  foo();
  foo();
  bar();
  bar();
  bar();
  bar();
  baz();
  baz();
  baz();
  baz();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <foo@plt>
xor    %eax,%eax
call   1050 <foo@plt>
xor    %eax,%eax
call   1050 <foo@plt>
xor    %eax,%eax
call   1050 <foo@plt>
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
call   1030 <baz@plt>
xor    %eax,%eax
call   1030 <baz@plt>
xor    %eax,%eax
call   1030 <baz@plt>
xor    %eax,%eax
call   1030 <baz@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @bar()
%6 = tail call i32 (...) @bar()
%7 = tail call i32 (...) @bar()
%8 = tail call i32 (...) @bar()
%9 = tail call i32 (...) @baz()
%10 = tail call i32 (...) @baz()
%11 = tail call i32 (...) @baz()
%12 = tail call i32 (...) @baz()
ret i32 0
}
void dummy_block_hook(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy_block_hook() {
ret void
}
void g_cache_new() {}


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

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

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

LLVM IR (-O2):
define void @g_cache_new() {
ret void
}
void wifi_evt_sme_wps_completed(
    const struct wifi_msg_sme_wps_completed_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_wps_completed_evt_t = type opaque
define void @wifi_evt_sme_wps_completed(%struct.wifi_msg_sme_wps_completed_evt_t* nocapture %0) {
ret void
}
int test_imm_96int64_lowword_mem(long long *val) {
  return ((*val) & (0x96 << 0)) ? -20 : -40;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ glRasterPos2s(int /*<<< orphan*/, int /*<<< orphan*/);
void RasterPos2s(GLshort x, GLshort y) { glRasterPos2s(x, y); }


x86 assembly (clang, -O0):
<RasterPos2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <glRasterPos2s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterPos2s>:
jmp    1030 <glRasterPos2s@plt>

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

LLVM IR (-O2):
define void @RasterPos2s(i32 %0, i32 %1) {
%3 = tail call i32 @glRasterPos2s(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x99() {
  Assert_real((isxdigit(153) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              770, ("isxdigit should be 0 for 0x99"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x99>:
push   %rax
mov    $0x99,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x302,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x99\00"
define void @t_isxdigit_0x99() {
%1 = tail call i64 @isxdigit(i32 153)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 770, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int platform_state_user_uid(const struct platform_state_user *s) { return -1; }


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

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

LLVM IR (-O0):
%struct.platform_state_user = type opaque
define i32 @platform_state_user_uid(%struct.platform_state_user* %0) {
%2 = alloca %struct.platform_state_user*
store %struct.platform_state_user* %0, %struct.platform_state_user** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.platform_state_user = type opaque
define i32 @platform_state_user_uid(%struct.platform_state_user* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void utl_dbmsg(char *s) { printf("DEBUG: %s\n", s); }


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

x86 assembly (clang, -O2):
<utl_dbmsg>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"DEBUG: %s\0A\00"
define void @utl_dbmsg(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __invpcid(unsigned long, int /*<<< orphan*/, int);
void invpcid_flush_single_context(unsigned long pcid) { __invpcid(pcid, 0, 1); }


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

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

LLVM IR (-O0):
define void @invpcid_flush_single_context(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @__invpcid(i64 %3, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @invpcid_flush_single_context(i64 %0) {
%2 = tail call i32 @__invpcid(i64 %0, i32 0, i32 1)
ret void
}
int m10mo_s_power_fac(int on) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @m10mo_s_power_fac(i32 %0) {
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int atomic_add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int count = 1;
  printf("%d", atomic_add(count, 5));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
call   1030 <atomic_add@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x5,%esi
call   1030 <atomic_add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @atomic_add(i32 1, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
int fun1002() { return 1002; }


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

x86 assembly (clang, -O2):
mov    $0x3ea,%eax
ret

LLVM IR (-O0):
define i32 @fun1002() {
ret i32 1002
}

LLVM IR (-O2):
define i32 @fun1002() {
ret i32 1002
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int, char *, int);
void usage() {
  write(2, "Usage: modem [-d] [-g] <-i rings | -o> line\n", 44);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
mov    $0x2c,%edx
call   1030 <write@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x2,%edi
mov    $0x2c,%edx
call   1030 <write@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Usage: modem [-d] [-g] <-i rings | -o> line\0A\00"
define void @usage() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 44)
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [45 x i8] c"Usage: modem [-d] [-g] <-i rings | -o> line\0A\00"
define void @usage() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 44)
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
char *find(char *, char);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char haystack[401];
  fgets(haystack, 401, stdin);
  char needle;
  scanf("%c", &needle);
  char *index = find(haystack, needle);
  printf("%d", (int)(index));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
mov    $0x191,%esi
call   1040 <fgets@plt>
lea    0xe8d(%rip),%rdi
lea    -0x1a1(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x1a0(%rbp),%rdi
movsbl -0x1a1(%rbp),%esi
call   1050 <find@plt>
mov    %rax,-0x1b0(%rbp)
mov    -0x1b0(%rbp),%rax
mov    %eax,%esi
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1b0,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x191,%esi
call   1040 <fgets@plt>
lea    0xe96(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1060 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1050 <find@plt>
lea    0xe7b(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%c\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [401 x i8]
%3 = alloca i8
%4 = alloca i8*
store i32 0, i32* %1
%5 = getelementptr inbounds [401 x i8], [401 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 401, i32 %6)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%9 = getelementptr inbounds [401 x i8], [401 x i8]* %2, i64 0, i64 0
%10 = load i8, i8* %3
%11 = call i8* @find(i8* %9, i8 signext %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = ptrtoint i8* %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%c\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [401 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [401 x i8], [401 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 401, i32 %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = load i8, i8* %2
%8 = call i8* @find(i8* %3, i8 signext %7)
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
int main() {
  char *p;
  p = "hello";
  return p[0] - 104;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x68,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 104
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_snanmaxabs(int, float *, int);
int main() {
  float x[] = {1.0,  -2.0, -3.0, 4.0,       -5.0,
               -6.0, 7.0,  8.0,  0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  float v = stdlib_strided_snanmaxabs(N, x, stride);
  printf("maxabs: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0x5,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1030 <stdlib_strided_snanmaxabs@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_snanmaxabs@plt>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x float] [float 1.000000e+00, float -2.000000e+00, float -3.000000e+00, float 4.000000e+00, float -5.000000e+00, float -6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [12 x i8] c"maxabs: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [10 x float]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_snanmaxabs(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x float] [float 1.000000e+00, float -2.000000e+00, float -3.000000e+00, float 4.000000e+00, float -5.000000e+00, float -6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [12 x i8] c"maxabs: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_snanmaxabs(i32 5, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
int HelpItem71(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem71() {
ret i32 0
}
void gen_stride_smul_1x1(const double *scalar, double *a, int a_row_stride,
                         int a_col_stride) {
  a[(0) * a_row_stride + (0) * a_col_stride] =
      a[(0) * a_row_stride + (0) * a_col_stride] * *scalar;
}


x86 assembly (clang, -O0):
<gen_stride_smul_1x1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x0,-0x14(%rbp),%ecx
imul   $0x0,-0x18(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x0,-0x14(%rbp),%ecx
imul   $0x0,-0x18(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_stride_smul_1x1>:
movsd  (%rsi),%xmm0
mulsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @gen_stride_smul_1x1(double* %0, double* %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double*, double** %6
%10 = load i32, i32* %7
%11 = mul nsw i32 0, %10
%12 = load i32, i32* %8
%13 = mul nsw i32 0, %12
%14 = add nsw i32 %11, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* %9, i64 %15
%17 = load double, double* %16
%18 = load double*, double** %5
%19 = load double, double* %18
%20 = fmul double %17, %19
%21 = load double*, double** %6
%22 = load i32, i32* %7
%23 = mul nsw i32 0, %22
%24 = load i32, i32* %8
%25 = mul nsw i32 0, %24
%26 = add nsw i32 %23, %25
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %21, i64 %27
store double %20, double* %28
ret void
}

LLVM IR (-O2):
define void @gen_stride_smul_1x1(double* nocapture %0, double* nocapture %1, i32 %2, i32 %3) {
%5 = load double, double* %1
%6 = load double, double* %0
%7 = fmul double %5, %6
store double %7, double* %1
ret void
}
int image_set_threshold_y(int threshold) {
  int y_threshold = threshold * 7;
  return y_threshold;
}


x86 assembly (clang, -O0):
<image_set_threshold_y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x7,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<image_set_threshold_y>:
lea    0x0(,%rdi,8),%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @image_set_threshold_y(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 7
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @image_set_threshold_y(i32 %0) {
%2 = mul nsw i32 %0, 7
ret i32 %2
}
void proc4() {}


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

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

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

LLVM IR (-O2):
define void @proc4() {
ret void
}
/* Type definitions */
struct clad_sb {
  int dummy;
};

/* Variables and functions */
int clad_sb_get_substr(struct clad_sb *, int, int, struct clad_sb *);
int clad_sb_delete(struct clad_sb *me, int start, int size) {
  return clad_sb_get_substr(me, start, size, me);
}


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

x86 assembly (clang, -O2):
<clad_sb_delete>:
mov    %rdi,%rcx
jmp    1030 <clad_sb_get_substr@plt>

LLVM IR (-O0):
%struct.clad_sb = type { i32 }
define i32 @clad_sb_delete(%struct.clad_sb* %0, i32 %1, i32 %2) {
%4 = alloca %struct.clad_sb*
%5 = alloca i32
%6 = alloca i32
store %struct.clad_sb* %0, %struct.clad_sb** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.clad_sb*, %struct.clad_sb** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load %struct.clad_sb*, %struct.clad_sb** %4
%11 = call i32 @clad_sb_get_substr(%struct.clad_sb* %7, i32 %8, i32 %9, %struct.clad_sb* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.clad_sb = type { i32 }
define i32 @clad_sb_delete(%struct.clad_sb* %0, i32 %1, i32 %2) {
%4 = tail call i32 @clad_sb_get_substr(%struct.clad_sb* %0, i32 %1, i32 %2, %struct.clad_sb* %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Opqa_Fire2(int value) {
  if (value) {
    cpc_key_press(0x27);
  } else {
    cpc_key_unpress(0x27);
  };
}


x86 assembly (clang, -O0):
<Joy_Opqa_Fire2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Opqa_Fire2+0x24>
mov    $0x27,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Opqa_Fire2+0x2e>
mov    $0x27,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Opqa_Fire2>:
test   %edi,%edi
je     112e <Joy_Opqa_Fire2+0xe>
mov    $0x27,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x27,%edi
jmp    1040 <cpc_key_unpress@plt>

LLVM IR (-O0):
define void @Joy_Opqa_Fire2(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 %7
5: ; preds = %1
%6 = call i32 @cpc_key_press(i32 39)
br label %9
7: ; preds = %1
%8 = call i32 @cpc_key_unpress(i32 39)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @Joy_Opqa_Fire2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 39)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 39)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c = getchar();
  putchar(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 @putchar(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void error(char *ch) {
  perror(ch);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
double grace_get_x_range(double world_min_x, double world_max_x) {
  return world_max_x - world_min_x;
}


x86 assembly (clang, -O0):
<grace_get_x_range>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<grace_get_x_range>:
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @grace_get_x_range(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @grace_get_x_range(double %0, double %1) {
%3 = fsub double %1, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ queue_put(int);
int strlen(char *);
void queue_put_s(char *s) {
  int i;
  for (i = 0; i < strlen(s); i++) {
    queue_put((int)s[i]);
  }
}


x86 assembly (clang, -O0):
<queue_put_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    116e <queue_put_s+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <queue_put@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <queue_put_s+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_put_s>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    115d <queue_put_s+0x3d>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <queue_put@plt>
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <queue_put_s+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @queue_put_s(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = tail call i32 @queue_put(i32 %8)
%10 = add nuw nsw i64 %5, 1
%11 = tail call i32 @strlen(i8* %0)
%12 = sext i32 %11 to i64
%13 = icmp slt i64 %10, %12
br i1 %13, label %4, label %14
14: ; preds = %4, %1
ret void
}
hash(name) char *name;
{
  register int result = 0;
  register char *p = name;
  while (*p)
    result = 3 * result + (int)*p++;
  result = result % 1024;
  while (result < 0)
    result = result + 1024;
  return (result);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1144 <hash+0x44>
imul   $0x3,-0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <hash+0x17>
mov    -0xc(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    116c <hash+0x6c>
mov    -0xc(%rbp),%eax
add    $0x400,%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <hash+0x52>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     1137 <hash+0x37>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
lea    (%rcx,%rcx,2),%edx
movsbl %al,%ecx
add    %edx,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
lea    0x3ff(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
and    $0xfffffc00,%eax
sub    %eax,%ecx
jmp    1139 <hash+0x39>
xor    %ecx,%ecx
mov    $0x3ff,%eax
sub    %ecx,%eax
and    $0xfffffc00,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash(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
store i8* %5, i8** %4
br label %6
6: ; preds = %10, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32, i32* %3
%12 = mul nsw i32 3, %11
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %4
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = add nsw i32 %12, %16
store i32 %17, i32* %3
br label %6
18: ; preds = %6
%19 = load i32, i32* %3
%20 = srem i32 %19, 1024
store i32 %20, i32* %3
br label %21
21: ; preds = %24, %18
%22 = load i32, i32* %3
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1024
store i32 %26, i32* %3
br label %21
27: ; preds = %21
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = mul nsw i32 %7, 3
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = sext i8 %5 to i32
%11 = add nsw i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = srem i32 %11, 1024
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
%18 = sub nsw i32 1023, %17
%19 = and i32 %18, -1024
%20 = add nsw i32 %17, %19
ret i32 %20
}
void ws_deinit(void) {}


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

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

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

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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xebb(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c" %d\0A\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 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sequence2(int);
int sequenceToN(int maxnumber) {
  printf("Fibonacci Sequence until %d : ", maxnumber);
  sequence2(maxnumber);
  return 0;
}


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

x86 assembly (clang, -O2):
<sequenceToN>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <sequence2@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Fibonacci Sequence until %d : \00"
define i32 @sequenceToN(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @sequence2(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Fibonacci Sequence until %d : \00"
define i32 @sequenceToN(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sequence2(i32 %0)
ret i32 0
}
void function_declaration_before(void) {}


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

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

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

LLVM IR (-O2):
define void @function_declaration_before() {
ret void
}
unsigned int autofs_type_direct(unsigned int type) { return (type == 2U); }


x86 assembly (clang, -O0):
<autofs_type_direct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<autofs_type_direct>:
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @autofs_type_direct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @autofs_type_direct(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}