xunge/DecIR huggingface dataset:
/* Variables and functions */
double log10(double);
double a2dB(double amplitude) {
  return (amplitude <= 1e-5) ? (-100.0) : 20.0 * log10(amplitude);
}


x86 assembly (clang, -O0):
<a2dB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     1142 <a2dB+0x32>
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1160 <a2dB+0x50>
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a2dB>:
push   %rax
movsd  0xeef(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    112e <a2dB+0x1e>
call   1030 <log10@plt>
mulsd  0xee4(%rip),%xmm0
pop    %rax
ret
movsd  0xeca(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @a2dB(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double %3, 1.000000e-05
br i1 %4, label %5, label %6
5: ; preds = %1
br label %10
6: ; preds = %1
%7 = load double, double* %2
%8 = call double @log10(double %7)
%9 = fmul double 2.000000e+01, %8
br label %10
10: ; preds = %6, %5
%11 = phi double [ -1.000000e+02, %5 ], [ %9, %6 ]
ret double %11
}

LLVM IR (-O2):
define double @a2dB(double %0) {
%2 = fcmp ugt double %0, 1.000000e-05
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call double @log10(double %0)
%5 = fmul double %4, 2.000000e+01
br label %6
6: ; preds = %1, %3
%7 = phi double [ %5, %3 ], [ -1.000000e+02, %1 ]
ret double %7
}
__attribute__((no, noclone)) int bar(int i) {
  volatile int v[4];
  int *p;
  v[i] = 6;
  p = (int *)&v[i];
  *p = 8;
  return v[i];
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movl   $0x6,-0x20(%rbp,%rax,4)
movslq -0x4(%rbp),%rcx
lea    -0x20(%rbp),%rax
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x8,(%rax)
movslq -0x4(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movslq %edi,%rax
movl   $0x6,-0x18(%rsp,%rax,4)
movl   $0x8,-0x18(%rsp,%rax,4)
mov    -0x18(%rsp,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
%4 = alloca i32*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %6
store volatile i32 6, i32* %7
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %9
store i32* %10, i32** %4
%11 = load i32*, i32** %4
store i32 8, i32* %11
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %13
%15 = load volatile i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 %4
store volatile i32 6, i32* %5
store i32 8, i32* %5
%6 = load volatile i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ final_greeting(char *, int, char *);
main() { final_greeting("hi %d %s\n", 5, "hello"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x5,%esi
lea    0xee3(%rip),%rdx
call   1030 <final_greeting@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"hi %d %s\0A\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @main() {
%1 = call i32 @final_greeting(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"hi %d %s\0A\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @final_greeting(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
char *strcpy(char *dest, const char *src) {
  while ((*dest++ = *src++))
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <strcpy+0x3b>
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %8
}
/* Variables and functions */
long strtol(char const *, void *, int /*<<< orphan*/);
long atol(const char *str) { return strtol(str, ((void *)0), 0); }


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

x86 assembly (clang, -O2):
<atol>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i64 @atol(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i8* null, i32 0)
ret i64 %4
}

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i8* null, i32 0)
ret i64 %2
}
void foo() {
  int X;
  X = sizeof(void (*(*)())());
  X = sizeof(int (*)(int, float, ...));
  X = sizeof(void (*(int arga, void (*argb)(double Y)))(void *Z));
}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
x() { printf("x()\n"); }


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

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

LLVM IR (-O2):
@str = [4 x i8] c"x()\00"
define i32 @x() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int p(int i) { return i / 2; }


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @p(i32 %0) {
%2 = sdiv i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int file_is_existed(const char *file_name) {
  return access(file_name, F_OK) == 0;
}


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

x86 assembly (clang, -O2):
<file_is_existed>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @file_is_existed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i64 @access(i8* %3, i32 %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @file_is_existed(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned int GPMCRevisionGet(unsigned int baseAddr) {
  unsigned int ipRev;
  ipRev = ((*((volatile unsigned int *)(baseAddr + (0x0)))) & (0x000000FFu));
  return (ipRev);
}


x86 assembly (clang, -O0):
<GPMCRevisionGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCRevisionGet>:
mov    %edi,%eax
mov    (%rax),%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @GPMCRevisionGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 0
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 255
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @GPMCRevisionGet(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = and i32 %4, 255
ret i32 %5
}
/* Type definitions */
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mg_call(struct mg_connection *, int /*<<< orphan*/ *, int,
                           char *);
void do_ssi_call(struct mg_connection *nc, char *tag) {
  mg_call(nc, NULL, 105, tag);
}


x86 assembly (clang, -O0):
<do_ssi_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
mov    $0x69,%edx
call   1030 <mg_call@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ssi_call>:
mov    %rsi,%rcx
xor    %esi,%esi
mov    $0x69,%edx
jmp    1030 <mg_call@plt>

LLVM IR (-O0):
%struct.mg_connection = type { i32 }
define void @do_ssi_call(%struct.mg_connection* %0, i8* %1) {
%3 = alloca %struct.mg_connection*
%4 = alloca i8*
store %struct.mg_connection* %0, %struct.mg_connection** %3
store i8* %1, i8** %4
%5 = load %struct.mg_connection*, %struct.mg_connection** %3
%6 = load i8*, i8** %4
%7 = call i32 @mg_call(%struct.mg_connection* %5, i32* null, i32 105, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
define void @do_ssi_call(%struct.mg_connection* %0, i8* %1) {
%3 = tail call i32 @mg_call(%struct.mg_connection* %0, i32* null, i32 105, i8* %1)
ret void
}
void pm8921_bms_stop_ocv_updates(void) {}


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

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

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

LLVM IR (-O2):
define void @pm8921_bms_stop_ocv_updates() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void cleanup_ncurses(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @cleanup_ncurses() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
unsigned long function_in_asm(int);
int /*<<< orphan*/ printf(char *, unsigned long);
int main(int argc, const char *argv[]) {
  unsigned long result = function_in_asm(0x123456789);
  printf("result (%lx) must be 0x123456789\n", result);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"result (%lx) must be 0x123456789\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 @function_in_asm(i32 591751049)
store i64 %7, i64* %6
%8 = load i64, i64* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"result (%lx) must be 0x123456789\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @function_in_asm(i32 591751049)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 0
}
void main() {
  int x, y;
L:
  goto L;
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <main+0x4>

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %3, %0
br label %3
}

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_hv24_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_long_minute(void) { printf(" L "); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c" L \00"
define void @display_long_minute() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" L \00"
define void @display_long_minute() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void destruction_liste(struct elem *liste) {}


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

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

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

LLVM IR (-O2):
%struct.elem = type opaque
define void @destruction_liste(%struct.elem* nocapture %0) {
ret void
}
void deferTO(void *p) { *(int *)p = 1; }


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

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

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

LLVM IR (-O2):
define void @deferTO(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 1, i32* %2
ret void
}
/* Variables and functions */
scalar_t__ isalpha(int);
int /*<<< orphan*/ setup_board(char *);
void cmd_fen(char *s) {
  while (isalpha((int)(*s)))
    s++;
  setup_board(s);
}


x86 assembly (clang, -O0):
<cmd_fen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     1153 <cmd_fen+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <cmd_fen+0xc>
mov    -0x8(%rbp),%rdi
call   1040 <setup_board@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_fen>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isalpha@plt>
test   %rax,%rax
jne    1130 <cmd_fen+0x10>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <setup_board@plt>

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

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


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

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

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

LLVM IR (-O2):
define void @SCR_ChangeFullscreen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i_can_not_be_propagated_fully(int *);
int i_can_not_be_propagated_fully2(int *a) {
  i_can_not_be_propagated_fully(a);
  i_can_not_be_propagated_fully(a);
  i_can_not_be_propagated_fully(a);
}


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

x86 assembly (clang, -O2):
<i_can_not_be_propagated_fully2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <i_can_not_be_propagated_fully@plt>
mov    %rbx,%rdi
call   1030 <i_can_not_be_propagated_fully@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <i_can_not_be_propagated_fully@plt>

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

LLVM IR (-O2):
define i32 @i_can_not_be_propagated_fully2(i32* %0) {
%2 = tail call i32 @i_can_not_be_propagated_fully(i32* %0)
%3 = tail call i32 @i_can_not_be_propagated_fully(i32* %0)
%4 = tail call i32 @i_can_not_be_propagated_fully(i32* %0)
ret i32 undef
}
void I_NoAppServicesJoinLobbyFromStartup(const char *ccUserID) {}


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

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

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

LLVM IR (-O2):
define void @I_NoAppServicesJoinLobbyFromStartup(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glmDiv3fs_(float *, int /*<<< orphan*/);
int /*<<< orphan*/ glmLength3f(float *);
void glmNormalize3f_(float x[3]) { glmDiv3fs_(x, glmLength3f(x)); }


x86 assembly (clang, -O0):
<glmNormalize3f_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <glmLength3f@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <glmDiv3fs_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmNormalize3f_>:
push   %rbx
mov    %rdi,%rbx
call   1040 <glmLength3f@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <glmDiv3fs_@plt>

LLVM IR (-O0):
define void @glmNormalize3f_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float*, float** %2
%5 = call i32 @glmLength3f(float* %4)
%6 = call i32 @glmDiv3fs_(float* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @glmNormalize3f_(float* %0) {
%2 = tail call i32 @glmLength3f(float* %0)
%3 = tail call i32 @glmDiv3fs_(float* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __cpuid(unsigned int *, unsigned int *, unsigned int *,
                           unsigned int *);
void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx,
           unsigned int *ecx, unsigned int *edx) {
  *eax = op;
  *ecx = 0;
  __cpuid(eax, ebx, ecx, edx);
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <__cpuid@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
mov    %edi,(%rsi)
movl   $0x0,(%rcx)
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
jmp    1030 <__cpuid@plt>

LLVM IR (-O0):
define void @cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
store i32 %11, i32* %12
%13 = load i32*, i32** %9
store i32 0, i32* %13
%14 = load i32*, i32** %7
%15 = load i32*, i32** %8
%16 = load i32*, i32** %9
%17 = load i32*, i32** %10
%18 = call i32 @__cpuid(i32* %14, i32* %15, i32* %16, i32* %17)
ret void
}

LLVM IR (-O2):
define void @cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
store i32 %0, i32* %1
store i32 0, i32* %3
%6 = tail call i32 @__cpuid(i32* %1, i32* %2, i32* %3, i32* %4)
ret void
}
/* Variables and functions */
int evaluate(char, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", evaluate('+', 5, 6));
  printf("%d\n", evaluate('-', 5, 6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2b,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1040 <evaluate@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2d,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1040 <evaluate@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2b,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1040 <evaluate@plt>
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2d,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1040 <evaluate@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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 @evaluate(i8 signext 43, i32 5, i32 6)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @evaluate(i8 signext 45, i32 5, i32 6)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @evaluate(i8 signext 43, i32 5, i32 6)
%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 @evaluate(i8 signext 45, i32 5, i32 6)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t libenjoy_invalid_inc_if_can(uint8_t val) {
  ++val;
  return val == 16 ? 0 : val;
}


x86 assembly (clang, -O0):
<libenjoy_invalid_inc_if_can>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jne    1124 <libenjoy_invalid_inc_if_can+0x24>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    112a <libenjoy_invalid_inc_if_can+0x2a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libenjoy_invalid_inc_if_can>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x10,%ecx
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @libenjoy_invalid_inc_if_can(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 16
br i1 %6, label %7, label %8
7: ; preds = %1
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %7
%11 = phi i32 [ 0, %7 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @libenjoy_invalid_inc_if_can(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = icmp eq i32 %2, 16
%4 = select i1 %3, i32 0, i32 %2
ret i32 %4
}
void hputi4(hstring, keyword, ival) char *hstring;
char *keyword;
int ival;
{
  char value[30];
  snprintf(value, 30, "%d", ival);
  hputc(hstring, keyword, value);
  return;
}


x86 assembly (clang, -O0):
<hputi4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    $0x1e,%esi
lea    0xeba(%rip),%rdx
mov    $0x0,%al
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x0,%al
call   1040 <hputc@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputi4>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ecx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec8(%rip),%rdx
mov    %rsp,%r15
mov    $0x1e,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <hputc@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @hputi4(i8* %0, i8* %1, i32 %2) {
%4 = alloca [30 x i8]
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %5, i64 30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%7 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputc to i32 (i8*, i8*, i8*, ...)*)(i8* %0, i8* %1, i8* %5)
ret void
}
void XtAppSetWarningMsgHandler() {}


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

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

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

LLVM IR (-O2):
define void @XtAppSetWarningMsgHandler() {
ret void
}
short ieee_to_int(x, iflg)
short *x;
int *iflg;
{
  *iflg = 0;
  if ((*x & 0x8000) == 0x8000)
    *iflg = 1;
  return (*x);
}


x86 assembly (clang, -O0):
<ieee_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
and    $0x8000,%eax
cmp    $0x8000,%eax
jne    1137 <ieee_to_int+0x37>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee_to_int>:
movzwl (%rdi),%eax
shr    $0xf,%eax
mov    %eax,(%rsi)
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define signext i16 @ieee_to_int(i16* %0, i32* %1) {
%3 = alloca i16*
%4 = alloca i32*
store i16* %0, i16** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
store i32 0, i32* %5
%6 = load i16*, i16** %3
%7 = load i16, i16* %6
%8 = sext i16 %7 to i32
%9 = and i32 %8, 32768
%10 = icmp eq i32 %9, 32768
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32*, i32** %4
store i32 1, i32* %12
br label %13
13: ; preds = %11, %2
%14 = load i16*, i16** %3
%15 = load i16, i16* %14
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @ieee_to_int(i16* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = lshr i16 %3, 15
%5 = zext i16 %4 to i32
store i32 %5, i32* %1
%6 = load i16, i16* %0
ret i16 %6
}
int two(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @two() {
ret i32 42
}

LLVM IR (-O2):
define i32 @two() {
ret i32 42
}
int interrupts_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @interrupts_enabled() {
ret i32 0
}
/* Variables and functions */
scalar_t__ isgraph(char const);
unsigned int skipToGraphOrNull(const char *source) {
  unsigned int i = 0;
  while (source[i] != '\0') {
    if (isgraph(source[i])) {
      break;
    }
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<skipToGraphOrNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <skipToGraphOrNull+0x54>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <isgraph@plt>
cmp    $0x0,%rax
je     1156 <skipToGraphOrNull+0x46>
jmp    1164 <skipToGraphOrNull+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <skipToGraphOrNull+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipToGraphOrNull>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113b <skipToGraphOrNull+0x2b>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movsbl %al,%edi
call   1030 <isgraph@plt>
test   %rax,%rax
jne    113d <skipToGraphOrNull+0x2d>
add    $0x1,%ebx
movzbl (%r14,%rbx,1),%eax
test   %al,%al
jne    1120 <skipToGraphOrNull+0x10>
jmp    113d <skipToGraphOrNull+0x2d>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @skipToGraphOrNull(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %13, %9 ], [ %2, %1 ]
%6 = phi i32 [ %10, %9 ], [ 0, %1 ]
%7 = tail call i64 @isgraph(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = add i32 %6, 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %9, %4, %1
%16 = phi i32 [ 0, %1 ], [ %6, %4 ], [ %10, %9 ]
ret i32 %16
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c = getchar();
  printf("got: %d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%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 <getchar@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"got: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kunmap(struct page *);
int /*<<< orphan*/ put_page(struct page *);
void ntfs_unmap_page(struct page *page) {
  kunmap(page);
  put_page(page);
}


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

x86 assembly (clang, -O2):
<ntfs_unmap_page>:
push   %rbx
mov    %rdi,%rbx
call   1040 <kunmap@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <put_page@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define void @ntfs_unmap_page(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = load %struct.page*, %struct.page** %2
%4 = call i32 @kunmap(%struct.page* %3)
%5 = load %struct.page*, %struct.page** %2
%6 = call i32 @put_page(%struct.page* %5)
ret void
}

LLVM IR (-O2):
%struct.page = type { i32 }
define void @ntfs_unmap_page(%struct.page* %0) {
%2 = tail call i32 @kunmap(%struct.page* %0)
%3 = tail call i32 @put_page(%struct.page* %0)
ret void
}
int glutStrokeStringWidth(void *fontface, const char *str) { return 0; }


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

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

LLVM IR (-O0):
define i32 @glutStrokeStringWidth(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @glutStrokeStringWidth(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void setTimeout(unsigned int cycles) {
  *((volatile unsigned int *)0x101E2000) = cycles;
}


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

x86 assembly (clang, -O2):
<setTimeout>:
mov    %edi,0x101e2000
ret

LLVM IR (-O0):
define void @setTimeout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 270409728 to i32*)
ret void
}

LLVM IR (-O2):
define void @setTimeout(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 270409728 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_WriteData(int);
void createDisruption_Two() {
  LCD_WriteData(0x0);
  LCD_WriteData(0x6);
  LCD_WriteData(0x6);
  LCD_WriteData(0xe);
  LCD_WriteData(0xe);
  LCD_WriteData(0xc);
  LCD_WriteData(0xc);
  LCD_WriteData(0x0);
}


x86 assembly (clang, -O0):
<createDisruption_Two>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x6,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x6,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xc,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xc,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<createDisruption_Two>:
push   %rax
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x6,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x6,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xc,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xc,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <LCD_WriteData@plt>

LLVM IR (-O0):
define void @createDisruption_Two() {
%1 = call i32 @LCD_WriteData(i32 0)
%2 = call i32 @LCD_WriteData(i32 6)
%3 = call i32 @LCD_WriteData(i32 6)
%4 = call i32 @LCD_WriteData(i32 14)
%5 = call i32 @LCD_WriteData(i32 14)
%6 = call i32 @LCD_WriteData(i32 12)
%7 = call i32 @LCD_WriteData(i32 12)
%8 = call i32 @LCD_WriteData(i32 0)
ret void
}

LLVM IR (-O2):
define void @createDisruption_Two() {
%1 = tail call i32 @LCD_WriteData(i32 0)
%2 = tail call i32 @LCD_WriteData(i32 6)
%3 = tail call i32 @LCD_WriteData(i32 6)
%4 = tail call i32 @LCD_WriteData(i32 14)
%5 = tail call i32 @LCD_WriteData(i32 14)
%6 = tail call i32 @LCD_WriteData(i32 12)
%7 = tail call i32 @LCD_WriteData(i32 12)
%8 = tail call i32 @LCD_WriteData(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert((10 / 1) == 1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TwDelay(int);
void TwStart(void) {
  (*((volatile unsigned int *)((0xFFFF0000 + 0x14))) = ((1 << 16)));
  TwDelay(8);
  (*((volatile unsigned int *)((0xFFFF0000 + 0x14))) = ((1 << 17)));
  TwDelay(8);
  (*((volatile unsigned int *)((0xFFFF0000 + 0x10))) = ((1 << 16)));
  TwDelay(8);
  (*((volatile unsigned int *)((0xFFFF0000 + 0x10))) = ((1 << 17)));
  TwDelay(8);
}


x86 assembly (clang, -O0):
<TwStart>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffff0014,%eax
movl   $0x10000,(%rax)
mov    $0x8,%edi
call   1030 <TwDelay@plt>
mov    $0xffff0014,%eax
movl   $0x20000,(%rax)
mov    $0x8,%edi
call   1030 <TwDelay@plt>
mov    $0xffff0010,%eax
movl   $0x10000,(%rax)
mov    $0x8,%edi
call   1030 <TwDelay@plt>
mov    $0xffff0010,%eax
movl   $0x20000,(%rax)
mov    $0x8,%edi
call   1030 <TwDelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TwStart>:
push   %rbx
mov    $0xffff0010,%ebx
movl   $0x10000,0x4(%rbx)
mov    $0x8,%edi
call   1030 <TwDelay@plt>
movl   $0x20000,0x4(%rbx)
mov    $0x8,%edi
call   1030 <TwDelay@plt>
movl   $0x10000,(%rbx)
mov    $0x8,%edi
call   1030 <TwDelay@plt>
movl   $0x20000,(%rbx)
mov    $0x8,%edi
pop    %rbx
jmp    1030 <TwDelay@plt>

LLVM IR (-O0):
define void @TwStart() {
store volatile i32 65536, i32* inttoptr (i64 4294901780 to i32*)
%1 = call i32 @TwDelay(i32 8)
store volatile i32 131072, i32* inttoptr (i64 4294901780 to i32*)
%2 = call i32 @TwDelay(i32 8)
store volatile i32 65536, i32* inttoptr (i64 4294901776 to i32*)
%3 = call i32 @TwDelay(i32 8)
store volatile i32 131072, i32* inttoptr (i64 4294901776 to i32*)
%4 = call i32 @TwDelay(i32 8)
ret void
}

LLVM IR (-O2):
define void @TwStart() {
store volatile i32 65536, i32* inttoptr (i64 4294901780 to i32*)
%1 = tail call i32 @TwDelay(i32 8)
store volatile i32 131072, i32* inttoptr (i64 4294901780 to i32*)
%2 = tail call i32 @TwDelay(i32 8)
store volatile i32 65536, i32* inttoptr (i64 4294901776 to i32*)
%3 = tail call i32 @TwDelay(i32 8)
store volatile i32 131072, i32* inttoptr (i64 4294901776 to i32*)
%4 = tail call i32 @TwDelay(i32 8)
ret void
}
int lw6map_weapon_is_valid(int weapon) { return (weapon >= 0 && weapon <= 19); }


x86 assembly (clang, -O0):
<lw6map_weapon_is_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <lw6map_weapon_is_valid+0x20>
cmpl   $0x13,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw6map_weapon_is_valid>:
xor    %eax,%eax
cmp    $0x14,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @lw6map_weapon_is_valid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 19
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @lw6map_weapon_is_valid(i32 %0) {
%2 = icmp ult i32 %0, 20
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ send_cmd(int, char *, int);
void send_cmd_i1(int cmd_code, int arg1) {
  send_cmd(cmd_code, (char *)&arg1, sizeof(int));
}


x86 assembly (clang, -O0):
<send_cmd_i1>:
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 <send_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd_i1>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <send_cmd@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @send_cmd_i1(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 = bitcast i32* %4 to i8*
%7 = call i32 @send_cmd(i32 %5, i8* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @send_cmd_i1(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = call i32 @send_cmd(i32 %0, i8* %4, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, int, char);
unsigned long please_print_number(unsigned long a, int b, char c) {
  printf("a = %lx, b = %x, c = %x\n", a, b, c);
  return a + b + c;
}


x86 assembly (clang, -O0):
<please_print_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xece(%rip),%rdi
movsbl -0xd(%rbp),%ecx
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
movsbq -0xd(%rbp),%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<please_print_number>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xedd(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <printf@plt>
movslq %ebp,%rcx
add    %rbx,%rcx
movslq %r14d,%rax
add    %rcx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"a = %lx, b = %x, c = %x\0A\00"
define i64 @please_print_number(i64 %0, i32 %1, i8 signext %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8
store i64 %0, i64* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i64, i64* %4
%8 = load i32, i32* %5
%9 = load i8, i8* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %7, i32 %8, i8 signext %9)
%11 = load i64, i64* %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = add i64 %11, %13
%15 = load i8, i8* %6
%16 = sext i8 %15 to i64
%17 = add i64 %14, %16
ret i64 %17
}

LLVM IR (-O2):
@.str = [25 x i8] c"a = %lx, b = %x, c = %x\0A\00"
define i64 @please_print_number(i64 %0, i32 %1, i8 signext %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %0, i32 %1, i8 signext %2)
%5 = sext i32 %1 to i64
%6 = add i64 %5, %0
%7 = sext i8 %2 to i64
%8 = add i64 %6, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ prune_add1(int);
void call_prune_add1_1_Good() { prune_add1(5); }


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

x86 assembly (clang, -O2):
<call_prune_add1_1_Good>:
mov    $0x5,%edi
jmp    1030 <prune_add1@plt>

LLVM IR (-O0):
define void @call_prune_add1_1_Good() {
%1 = call i32 @prune_add1(i32 5)
ret void
}

LLVM IR (-O2):
define void @call_prune_add1_1_Good() {
%1 = tail call i32 @prune_add1(i32 5)
ret void
}
void foo512(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo512(i32 %0) {
ret void
}
void cprop_result3(int *data) {
  if (data[0])
    data[1] = 11112;
  else
    data[2] = 12478;
}


x86 assembly (clang, -O0):
<cprop_result3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1125 <cprop_result3+0x25>
mov    -0x8(%rbp),%rax
movl   $0x2b68,0x4(%rax)
jmp    1130 <cprop_result3+0x30>
mov    -0x8(%rbp),%rax
movl   $0x30be,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_result3>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
sete   %al
mov    $0x30be,%ecx
mov    $0x2b68,%edx
cmove  %ecx,%edx
mov    %edx,0x4(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @cprop_result3(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i64 2, i64 1
%5 = select i1 %3, i32 12478, i32 11112
%6 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %5, i32* %6
ret void
}