xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
long strtol(char *, char **, int);
long int xstrntol(const char *str, char **endptr, size_t n, int base) {
  long int number = 0;
  char new_str[n + 1];
  memcpy(new_str, str, n);
  new_str[n] = '\0';
  number = strtol(new_str, endptr, base);
  return number;
}


x86 assembly (clang, -O0):
<xstrntol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    %rcx,%rax
add    $0x1,%rax
mov    %rsp,%rdx
mov    %rdx,-0x30(%rbp)
add    $0x10,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x40(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrntol>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,%rsi
mov    %rsp,%rbx
lea    0x10(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <memcpy@plt>
movb   $0x0,(%r12,%rbx,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <strtol@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @xstrntol(i8* %0, i8** %1, i64 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i64
%8 = alloca i32
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
store i64 0, i64* %9
%12 = load i64, i64* %7
%13 = add i64 %12, 1
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %10
%15 = alloca i8, i64 %13
store i64 %13, i64* %11
%16 = load i8*, i8** %5
%17 = load i64, i64* %7
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i64, i64* %7
%20 = getelementptr inbounds i8, i8* %15, i64 %19
store i8 0, i8* %20
%21 = load i8**, i8*** %6
%22 = load i32, i32* %8
%23 = call i64 @strtol(i8* %15, i8** %21, i32 %22)
store i64 %23, i64* %9
%24 = load i64, i64* %9
%25 = load i8*, i8** %10
ret i64 %24
}

LLVM IR (-O2):
define i64 @xstrntol(i8* %0, i8** nocapture %1, i64 %2, i32 %3) {
%5 = add i64 %2, 1
%6 = alloca i8, i64 %5
%7 = call i32 @memcpy(i8* %6, i8* %0, i64 %2)
%8 = getelementptr inbounds i8, i8* %6, i64 %2
store i8 0, i8* %8
%9 = call i64 @strtol(i8* %6, i8** %1, i32 %3)
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *, char *, int /*<<< orphan*/);
void int_04(void) { panic("Overflow", "#OF", 0); }


x86 assembly (clang, -O0):
<int_04>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee7(%rip),%rsi
xor    %edx,%edx
call   1030 <panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_04>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
xor    %edx,%edx
jmp    1030 <panic@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Overflow\00"
@.str.1 = [4 x i8] c"#OF\00"
define void @int_04() {
%1 = call i32 @panic(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Overflow\00"
@.str.1 = [4 x i8] c"#OF\00"
define void @int_04() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void bad_command(const char *arg) {
  fprintf(stderr, "invalid command \"%s\"\n", arg);
  exit(1);
}


x86 assembly (clang, -O0):
<bad_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bad_command>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"invalid command \22%s\22\0A\00"
define void @bad_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"invalid command \22%s\22\0A\00"
define void @bad_command(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int mtk_mdio_init(struct mtk_eth *eth) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mtk_eth = type opaque
define i32 @mtk_mdio_init(%struct.mtk_eth* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t MulInt32(int32_t a, int32_t b) { return (int32_t)(a * b); }


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

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

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

LLVM IR (-O2):
define i32 @MulInt32(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ playmidi(char *);
void main(void) { playmidi("caveexpl.mid"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"caveexpl.mid\00"
define void @main() {
%1 = call i32 @playmidi(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"caveexpl.mid\00"
define void @main() {
%1 = tail call i32 @playmidi(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  char *s = "\890";
  if (s[0] != '8' || s[1] != '9' || s[2] != '0' || s[3])
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x38,%eax
jne    116d <main+0x5d>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x39,%eax
jne    116d <main+0x5d>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x30,%eax
jne    116d <main+0x5d>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x0,%eax
je     1174 <main+0x64>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"890\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 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 = icmp ne i32 %6, 56
br i1 %7, label %26, label %8
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 57
br i1 %13, label %26, label %14
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 48
br i1 %19, label %26, label %20
20: ; preds = %14
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %20, %14, %8, %0
%27 = call i32 (...) @abort()
unreachable
28: ; preds = %20
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __mx_free(void *ptr) { free(*(void **)ptr); }


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

x86 assembly (clang, -O2):
<__mx_free>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @__mx_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putPT(int /*<<< orphan*/);
void ET2_putPT_L(unsigned c) {
  int i;
  unsigned char *p;
  p = (unsigned char *)&c;
  for (i = 0; i < 4; ++i) {
    putPT(*(p++));
  }
}


x86 assembly (clang, -O0):
<ET2_putPT_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1159 <ET2_putPT_L+0x49>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%edi
call   1030 <putPT@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112a <ET2_putPT_L+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ET2_putPT_L>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    %edi,%ebp
shr    $0x10,%ebp
mov    %edi,%r14d
shr    $0x18,%r14d
movzbl %bl,%edi
call   1030 <putPT@plt>
movzbl %bh,%edi
call   1030 <putPT@plt>
movzbl %bpl,%edi
call   1030 <putPT@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putPT@plt>

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

LLVM IR (-O2):
define void @ET2_putPT_L(i32 %0) {
%2 = lshr i32 %0, 8
%3 = lshr i32 %0, 16
%4 = lshr i32 %0, 24
%5 = and i32 %0, 255
%6 = tail call i32 @putPT(i32 %5)
%7 = and i32 %2, 255
%8 = tail call i32 @putPT(i32 %7)
%9 = and i32 %3, 255
%10 = tail call i32 @putPT(i32 %9)
%11 = tail call i32 @putPT(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int a, b;
  int *pointer_1, *pointer_2;
  a = 100;
  b = 10;
  pointer_1 = &a;
  pointer_2 = &b;
  printf("%d,%d\n", a, b);
  printf("%d,%d\n", *pointer_1, *pointer_2);
  pointer_2 = pointer_1;
  printf("%d,%d\n", *pointer_1, *pointer_2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x64,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x64,%edx
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d,%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 100, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 100, i32 10)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 100, i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void mem_error(const char *description) {
  fprintf(stderr, "ERROR:  Out of memory\n");
  fprintf(stderr, "%s\n", description);
}


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

x86 assembly (clang, -O2):
<mem_error>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xede(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"ERROR: Out of memory\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @mem_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"ERROR: Out of memory\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @mem_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int pow2(int x) {
  int i;
  int r = 1;
  for (i = 0; i < x; i++) {
    r = r * 2;
  }
  return r;
}


x86 assembly (clang, -O0):
<pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <pow2+0x38>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <pow2+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2>:
test   %edi,%edi
jle    1118 <pow2+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <pow2+0x1e>
mov    $0x1,%eax
jmp    1138 <pow2+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <pow2+0x30>
test   %ecx,%ecx
je     1147 <pow2+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <pow2+0x40>
ret

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

LLVM IR (-O2):
define i32 @pow2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %25
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i32 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i32 [ undef, %3 ], [ %12, %9 ]
%17 = phi i32 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i32 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i32 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i32 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i32 %26
}
void PWM0Generator0_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<PWM0Generator0_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PWM0Generator0_Handler+0x9>
jmp    1109 <PWM0Generator0_Handler+0x9>

x86 assembly (clang, -O2):
<PWM0Generator0_Handler>:
jmp    1100 <PWM0Generator0_Handler>

LLVM IR (-O0):
define void @PWM0Generator0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @PWM0Generator0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int input_error(char *srname, int *info) {
  printf("** On entry to %6s, parameter number %2d had an illegal value\n",
         srname, *info);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [63 x i8] c"** On entry to %6s, parameter number %2d had an illegal value\0A\00"
define i32 @input_error(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [63 x i8] c"** On entry to %6s, parameter number %2d had an illegal value\0A\00"
define i32 @input_error(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
main() {
  long int sumsqr, sqrsum, arr[100];
  int i;
  sumsqr = sqrsum = 0;
  for (i = 1; i < 101; i++) {
    sumsqr += i * i;
    sqrsum += i;
  }
  sqrsum *= sqrsum;
  printf("The solution is: %li\n", sqrsum - sumsqr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x344(%rbp)
cmpl   $0x65,-0x344(%rbp)
jge    1183 <main+0x73>
mov    -0x344(%rbp),%eax
imul   -0x344(%rbp),%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x344(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x344(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x344(%rbp)
jmp    113c <main+0x2c>
mov    -0x18(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
sub    -0x10(%rbp),%rsi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x350,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"The solution is: %li\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca [100 x i64]
%5 = alloca i32
store i32 0, i32* %1
store i64 0, i64* %3
store i64 0, i64* %2
store i32 1, i32* %5
br label %6
6: ; preds = %20, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 101
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %5
%11 = load i32, i32* %5
%12 = mul nsw i32 %10, %11
%13 = sext i32 %12 to i64
%14 = load i64, i64* %2
%15 = add nsw i64 %14, %13
store i64 %15, i64* %2
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = load i64, i64* %3
%19 = add nsw i64 %18, %17
store i64 %19, i64* %3
br label %20
20: ; preds = %9
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
%24 = load i64, i64* %3
%25 = load i64, i64* %3
%26 = mul nsw i64 %25, %24
store i64 %26, i64* %3
%27 = load i64, i64* %3
%28 = load i64, i64* %2
%29 = sub nsw i64 %27, %28
%30 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %29)
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@.str = [22 x i8] c"The solution is: %li\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 25164150)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __kill(int pid, int sig) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__kill>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__kill(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ system();
int main() {
  system();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <system@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <system@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @system()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @system()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double astro_julday(int, int, int, int, int, int);
double astro_mjd(int year, int month, int day, int h, int m, int s) {
  return astro_julday(year, month, day, h, m, s) - 2400000.5;
}


x86 assembly (clang, -O0):
<astro_mjd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <astro_julday@plt>
movsd  0xeb3(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<astro_mjd>:
push   %rax
call   1030 <astro_julday@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @astro_mjd(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call double @astro_julday(i32 %13, i32 %14, i32 %15, i32 %16, i32 %17, i32 %18)
%20 = fsub double %19, 0x41424F8040000000
ret double %20
}

LLVM IR (-O2):
define double @astro_mjd(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call double @astro_julday(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%8 = fadd double %7, 0xC1424F8040000000
ret double %8
}
int test_imm_43int64_lowword_mem(long long *val) {
  return ((*val) & (0x43 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_43int64_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, 67
%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_43int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 67
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
float GetFPSFunc();
float IDK_GetFPS(void) { return GetFPSFunc(); }


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

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

LLVM IR (-O0):
define float @IDK_GetFPS() {
%1 = call float (...) @GetFPSFunc()
ret float %1
}

LLVM IR (-O2):
define float @IDK_GetFPS() {
%1 = tail call float (...) @GetFPSFunc()
ret float %1
}
void RTFileAioCtxAssociateWithFile(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileAioCtxAssociateWithFile() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", fib(33));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x21,%edi
call   1040 <fib@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x21,%edi
call   1040 <fib@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fib(i32 33)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ eventfd_t;

/* Variables and functions */
int __write(int, int /*<<< orphan*/ *, int);
int eventfd_write(int fd, eventfd_t value) {
  return __write(fd, &value, sizeof(eventfd_t)) != sizeof(eventfd_t) ? -1 : 0;
}


x86 assembly (clang, -O0):
<eventfd_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <__write@plt>
movslq %eax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x4,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eventfd_write>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <__write@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eventfd_write(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 = call i32 @__write(i32 %5, i32* %4, i32 4)
%7 = sext i32 %6 to i64
%8 = icmp ne i64 %7, 4
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @eventfd_write(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @__write(i32 %0, i32* %3, i32 4)
%5 = icmp ne i32 %4, 4
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void bsdconv_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<bsdconv_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @bsdconv_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int main(int argc, char *argv[]) {
  int i;
  int j;
  if (i == 1)
    j = 0;
  else
    j = 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1128 <main+0x28>
movl   $0x0,-0x18(%rbp)
jmp    112f <main+0x2f>
movl   $0x1,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t gf_log(uint8_t x) {
  uint8_t atb = 1, i = 0, z;
  do {
    if (atb == x)
      break;
    z = atb;
    atb <<= 1;
    if (z & 0x80)
      atb ^= 0x1b;
    atb ^= z;
  } while (++i > 0);
  return i;
}


x86 assembly (clang, -O0):
<gf_log>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    112b <gf_log+0x2b>
jmp    1181 <gf_log+0x81>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
and    $0x80,%rax
cmp    $0x0,%rax
je     115f <gf_log+0x5f>
mov    -0x10(%rbp),%rax
xor    $0x1b,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jg     1118 <gf_log+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_log>:
cmp    $0x1,%rdi
jne    1109 <gf_log+0x9>
xor    %eax,%eax
ret
mov    $0x1,%ecx
xor    %eax,%eax
lea    (%rcx,%rcx,1),%rdx
mov    %rdx,%rsi
xor    $0x1b,%rsi
test   $0x80,%cl
cmove  %rdx,%rsi
xor    %rsi,%rcx
add    $0x1,%rax
cmp    %rdi,%rcx
jne    1110 <gf_log+0x10>
ret

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

LLVM IR (-O2):
define i64 @gf_log(i64 %0) {
%2 = icmp eq i64 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %11, %3 ], [ 1, %1 ]
%5 = phi i64 [ %12, %3 ], [ 0, %1 ]
%6 = shl i64 %4, 1
%7 = and i64 %4, 128
%8 = icmp eq i64 %7, 0
%9 = xor i64 %6, 27
%10 = select i1 %8, i64 %6, i64 %9
%11 = xor i64 %10, %4
%12 = add nuw nsw i64 %5, 1
%13 = icmp eq i64 %11, %0
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i64 [ 0, %1 ], [ %12, %3 ]
ret i64 %15
}
int keepItStatic(int x) {
  static int y = 0;
  y = x + y;
  return y;
}


x86 assembly (clang, -O0):
<keepItStatic>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    0x2f14(%rip),%eax
mov    %eax,0x2f0e(%rip)
mov    0x2f08(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<keepItStatic>:
mov    %edi,%eax
add    0x2f1c(%rip),%eax
mov    %eax,0x2f16(%rip)
ret

LLVM IR (-O0):
@keepItStatic.y = internal global i32 0
define i32 @keepItStatic(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @keepItStatic.y
%5 = add nsw i32 %3, %4
store i32 %5, i32* @keepItStatic.y
%6 = load i32, i32* @keepItStatic.y
ret i32 %6
}

LLVM IR (-O2):
@keepItStatic.y = internal unnamed_addr global i32 0
define i32 @keepItStatic(i32 %0) {
%2 = load i32, i32* @keepItStatic.y
%3 = add nsw i32 %2, %0
store i32 %3, i32* @keepItStatic.y
ret i32 %3
}
int foo(int i, int j) {
  int k = i + 1;
  if (j) {
    if (k > 0)
      k++;
    else if (k < 0)
      k--;
  }
  return k;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1152 <foo+0x52>
cmpl   $0x0,-0xc(%rbp)
jle    1135 <foo+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <foo+0x4d>
cmpl   $0x0,-0xc(%rbp)
jge    1148 <foo+0x48>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <foo+0x4d>
jmp    1152 <foo+0x52>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
test   %esi,%esi
je     110e <foo+0xe>
test   %eax,%eax
js     1112 <foo+0x12>
add    $0x2,%eax
ret
add    $0x1,%eax
ret
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = icmp eq i32 %1, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = icmp sgt i32 %0, -1
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = add nuw nsw i32 %0, 2
br label %12
9: ; preds = %5
%10 = icmp eq i32 %0, -1
%11 = select i1 %10, i32 0, i32 %0
br label %12
12: ; preds = %9, %7, %2
%13 = phi i32 [ %8, %7 ], [ %3, %2 ], [ %11, %9 ]
ret i32 %13
}
int cmc623_get_type_index(int cabc, int bgeffect) {
  return cabc * 3 + bgeffect;
}


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

x86 assembly (clang, -O2):
<cmc623_get_type_index>:
lea    (%rdi,%rdi,2),%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @cmc623_get_type_index(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 = mul nsw i32 %5, 3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @cmc623_get_type_index(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 3
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pid_file_create() {
  printf("NOT IMPLEMENTED:"
         "pa_pid_file_create"
         "\n");
}


x86 assembly (clang, -O0):
<pa_pid_file_create>:
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_pid_file_create>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_pid_file_create\00"
define i32 @pa_pid_file_create() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
float mayor(float a, float b) {
  if (a > b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<mayor>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <mayor+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <mayor+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mayor>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mayor(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @mayor(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ where();
void ferr(char *text) {
  fprintf(stdout, text);
  where();
  exit(1);
}


x86 assembly (clang, -O0):
<ferr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <where@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<ferr>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <where@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @ferr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = call i32 (...) @where()
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
define void @ferr(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = tail call i32 (...) @where()
%5 = tail call i32 @exit(i32 1)
unreachable
}
void XDisplayOfOM() {}


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

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

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

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

/* Variables and functions */
int __ent_empty(struct stp_header const *);
int __empty_location(const struct stp_header *location) {
  return __ent_empty(location);
}


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

x86 assembly (clang, -O2):
<__empty_location>:
jmp    1030 <__ent_empty@plt>

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

LLVM IR (-O2):
%struct.stp_header = type { i32 }
define i32 @__empty_location(%struct.stp_header* %0) {
%2 = tail call i32 @__ent_empty(%struct.stp_header* %0)
ret i32 %2
}
/* Variables and functions */
int floatToRawIntBits(float);
float intBitsToFloat(int);
float fabsfk(float x) {
  return intBitsToFloat(0x7fffffffL & floatToRawIntBits(x));
}


x86 assembly (clang, -O0):
<fabsfk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <floatToRawIntBits@plt>
cltq
and    $0x7fffffff,%rax
mov    %eax,%edi
call   1030 <intBitsToFloat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsfk>:
push   %rax
call   1040 <floatToRawIntBits@plt>
and    $0x7fffffff,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <intBitsToFloat@plt>

LLVM IR (-O0):
define float @fabsfk(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @floatToRawIntBits(float %3)
%5 = sext i32 %4 to i64
%6 = and i64 2147483647, %5
%7 = trunc i64 %6 to i32
%8 = call float @intBitsToFloat(i32 %7)
ret float %8
}

LLVM IR (-O2):
define float @fabsfk(float %0) {
%2 = tail call i32 @floatToRawIntBits(float %0)
%3 = and i32 %2, 2147483647
%4 = tail call float @intBitsToFloat(i32 %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ FCEUD_PrintError(char *);
void CheatMemErr(void) {
  FCEUD_PrintError("Error allocating memory for cheat data.");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Error allocating memory for cheat data.\00"
define void @CheatMemErr() {
%1 = call i32 @FCEUD_PrintError(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Error allocating memory for cheat data.\00"
define void @CheatMemErr() {
%1 = tail call i32 @FCEUD_PrintError(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
void gendmfc1() {}


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

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

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

LLVM IR (-O2):
define void @gendmfc1() {
ret void
}
void g_DUMMY_menu_destroy_menubar_children(int win_id) { win_id = win_id; }


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

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

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

LLVM IR (-O2):
define void @g_DUMMY_menu_destroy_menubar_children(i32 %0) {
ret void
}
int bar(unsigned long x) {
  if (x == 0)
    __builtin_unreachable();
  return __builtin_ffsl(x) - 1;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1113 <bar+0x13>
mov    -0x8(%rbp),%rdx
bsf    %rdx,%rax
add    $0x1,%rax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %rcx,%rax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
bsf    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @bar(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
unreachable
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i64 @llvm.cttz.i64(i64 %7, i1 true)
%9 = add i64 %8, 1
%10 = icmp eq i64 %7, 0
%11 = select i1 %10, i64 0, i64 %9
%12 = trunc i64 %11 to i32
%13 = sub nsw i32 %12, 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @bar(i64 %0) {
%2 = icmp ne i64 %0, 0
tail call void @llvm.assume(i1 %2)
%3 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
%4 = trunc i64 %3 to i32
ret i32 %4
}