xunge/DecIR huggingface dataset:
void mpmc_pause() { __asm__ __volatile__("pause" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @mpmc_pause() {
tail call void asm sideeffect "pause", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
struct sha256_running_checksum *rc_to_priv(struct running_checksum *rc) {
  return (struct sha256_running_checksum *)rc;
}


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

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

LLVM IR (-O0):
%struct.sha256_running_checksum = type opaque
%struct.running_checksum = type opaque
define %struct.sha256_running_checksum* @rc_to_priv(%struct.running_checksum* %0) {
%2 = alloca %struct.running_checksum*
store %struct.running_checksum* %0, %struct.running_checksum** %2
%3 = load %struct.running_checksum*, %struct.running_checksum** %2
%4 = bitcast %struct.running_checksum* %3 to %struct.sha256_running_checksum*
ret %struct.sha256_running_checksum* %4
}

LLVM IR (-O2):
%struct.sha256_running_checksum = type opaque
%struct.running_checksum = type opaque
define %struct.sha256_running_checksum* @rc_to_priv(%struct.running_checksum* readnone %0) {
%2 = bitcast %struct.running_checksum* %0 to %struct.sha256_running_checksum*
ret %struct.sha256_running_checksum* %2
}
/* Variables and functions */
int *allocateContext(int, int);
int /*<<< orphan*/ setNextContext(int *, int *);
int /*<<< orphan*/ setPrevContext(int *, int *);
int *createContext(int ID, int parentID, int *in) {
  int *context;
  context = allocateContext(ID, parentID);
  setNextContext(context, in);
  if (in != (int *)0)
    setPrevContext(in, context);
  return context;
}


x86 assembly (clang, -O0):
<createContext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <allocateContext@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <setNextContext@plt>
cmpq   $0x0,-0x10(%rbp)
je     1176 <createContext+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <setPrevContext@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createContext>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
call   1040 <allocateContext@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <setNextContext@plt>
test   %r14,%r14
je     115a <createContext+0x2a>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <setPrevContext@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @createContext(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32* @allocateContext(i32 %8, i32 %9)
store i32* %10, i32** %7
%11 = load i32*, i32** %7
%12 = load i32*, i32** %6
%13 = call i32 @setNextContext(i32* %11, i32* %12)
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %20
16: ; preds = %3
%17 = load i32*, i32** %6
%18 = load i32*, i32** %7
%19 = call i32 @setPrevContext(i32* %17, i32* %18)
br label %20
20: ; preds = %16, %3
%21 = load i32*, i32** %7
ret i32* %21
}

LLVM IR (-O2):
define i32* @createContext(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32* @allocateContext(i32 %0, i32 %1)
%5 = tail call i32 @setNextContext(i32* %4, i32* %2)
%6 = icmp eq i32* %2, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @setPrevContext(i32* %2, i32* %4)
br label %9
9: ; preds = %7, %3
ret i32* %4
}
void glutPostOverlayRedisplay(void) {}


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

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

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

LLVM IR (-O2):
define void @glutPostOverlayRedisplay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
char *strcpy(char *, char *);
void symbolLostWithStrcpy(char *s) {
  char *p = malloc(12);
  p = strcpy(p, s);
  free(p);
}


x86 assembly (clang, -O0):
<symbolLostWithStrcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbolLostWithStrcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @symbolLostWithStrcpy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 12)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i8* @strcpy(i8* %5, i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @symbolLostWithStrcpy(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(12) i8* @malloc(i32 12)
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %2, i8* dereferenceable(1) %0)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AT_HWCAP2;
scalar_t__ get_auxv_entry(int /*<<< orphan*/);
bool have_hwcap2(unsigned long ftr2) {
  return ((unsigned long)get_auxv_entry(AT_HWCAP2) & ftr2) == ftr2;
}


x86 assembly (clang, -O0):
<have_hwcap2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <get_auxv_entry@plt>
and    -0x8(%rbp),%rax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<have_hwcap2>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <get_auxv_entry@plt>
not    %rax
xor    %ecx,%ecx
test   %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@AT_HWCAP2 = global i32 0
define i32 @have_hwcap2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @AT_HWCAP2
%4 = call i64 @get_auxv_entry(i32 %3)
%5 = load i64, i64* %2
%6 = and i64 %4, %5
%7 = load i64, i64* %2
%8 = icmp eq i64 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@AT_HWCAP2 = global i32 0
define i32 @have_hwcap2(i64 %0) {
%2 = load i32, i32* @AT_HWCAP2
%3 = tail call i64 @get_auxv_entry(i32 %2)
%4 = and i64 %3, %0
%5 = icmp eq i64 %4, %0
%6 = zext i1 %5 to i32
ret i32 %6
}
void test53_TestProg_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test53_TestProg_targetInit__I() {
ret void
}
int getpathbufferlength(void) { return 1023 + 1; }


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

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

LLVM IR (-O0):
define i32 @getpathbufferlength() {
ret i32 1024
}

LLVM IR (-O2):
define i32 @getpathbufferlength() {
ret i32 1024
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void write_winner(int player) {
  if (player == 0) {
    printf("Hehe jag vann :(\n");
  } else
    printf("Grattis! Du vann :)\n");
}


x86 assembly (clang, -O0):
<write_winner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <write_winner+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <write_winner+0x32>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_winner>:
test   %edi,%edi
lea    0xefb(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Hehe jag vann :(\0A\00"
@.str.1 = [21 x i8] c"Grattis! Du vann :)\0A\00"
define void @write_winner(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Grattis! Du vann :)\00"
@str.2 = [17 x i8] c"Hehe jag vann :(\00"
define void @write_winner(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
char write_setun_char(int value) {
  switch (value) {
  case 0:
    return '0';
  case 1:
    return '1';
  case -1:
    return '$';
  default:
    fprintf(stderr, "offending value: %d\n", value);
    abort();
  }
}


x86 assembly (clang, -O0):
<write_setun_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xffffffff,%eax
je     1172 <write_setun_char+0x52>
jmp    113f <write_setun_char+0x1f>
mov    -0xc(%rbp),%eax
test   %eax,%eax
je     1160 <write_setun_char+0x40>
jmp    114f <write_setun_char+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1169 <write_setun_char+0x49>
jmp    117b <write_setun_char+0x5b>
movb   $0x30,-0x1(%rbp)
jmp    119a <write_setun_char+0x7a>
movb   $0x31,-0x1(%rbp)
jmp    119a <write_setun_char+0x7a>
movb   $0x24,-0x1(%rbp)
jmp    119a <write_setun_char+0x7a>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe72(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_setun_char>:
mov    %edi,%edx
lea    0x1(%rdx),%ecx
cmp    $0x3,%ecx
jae    1135 <write_setun_char+0x15>
shl    $0x3,%ecx
mov    $0x313024,%eax
shr    %cl,%eax
ret
push   %rax
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"offending value: %d\0A\00"
define signext i8 @write_setun_char(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 -1, label %7
]
5: ; preds = %1
store i8 48, i8* %2
br label %13
6: ; preds = %1
store i8 49, i8* %2
br label %13
7: ; preds = %1
store i8 36, i8* %2
br label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %3
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %7, %6, %5
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"offending value: %d\0A\00"
define signext i8 @write_setun_char(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 3
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = trunc i32 %2 to i24
%10 = shl i24 %9, 3
%11 = lshr i24 3223588, %10
%12 = trunc i24 %11 to i8
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, unsigned int);
void print_time(unsigned long t) {
  const unsigned int cycles_per_ms = 2000;
  unsigned long ms = t / cycles_per_ms;
  unsigned int frac = (t % cycles_per_ms) / 2;
  printf("%-8.8ld.%03d", ms, frac);
}


x86 assembly (clang, -O0):
<print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x7d0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x7d0,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x7d0,%ecx
xor    %edx,%edx
div    %rcx
shr    $0x1,%rdx
mov    %edx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time>:
mov    %rdi,%rcx
mov    %rdi,%rax
shr    $0x4,%rax
movabs $0x20c49ba5e353f7d,%rdx
49 0c 02
mul    %rdx
imul   $0x7d0,%rdx,%rax
sub    %rax,%rcx
shr    %rcx
lea    0xec5(%rip),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%-8.8ld.%03d\00"
define void @print_time(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %2
store i32 2000, i32* %3
%6 = load i64, i64* %2
%7 = udiv i64 %6, 2000
store i64 %7, i64* %4
%8 = load i64, i64* %2
%9 = urem i64 %8, 2000
%10 = udiv i64 %9, 2
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i64, i64* %4
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%-8.8ld.%03d\00"
define void @print_time(i64 %0) {
%2 = udiv i64 %0, 2000
%3 = urem i64 %0, 2000
%4 = lshr i64 %3, 1
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %2, i32 %5)
ret void
}
/* Variables and functions */
double asin(double);
double r2a_fish(double R, double K) { return K * asin(R / K); }


x86 assembly (clang, -O0):
<r2a_fish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <asin@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r2a_fish>:
push   %rax
movsd  %xmm1,(%rsp)
divsd  %xmm1,%xmm0
call   1030 <asin@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @r2a_fish(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 = load double, double* %4
%8 = fdiv double %6, %7
%9 = call double @asin(double %8)
%10 = fmul double %5, %9
ret double %10
}

LLVM IR (-O2):
define double @r2a_fish(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @asin(double %3)
%5 = fmul double %4, %1
ret double %5
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, struct stat *, int /*<<< orphan*/);
int fstat(int fd, struct stat *sptr) { return syscall(30, fd, sptr, 0); }


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

x86 assembly (clang, -O2):
<fstat>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1e,%edi
xor    %ecx,%ecx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @syscall(i32 30, i32 %5, %struct.stat* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = tail call i32 @syscall(i32 30, i32 %0, %struct.stat* %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int w5100_write(int, int /*<<< orphan*/ *, int);
unsigned w5100_writeGAR(uint8_t *buff) { return w5100_write(0x0001, buff, 4); }


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

x86 assembly (clang, -O2):
mov    %rdi,%rsi
mov    $0x1,%edi
mov    $0x4,%edx
jmp    1030 <w5100_write@plt>

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

LLVM IR (-O2):
define i32 @w5100_writeGAR(i32* %0) {
%2 = tail call i32 @w5100_write(i32 1, i32* %0, i32 4)
ret i32 %2
}
/* Type definitions */
struct pscnv_ib_chan {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ OUT_RING(struct pscnv_ib_chan *, int);
void BEGIN_RING_NVC0(struct pscnv_ib_chan *ch, int subc, int mthd, int len) {
  OUT_RING(ch, (0x2 << 28) | (len << 16) | (subc << 13) | (mthd >> 2));
}


x86 assembly (clang, -O0):
<BEGIN_RING_NVC0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
shl    $0x10,%esi
or     $0x20000000,%esi
mov    -0xc(%rbp),%eax
shl    $0xd,%eax
or     %eax,%esi
mov    -0x10(%rbp),%eax
sar    $0x2,%eax
or     %eax,%esi
call   1030 <OUT_RING@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BEGIN_RING_NVC0>:
shl    $0x10,%ecx
shl    $0xd,%esi
sar    $0x2,%edx
or     %edx,%esi
or     %ecx,%esi
or     $0x20000000,%esi
jmp    1030 <OUT_RING@plt>

LLVM IR (-O0):
%struct.pscnv_ib_chan = type { i32 }
define void @BEGIN_RING_NVC0(%struct.pscnv_ib_chan* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.pscnv_ib_chan*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.pscnv_ib_chan* %0, %struct.pscnv_ib_chan** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.pscnv_ib_chan*, %struct.pscnv_ib_chan** %5
%10 = load i32, i32* %8
%11 = shl i32 %10, 16
%12 = or i32 536870912, %11
%13 = load i32, i32* %6
%14 = shl i32 %13, 13
%15 = or i32 %12, %14
%16 = load i32, i32* %7
%17 = ashr i32 %16, 2
%18 = or i32 %15, %17
%19 = call i32 @OUT_RING(%struct.pscnv_ib_chan* %9, i32 %18)
ret void
}

LLVM IR (-O2):
%struct.pscnv_ib_chan = type { i32 }
define void @BEGIN_RING_NVC0(%struct.pscnv_ib_chan* %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %3, 16
%6 = shl i32 %1, 13
%7 = ashr i32 %2, 2
%8 = or i32 %6, %7
%9 = or i32 %8, %5
%10 = or i32 %9, 536870912
%11 = tail call i32 @OUT_RING(%struct.pscnv_ib_chan* %0, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char string[] = "Karan";
  printf("hello, %s\n", string);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xedc(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x6(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x6e,0x4(%rsp)
movl   $0x6172614b,(%rsp)
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.string = [6 x i8] c"Karan\00"
@.str = [11 x i8] c"hello, %s\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = bitcast [6 x i8]* %1 to i8*
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [6 x i8] c"Karan\00"
@.str = [11 x i8] c"hello, %s\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void fistp_m32(unsigned int *m32) {
  put8(0xDB);
  put8(0x1D);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<fistp_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xdb,%edi
call   1030 <put8@plt>
mov    $0x1d,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fistp_m32>:
push   %rbx
mov    %rdi,%rbx
mov    $0xdb,%edi
call   1030 <put8@plt>
mov    $0x1d,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @fistp_m32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @put8(i32 219)
%4 = call i32 @put8(i32 29)
%5 = load i32*, i32** %2
%6 = ptrtoint i32* %5 to i32
%7 = call i32 @put32(i32 %6)
ret void
}

LLVM IR (-O2):
define void @fistp_m32(i32* %0) {
%2 = tail call i32 @put8(i32 219)
%3 = tail call i32 @put8(i32 29)
%4 = ptrtoint i32* %0 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @put32(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void g_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<g_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):
<g_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @g_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 @g_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_B0int32_mem(int *val) {
  return ((*val) & (0xB0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B0int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 176
%6 = icmp ne i32 %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_B0int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 176
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, ...);
char *fmt_mem(unsigned long long mem, char *buf) {
  if (mem == -1L)
    sprintf(buf, "<not available>");
  else
    sprintf(buf, "%Lu MB", mem >> 20);
  return buf;
}


x86 assembly (clang, -O0):
<fmt_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x8(%rbp)
jne    1142 <fmt_mem+0x32>
mov    -0x10(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    115c <fmt_mem+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
shr    $0x14,%rdx
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_mem>:
push   %rbx
mov    %rsi,%rbx
cmp    $0xffffffffffffffff,%rdi
je     1134 <fmt_mem+0x24>
mov    %rdi,%rdx
shr    $0x14,%rdx
lea    0xee8(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
jmp    113e <fmt_mem+0x2e>
movups 0xec5(%rip),%xmm0
movups %xmm0,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"<not available>\00"
@.str.1 = [7 x i8] c"%Lu MB\00"
define i8* @fmt_mem(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %15
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i64, i64* %3
%13 = lshr i64 %12, 20
%14 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %13)
br label %15
15: ; preds = %10, %7
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
@.str = [16 x i8] c"<not available>\00"
@.str.1 = [7 x i8] c"%Lu MB\00"
define i8* @fmt_mem(i64 %0, i8* returned writeonly %1) {
%3 = icmp eq i64 %0, -1
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(16) %1, i8* align 1 dereferenceable(16) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 16, i1 false)
br label %8
5: ; preds = %2
%6 = lshr i64 %0, 20
%7 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %6)
br label %8
8: ; preds = %5, %4
ret i8* %1
}
void sc_flops_papi(float *rtime, float *ptime, long long *flpops,
                   float *mflops) {
  *rtime = *ptime = *mflops = 0.;
  *flpops = 0;
}


x86 assembly (clang, -O0):
<sc_flops_papi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_flops_papi>:
movl   $0x0,(%rcx)
movl   $0x0,(%rsi)
movl   $0x0,(%rdi)
movq   $0x0,(%rdx)
ret

LLVM IR (-O0):
define void @sc_flops_papi(float* %0, float* %1, i64* %2, float* %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca i64*
%8 = alloca float*
store float* %0, float** %5
store float* %1, float** %6
store i64* %2, i64** %7
store float* %3, float** %8
%9 = load float*, float** %8
store float 0.000000e+00, float* %9
%10 = load float*, float** %6
store float 0.000000e+00, float* %10
%11 = load float*, float** %5
store float 0.000000e+00, float* %11
%12 = load i64*, i64** %7
store i64 0, i64* %12
ret void
}

LLVM IR (-O2):
define void @sc_flops_papi(float* nocapture writeonly %0, float* nocapture writeonly %1, i64* nocapture writeonly %2, float* nocapture writeonly %3) {
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %1
store float 0.000000e+00, float* %0
store i64 0, i64* %2
ret void
}
float fahrtocelsius(float fahr) {
  float x = (float)5.0 * (fahr - 32.0) / 9.0;
  return x;
}


x86 assembly (clang, -O0):
<fahrtocelsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xef6(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrtocelsius>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahrtocelsius(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fsub double %5, 3.200000e+01
%7 = fmul double 5.000000e+00, %6
%8 = fdiv double %7, 9.000000e+00
%9 = fptrunc double %8 to float
store float %9, float* %3
%10 = load float, float* %3
ret float %10
}

LLVM IR (-O2):
define float @fahrtocelsius(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 5.000000e+00
%5 = fdiv double %4, 9.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ function_which_doesnt_give_up_nested(int *, int *);
scalar_t__ malloc(int);
void coverage8(int *x) {
  int y;
  function_which_doesnt_give_up_nested(x, &y);
  y = (*x) / y;
  char *m = (char *)malloc(12);
}


x86 assembly (clang, -O0):
<coverage8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <function_which_doesnt_give_up_nested@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0xc(%rbp)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coverage8>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rsi
call   1040 <function_which_doesnt_give_up_nested@plt>
mov    (%rbx),%eax
cltd
idivl  0xc(%rsp)
mov    %eax,0xc(%rsp)
mov    $0xc,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @coverage8(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @function_which_doesnt_give_up_nested(i32* %5, i32* %3)
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = load i32, i32* %3
%10 = sdiv i32 %8, %9
store i32 %10, i32* %3
%11 = call i64 @malloc(i32 12)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
ret void
}

LLVM IR (-O2):
define void @coverage8(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @function_which_doesnt_give_up_nested(i32* %0, i32* %2)
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = sdiv i32 %5, %6
store i32 %7, i32* %2
%8 = call i64 @malloc(i32 12)
ret void
}
unsigned long pow2(unsigned order) { return (1ul << order); }


x86 assembly (clang, -O0):
<pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @pow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = shl i64 1, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @pow2(i32 %0) {
%2 = zext i32 %0 to i64
%3 = shl nuw i64 1, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int compare(int x, int y) {
  if (x == y) {
    printf("true");
  } else {
    printf("false");
  }
  return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113b <compare+0x2b>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
jmp    1147 <compare+0x37>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
push   %rax
cmp    %esi,%edi
lea    0xee6(%rip),%rax
lea    0xee4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i32 @compare(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 = icmp eq i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i32 @compare(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
ret i32 0
}
/* Variables and functions */
int is_binary_palindrome(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  printf("%d\n", is_binary_palindrome(number));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 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 = call i32 @is_binary_palindrome(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handle_58(int /*<<< orphan*/);
int gen_58() {
  handle_58(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_58() {
%1 = call i32 @handle_58(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_58() {
%1 = tail call i32 @handle_58(i32 0)
ret i32 0
}
char *strdup(const char *str) { return "from foo"; }


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"from foo\00"
define i8* @strdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"from foo\00"
define i8* @strdup(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
double logical_not(double a) { return a == 0.0; }


x86 assembly (clang, -O0):
<logical_not>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<logical_not>:
xorpd  %xmm1,%xmm1
cmpeqsd %xmm1,%xmm0
movsd  0xeef(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @logical_not(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @logical_not(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = uitofp i1 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ __udivmoddi4(unsigned long long, unsigned long long,
                                unsigned long long *);
unsigned long long __umoddi3(unsigned long long u, unsigned long long v) {
  unsigned long long w;
  (void)__udivmoddi4(u, v, &w);
  return w;
}


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

x86 assembly (clang, -O2):
<__umoddi3>:
push   %rax
mov    %rsp,%rdx
call   1030 <__udivmoddi4@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @__umoddi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @__udivmoddi4(i64 %0, i64 %1, i64* %3)
%6 = load i64, i64* %3
ret i64 %6
}
/* Variables and functions */
char *gnu_get_libc_version();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s", gnu_get_libc_version());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gnu_get_libc_version@plt>
mov    %rax,%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i8* (...) @gnu_get_libc_version()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
float *mat2_zero(float *result) {
  result[0] = 0.0f;
  result[1] = 0.0f;
  result[2] = 0.0f;
  result[3] = 0.0f;
  return result;
}


x86 assembly (clang, -O0):
<mat2_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat2_zero>:
mov    %rdi,%rax
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define float* @mat2_zero(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 3
store float 0.000000e+00, float* %10
%11 = load float*, float** %2
ret float* %11
}

LLVM IR (-O2):
define float* @mat2_zero(float* returned writeonly %0) {
%2 = bitcast float* %0 to i8*
ret float* %0
}
/* Variables and functions */
double M_PI;
double sin(double);
double backEaseInd(double p) { return p * p * p - p * sin(p * M_PI); }


x86 assembly (clang, -O0):
<backEaseInd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2e9c(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backEaseInd>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    0x2eb9(%rip),%rax
movsd  (%rax),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @backEaseInd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = load double, double* %2
%8 = load double, double* %2
%9 = load double, double* @M_PI
%10 = fmul double %8, %9
%11 = call double @sin(double %10)
%12 = fmul double %7, %11
%13 = fneg double %12
%14 = call double @llvm.fmuladd.f64(double %5, double %6, double %13)
ret double %14
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @backEaseInd(double %0) {
%2 = fmul double %0, %0
%3 = load double, double* @M_PI
%4 = fmul double %3, %0
%5 = tail call double @sin(double %4)
%6 = fneg double %5
%7 = fmul double %6, %0
%8 = tail call double @llvm.fmuladd.f64(double %2, double %0, double %7)
ret double %8
}
void userlock_lock(volatile int *userlock) { *userlock = 1; }


x86 assembly (clang, -O0):
<userlock_lock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<userlock_lock>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @userlock_lock(i32* %0) {
store volatile i32 1, i32* %0
ret void
}
/* Variables and functions */
void outstring(char *s) {
  extern void putc(int);
  while (*s)
    putc(*s++);
}


x86 assembly (clang, -O0):
<outstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <outstring+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putc@plt>
jmp    111c <outstring+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outstring>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <outstring+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <outstring+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @outstring(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
tail call void @putc(i32 %8)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void glutIdleFunc(void (*func)()) {}


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

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

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

LLVM IR (-O2):
define void @glutIdleFunc(void (...)* nocapture %0) {
ret void
}
unsigned short int f69(unsigned short int x, int y) {
  return (x << y) + (x >> (8 * 2 - y));
}


x86 assembly (clang, -O0):
<f69>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f69>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    $0x10,%dl
sub    %cl,%dl
mov    %edx,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f69(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i32, i32* %4
%12 = sub nsw i32 16, %11
%13 = ashr i32 %10, %12
%14 = add nsw i32 %8, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @f69(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = shl i32 %3, %1
%5 = sub nsw i32 16, %1
%6 = lshr i32 %3, %5
%7 = add nsw i32 %6, %4
%8 = trunc i32 %7 to i16
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ BMP_clear();
int /*<<< orphan*/ BMP_flip();
int /*<<< orphan*/ BMP_setFlags(unsigned short);
int /*<<< orphan*/ _bmp_init();
int /*<<< orphan*/ initTilemap(int);
void BMP_init(unsigned short flags) {
  _bmp_init();
  BMP_setFlags(0);
  initTilemap(0);
  initTilemap(1);
  BMP_clear();
  BMP_flip();
  BMP_clear();
  BMP_flip();
  BMP_setFlags(flags);
}


x86 assembly (clang, -O0):
<BMP_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1060 <_bmp_init@plt>
xor    %edi,%edi
call   1030 <BMP_setFlags@plt>
xor    %edi,%edi
call   1050 <initTilemap@plt>
mov    $0x1,%edi
call   1050 <initTilemap@plt>
mov    $0x0,%al
call   1040 <BMP_clear@plt>
mov    $0x0,%al
call   1070 <BMP_flip@plt>
mov    $0x0,%al
call   1040 <BMP_clear@plt>
mov    $0x0,%al
call   1070 <BMP_flip@plt>
movzwl -0x2(%rbp),%edi
call   1030 <BMP_setFlags@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMP_init>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <_bmp_init@plt>
xor    %edi,%edi
call   1030 <BMP_setFlags@plt>
xor    %edi,%edi
call   1050 <initTilemap@plt>
mov    $0x1,%edi
call   1050 <initTilemap@plt>
xor    %eax,%eax
call   1040 <BMP_clear@plt>
xor    %eax,%eax
call   1070 <BMP_flip@plt>
xor    %eax,%eax
call   1040 <BMP_clear@plt>
xor    %eax,%eax
call   1070 <BMP_flip@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <BMP_setFlags@plt>

LLVM IR (-O0):
define void @BMP_init(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 (...) @_bmp_init()
%4 = call i32 @BMP_setFlags(i16 zeroext 0)
%5 = call i32 @initTilemap(i32 0)
%6 = call i32 @initTilemap(i32 1)
%7 = call i32 (...) @BMP_clear()
%8 = call i32 (...) @BMP_flip()
%9 = call i32 (...) @BMP_clear()
%10 = call i32 (...) @BMP_flip()
%11 = load i16, i16* %2
%12 = call i32 @BMP_setFlags(i16 zeroext %11)
ret void
}

LLVM IR (-O2):
define void @BMP_init(i16 zeroext %0) {
%2 = tail call i32 (...) @_bmp_init()
%3 = tail call i32 @BMP_setFlags(i16 zeroext 0)
%4 = tail call i32 @initTilemap(i32 0)
%5 = tail call i32 @initTilemap(i32 1)
%6 = tail call i32 (...) @BMP_clear()
%7 = tail call i32 (...) @BMP_flip()
%8 = tail call i32 (...) @BMP_clear()
%9 = tail call i32 (...) @BMP_flip()
%10 = tail call i32 @BMP_setFlags(i16 zeroext %0)
ret void
}