xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ quote;

/* Variables and functions */
int /*<<< orphan*/ printMessage(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char quote[] = "Cookies make you fat";
  printf("The address of quote is %p\n", &quote);
  printf("quote occupies %i bytes\n", sizeof(quote));
  printMessage(quote);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec0(%rip),%al
mov    %al,-0xc(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x15,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <printMessage@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x74616620756f79,%rax
mov    %rax,0xd(%rsp)
lea    0xecf(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x15,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <printMessage@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.quote = [21 x i8] c"Cookies make you fat\00"
@.str = [28 x i8] c"The address of quote is %p\0A\00"
@.str.1 = [25 x i8] c"quote occupies %i bytes\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i8]
store i32 0, i32* %1
%3 = bitcast [21 x i8]* %2 to i8*
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), [21 x i8]* %2)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i64 21)
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%7 = call i32 @printMessage(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.quote = [21 x i8] c"Cookies make you fat\00"
@.str = [28 x i8] c"The address of quote is %p\0A\00"
@.str.1 = [25 x i8] c"quote occupies %i bytes\0A\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), [21 x i8]* %1)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i64 21)
%5 = call i32 @printMessage(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_help(void) {
  printf("limit options:\n"
         "--limit avg			max average match rate: default "
         "3/hour"
         "\n"
         "                                [Packets per second unless followed "
         "by \n"
         "                                /sec /minute /hour /day postfixes]\n"
         "--limit-burst number		number to match in a burst, -1 < "
         "number < 10001,\n"
         "                                default %u\n"
         "\n",
         5);
}


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

x86 assembly (clang, -O2):
<print_help>:
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [323 x i8] c"limit options:\0A--limit avg\09\09\09max average match rate: default 3/hour\0A [Packets per second unless followed by \0A /sec /minute /hour /day postfixes]\0A--limit-burst number\09\09number to match in a burst, -1 < number < 10001,\0A default %u\0A\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([323 x i8], [323 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}

LLVM IR (-O2):
@.str = [323 x i8] c"limit options:\0A--limit avg\09\09\09max average match rate: default 3/hour\0A [Packets per second unless followed by \0A /sec /minute /hour /day postfixes]\0A--limit-burst number\09\09number to match in a burst, -1 < number < 10001,\0A default %u\0A\0A\00"
define void @print_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([323 x i8], [323 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eint2ISR_Handler();
void eint2ISR(void) { eint2ISR_Handler(); }


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

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

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

LLVM IR (-O2):
define void @eint2ISR() {
%1 = tail call i32 (...) @eint2ISR_Handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
void h(void) { f(); }


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

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

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

LLVM IR (-O2):
define void @h() {
%1 = tail call i32 (...) @f()
ret void
}
int fun357() { return 357; }


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

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

LLVM IR (-O0):
define i32 @fun357() {
ret i32 357
}

LLVM IR (-O2):
define i32 @fun357() {
ret i32 357
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double d2mce_mtime() {
  double gettime;
  struct timeval now;
  gettimeofday(&now, 0);
  gettime = 1000000 * now.tv_sec + now.tv_usec;
  gettime /= 1000000;
  return gettime;
}


x86 assembly (clang, -O0):
<d2mce_mtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2mce_mtime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define double @d2mce_mtime() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 1000000, %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sitofp i32 %9 to double
store double %10, double* %1
%11 = load double, double* %1
%12 = fdiv double %11, 1.000000e+06
store double %12, double* %1
%13 = load double, double* %1
ret double %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define double @d2mce_mtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.000000e+06
ret double %11
}
/* Variables and functions */
scalar_t__ strlen(char *);
int center(char *str) { return 28 - (((int)strlen(str) + 1) / 2); }


x86 assembly (clang, -O0):
<center>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0x1c,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<center>:
push   %rax
call   1030 <strlen@plt>
mov    %eax,%ecx
add    $0x1,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
add    $0x1,%ecx
sar    %ecx
mov    $0x1c,%eax
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @center(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, 1
%7 = sdiv i32 %6, 2
%8 = sub nsw i32 28, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @center(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add nsw i32 %3, 1
%5 = sdiv i32 %4, -2
%6 = add nsw i32 %5, 28
ret i32 %6
}
void foo_2_2_2_2_2_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_2_2_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
char *strcat(char *dst, const char *src) {
  int len = strlen(dst);
  strcpy(dst + len, src);
  return dst;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8*, i8** %4
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %0
}
void print(char *a, char *b) {
  (void)a;
  (void)b;
}


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

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

LLVM IR (-O0):
define void @print(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @print(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void spi_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<spi_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @spi_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int last_one01(unsigned int u0, unsigned int u1) {
  if (u1) {
    return 53 - __builtin_ctz(u1);
  }
  return 26 - __builtin_ctz(u0);
}


x86 assembly (clang, -O0):
<last_one01>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1129 <last_one01+0x29>
mov    -0xc(%rbp),%eax
bsf    %eax,%ecx
mov    $0x35,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <last_one01+0x39>
mov    -0x8(%rbp),%eax
bsf    %eax,%ecx
mov    $0x1a,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_one01>:
test   %esi,%esi
cmovne %esi,%edi
mov    $0x1a,%ecx
mov    $0x35,%eax
cmove  %ecx,%eax
bsf    %edi,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @last_one01(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %5
%10 = call i32 @llvm.cttz.i32(i32 %9, i1 true)
%11 = sub nsw i32 53, %10
store i32 %11, i32* %3
br label %16
12: ; preds = %2
%13 = load i32, i32* %4
%14 = call i32 @llvm.cttz.i32(i32 %13, i1 true)
%15 = sub nsw i32 26, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @last_one01(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 26, i32 53
%6 = tail call i32 @llvm.cttz.i32(i32 %4, i1 true)
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void s68k_handle_opcode_dummy(void) {
  fprintf(stderr, "This function should never be called\n");
  abort();
}


x86 assembly (clang, -O0):
<s68k_handle_opcode_dummy>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<s68k_handle_opcode_dummy>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"This function should never be called\0A\00"
define void @s68k_handle_opcode_dummy() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"This function should never be called\0A\00"
define void @s68k_handle_opcode_dummy() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
unsigned long strtoul(char const *, char **, unsigned int);
unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base) {
  return strtoul(cp, endp, base);
}


x86 assembly (clang, -O0):
<simple_strtoul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtoul@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_strtoul>:
jmp    1030 <strtoul@plt>

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

LLVM IR (-O2):
define i64 @simple_strtoul(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoul(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int f_underline() { return fputs("[4m", stdout); }


x86 assembly (clang, -O0):
<f_underline>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_underline>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[4m\00"
@stdout = global i32 0
define i32 @f_underline() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[4m\00"
@stdout = global i32 0
define i32 @f_underline() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
int fn_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(
    char const *);
int fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(i8* %0) {
%2 = tail call i32 @fn_sq_ch_68_ch_97_ch_116_ch_97_ch_77_ch_97_ch_120_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(i8* %0)
ret i32 %2
}
void brd_fpath(fpath, board, fname) char *fpath;
char *board;
char *fname;
{
  *fpath++ = 'b';
  *fpath++ = 'r';
  *fpath++ = 'd';
  mak_fpath(fpath, board, fname);
}


x86 assembly (clang, -O0):
<brd_fpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x62,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x72,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x64,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <mak_fpath@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brd_fpath>:
movw   $0x7262,(%rdi)
movb   $0x64,0x2(%rdi)
add    $0x3,%rdi
xor    %eax,%eax
jmp    1030 <mak_fpath@plt>

LLVM IR (-O0):
define void @brd_fpath(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %4
store i8 98, i8* %7
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %4
store i8 114, i8* %9
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
store i8 100, i8* %11
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @mak_fpath to i32 (i8*, i8*, i8*, ...)*)(i8* %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @brd_fpath(i8* %0, i8* %1, i8* %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 98, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 2
store i8 114, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 3
store i8 100, i8* %5
%7 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @mak_fpath to i32 (i8*, i8*, i8*, ...)*)(i8* %6, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_lexval();
int yyselect();
arithmatic_low_level() {
  switch (yyselect()) {
  case 37: {
    get_lexval();
  } break;
  case 38: {
    get_lexval();
  } break;
  }
}


x86 assembly (clang, -O0):
<arithmatic_low_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x25,%eax
je     1153 <arithmatic_low_level+0x33>
jmp    1142 <arithmatic_low_level+0x22>
mov    -0x8(%rbp),%eax
sub    $0x26,%eax
je     115f <arithmatic_low_level+0x3f>
jmp    1166 <arithmatic_low_level+0x46>
mov    $0x0,%al
call   1040 <get_lexval@plt>
jmp    1166 <arithmatic_low_level+0x46>
mov    $0x0,%al
call   1040 <get_lexval@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arithmatic_low_level>:
push   %rax
xor    %eax,%eax
call   1030 <yyselect@plt>
add    $0xffffffdb,%eax
cmp    $0x1,%eax
ja     1137 <arithmatic_low_level+0x17>
xor    %eax,%eax
call   1040 <get_lexval@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @arithmatic_low_level() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %7 [
i32 37, label %3
i32 38, label %5
]
3: ; preds = %0
%4 = call i32 (...) @get_lexval()
br label %7
5: ; preds = %0
%6 = call i32 (...) @get_lexval()
br label %7
7: ; preds = %0, %5, %3
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @arithmatic_low_level() {
%1 = tail call i32 (...) @yyselect()
%2 = add i32 %1, -37
%3 = icmp ult i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @get_lexval()
br label %6
6: ; preds = %0, %4
ret i32 undef
}
void in_egroup_p(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<in_egroup_p>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_egroup_p>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.in_egroup_p = [12 x i8] c"in_egroup_p\00"
define void @in_egroup_p() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.in_egroup_p, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.in_egroup_p = [12 x i8] c"in_egroup_p\00"
define void @in_egroup_p() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.in_egroup_p, i64 0, i64 0))
ret void
}
double my_fmax(double a, double b) { return a < b ? b : a; }


x86 assembly (clang, -O0):
<my_fmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <my_fmax+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <my_fmax+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @my_fmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %4
br label %12
10: ; preds = %2
%11 = load double, double* %3
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @my_fmax(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ add_to_history(char);
void add_dot_to_history(char dotx, char doty) {
  add_to_history(-1);
  add_to_history(dotx);
  add_to_history(doty);
}


x86 assembly (clang, -O0):
<add_dot_to_history>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0xffffffff,%edi
call   1030 <add_to_history@plt>
movsbl -0x1(%rbp),%edi
call   1030 <add_to_history@plt>
movsbl -0x2(%rbp),%edi
call   1030 <add_to_history@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_dot_to_history>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xffffffff,%edi
call   1030 <add_to_history@plt>
mov    %ebp,%edi
call   1030 <add_to_history@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <add_to_history@plt>

LLVM IR (-O0):
define void @add_dot_to_history(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 @add_to_history(i8 signext -1)
%6 = load i8, i8* %3
%7 = call i32 @add_to_history(i8 signext %6)
%8 = load i8, i8* %4
%9 = call i32 @add_to_history(i8 signext %8)
ret void
}

LLVM IR (-O2):
define void @add_dot_to_history(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @add_to_history(i8 signext -1)
%4 = tail call i32 @add_to_history(i8 signext %0)
%5 = tail call i32 @add_to_history(i8 signext %1)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *xcalloc(size_t count, size_t sz) {
  void *ptr = NULL;
  if (count == 0 || sz == 0)
    return (NULL);
  ptr = calloc(count, sz);
  return (ptr);
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113e <xcalloc+0x2e>
cmpq   $0x0,-0x18(%rbp)
jne    114b <xcalloc+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    1164 <xcalloc+0x54>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
test   %rdi,%rdi
je     111f <xcalloc+0xf>
test   %rsi,%rsi
je     111f <xcalloc+0xf>
jmp    1030 <calloc@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp eq i64 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @calloc(i64 %0, i64 %1)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ get_string(char *, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze(char *, int /*<<< orphan*/);
int main(void) {
  char string[100];
  get_string(string, 100);
  squeeze(string, getchar());
  printf("%s\n", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1040 <get_string@plt>
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x78(%rbp),%rdi
mov    %eax,%esi
call   1030 <squeeze@plt>
lea    -0x70(%rbp),%rsi
lea    0xe7b(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <get_string@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <squeeze@plt>
lea    0xe93(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_string(i8* %2, i32 100)
%4 = call i32 (...) @getchar()
%5 = call i32 @squeeze(i8* %2, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ closefrom_fallback(int);
void closefrom(int lowfd) { closefrom_fallback(lowfd); }


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

x86 assembly (clang, -O2):
<closefrom>:
jmp    1030 <closefrom_fallback@plt>

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

LLVM IR (-O2):
define void @closefrom(i32 %0) {
%2 = tail call i32 @closefrom_fallback(i32 %0)
ret void
}
int fib(int x) {
  if (x <= 2) {
    return 1;
  } else {
    return fib(x - 1) + fib(x - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fib+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x4,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 5
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
void write_msr(unsigned int msr, unsigned long value) {
  __asm__ __volatile__("wrmsr" : : "c"(msr), "A"(value));
}


x86 assembly (clang, -O0):
<write_msr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
wrmsr
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_msr>:
mov    %rsi,%rax
mov    %edi,%ecx
wrmsr
ret

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

LLVM IR (-O2):
define void @write_msr(i32 %0, i64 %1) {
tail call void asm sideeffect "wrmsr", "{cx},A,~{dirflag},~{fpsr},~{flags}"(i32 %0, i64 %1)
ret void
}
/* Type definitions */
struct tempfile {
  int dummy;
};

/* Variables and functions */
struct tempfile *mks_tempfile_sm(char const *, int /*<<< orphan*/, int);
struct tempfile *mks_tempfile(const char *filename_template) {
  return mks_tempfile_sm(filename_template, 0, 0600);
}


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

x86 assembly (clang, -O2):
<mks_tempfile>:
xor    %esi,%esi
mov    $0x180,%edx
jmp    1030 <mks_tempfile_sm@plt>

LLVM IR (-O0):
%struct.tempfile = type { i32 }
define %struct.tempfile* @mks_tempfile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.tempfile* @mks_tempfile_sm(i8* %3, i32 0, i32 384)
ret %struct.tempfile* %4
}

LLVM IR (-O2):
%struct.tempfile = type { i32 }
define %struct.tempfile* @mks_tempfile(i8* %0) {
%2 = tail call %struct.tempfile* @mks_tempfile_sm(i8* %0, i32 0, i32 384)
ret %struct.tempfile* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long int fsize(FILE *file) {
  long int size;
  fseek(file, 0L, SEEK_END);
  size = ftell(file);
  fseek(file, 0L, SEEK_SET);
  return size;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i64 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i64 0, i32 %10)
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fsize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i64 0, i32 %5)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ draw_gameover();
int /*<<< orphan*/ sound_play(int);
void state_gameover_init() {
  sound_play(2);
  draw_gameover();
}


x86 assembly (clang, -O0):
<state_gameover_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <sound_play@plt>
mov    $0x0,%al
call   1040 <draw_gameover@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<state_gameover_init>:
push   %rax
mov    $0x2,%edi
call   1030 <sound_play@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <draw_gameover@plt>

LLVM IR (-O0):
define void @state_gameover_init() {
%1 = call i32 @sound_play(i32 2)
%2 = call i32 (...) @draw_gameover()
ret void
}

LLVM IR (-O2):
define void @state_gameover_init() {
%1 = tail call i32 @sound_play(i32 2)
%2 = tail call i32 (...) @draw_gameover()
ret void
}
int gcd2nums(int p, int q) {
  if (0 == p) {
    return q;
  }
  return gcd2nums(q % p, p);
}


x86 assembly (clang, -O0):
<gcd2nums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1134 <gcd2nums+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <gcd2nums+0x38>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd2nums@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd2nums>:
mov    %esi,%eax
test   %edi,%edi
je     111d <gcd2nums+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd2nums+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd2nums(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %6, %4 ]
ret i32 %10
}
int sb_compat_status_code(int waitstatus) {
  int rv = waitstatus;
  return rv;
}


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

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

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

LLVM IR (-O2):
define i32 @sb_compat_status_code(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ st7036_contrast(int);
void lcd_contrast(int c) {
  int con;
  if (c < 0)
    con = 40;
  else
    con = c;
  st7036_contrast(con);
}


x86 assembly (clang, -O0):
<lcd_contrast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1131 <lcd_contrast+0x21>
movl   $0x28,-0x8(%rbp)
jmp    1137 <lcd_contrast+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <st7036_contrast@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_contrast>:
test   %edi,%edi
mov    $0x28,%eax
cmovs  %eax,%edi
jmp    1030 <st7036_contrast@plt>

LLVM IR (-O0):
define void @lcd_contrast(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 40, i32* %3
br label %9
7: ; preds = %1
%8 = load i32, i32* %2
store i32 %8, i32* %3
br label %9
9: ; preds = %7, %6
%10 = load i32, i32* %3
%11 = call i32 @st7036_contrast(i32 %10)
ret void
}

LLVM IR (-O2):
define void @lcd_contrast(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 40, i32 %0
%4 = tail call i32 @st7036_contrast(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int acpt_write(int /*<<< orphan*/ *, char const *, int);
int strlen(char const *);
int acpt_puts(BIO *bp, const char *str) {
  int n, ret;
  n = strlen(str);
  ret = acpt_write(bp, str, n);
  return (ret);
}


x86 assembly (clang, -O0):
<acpt_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <acpt_write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acpt_puts>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <acpt_write@plt>

LLVM IR (-O0):
define i32 @acpt_puts(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @acpt_write(i32* %9, i8* %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
define i32 @acpt_puts(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @acpt_write(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void WriteNumber(FILE *fp, int num) { fprintf(fp, "%.11d", num); }


x86 assembly (clang, -O0):
<WriteNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteNumber>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.11d\00"
define void @WriteNumber(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.11d\00"
define void @WriteNumber(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void handle_VTALRM(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_VTALRM(i32 %0) {
ret void
}
const func5(param) int param;
{ return param; }


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

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

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

LLVM IR (-O2):
define i32 @func5(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ SIGCONT;
int tgkill(int, int, int /*<<< orphan*/);
int main(void) { return tgkill(-1, -1, SIGCONT); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1030 <tgkill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
jmp    1030 <tgkill@plt>

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

LLVM IR (-O2):
@SIGCONT = global i32 0
define i32 @main() {
%1 = load i32, i32* @SIGCONT
%2 = tail call i32 @tgkill(i32 -1, i32 -1, i32 %1)
ret i32 %2
}
void _Z5__GERv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @_Z5__GERv() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void RunEncryptionKeySchedule(uint8_t *key, uint8_t *roundKeys) {
  memcpy((void *)roundKeys, (void *)key, 10);
}


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

x86 assembly (clang, -O2):
<RunEncryptionKeySchedule>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0xa,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @RunEncryptionKeySchedule(i32* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %0 to i8*
%5 = tail call i32 @memcpy(i8* %3, i8* %4, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lmrgum_(double *, double *, int *);
void clmrgum(double *para, double *xmom, int nmom) {
  lmrgum_(para, xmom, &nmom);
}


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

x86 assembly (clang, -O2):
<clmrgum>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <lmrgum_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @clmrgum(double* %0, double* %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @lmrgum_(double* %0, double* %1, i32* %4)
ret void
}