xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void pr_word(char *word, uint32_t cnt) { printf("%10s: %u\n", word, cnt); }


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

x86 assembly (clang, -O2):
<pr_word>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%10s: %u\0A\00"
define void @pr_word(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ io_write8(int /*<<< orphan*/, int /*<<< orphan*/);
void outb(uint8_t value, uint16_t port) { io_write8(port, value); }


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

x86 assembly (clang, -O2):
<outb>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <io_write8@plt>

LLVM IR (-O0):
define void @outb(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 = load i32, i32* %3
%7 = call i32 @io_write8(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @outb(i32 %0, i32 %1) {
%3 = tail call i32 @io_write8(i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("value: %d\n", foo(argc));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"value: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef unsigned long long uint64_t;
typedef int /*<<< orphan*/ uint32_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint32_t get_time_usec(void) {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return (uint32_t)((uint64_t)ts.tv_sec * 1000000ULL + ts.tv_nsec / 1000);
}


x86 assembly (clang, -O0):
<get_time_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_usec>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x26,%rcx
add    %eax,%ecx
imul   $0xf4240,0x10(%rsp),%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @get_time_usec() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add i64 %6, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @get_time_usec() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = trunc i64 %6 to i32
%11 = mul i32 %10, 1000000
%12 = add i32 %11, %9
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ pr_procmask(char *);
void sig_quit(int signo) { pr_procmask("\nin sig_quit:"); }


x86 assembly (clang, -O0):
<sig_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <pr_procmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"\0Ain sig_quit:\00"
define void @sig_quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pr_procmask(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0Ain sig_quit:\00"
define void @sig_quit(i32 %0) {
%2 = tail call i32 @pr_procmask(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
void UARTDisable(unsigned long ulBase, unsigned long ulBlock) {
  ;
  ;
  while (((*((volatile unsigned long *)(ulBase + 0x00000000))) & 0x00000040) ==
         0) {
  }
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) &=
      ~ulBlock & (0x00002000 | 0x00000008 | 0x00000004);
}


x86 assembly (clang, -O0):
<UARTDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0x40,%rax
cmp    $0x0,%rax
jne    1126 <UARTDisable+0x26>
jmp    110c <UARTDisable+0xc>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
and    $0x200c,%rdx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDisable>:
testq  $0x40,(%rdi)
je     1100 <UARTDisable>
not    %esi
mov    0xc(%rdi),%rax
and    %esi,%eax
and    $0x200c,%eax
mov    %rax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @UARTDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %5
5: ; preds = %12, %2
%6 = load i64, i64* %3
%7 = add i64 %6, 0
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 64
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
%14 = load i64, i64* %4
%15 = xor i64 %14, -1
%16 = and i64 %15, 8204
%17 = load i64, i64* %3
%18 = add i64 %17, 12
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = and i64 %20, %16
store volatile i64 %21, i64* %19
ret void
}

LLVM IR (-O2):
define void @UARTDisable(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
br label %4
4: ; preds = %4, %2
%5 = load volatile i64, i64* %3
%6 = and i64 %5, 64
%7 = icmp eq i64 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = and i64 %1, 8204
%10 = xor i64 %9, 8204
%11 = add i64 %0, 12
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %10
store volatile i64 %14, i64* %12
ret void
}
int sys$cantim(unsigned long long reqidt, unsigned int acmode) {
  return ({
    unsigned long resultvar;
    register long int _a2 asm("rsi") = (long)(acmode);
    register long int _a1 asm("rdi") = (long)((long)reqidt);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(12), "r"(_a1), "r"(_a2)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$cantim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xc,%rax
int    $0x81
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$cantim>:
mov    %esi,%esi
mov    $0xc,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$cantim"(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
store i64 %10, i64* %6
%11 = load i64, i64* %3
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %6
%14 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 12, i64 %12, i64 %13)
store i64 %14, i64* %5
%15 = load i64, i64* %5
store i64 %15, i64* %8
%16 = load i64, i64* %8
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @"sys$cantim"(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 12, i64 %0, i64 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
float myFunction4() { printf("bla bla\n"); }


x86 assembly (clang, -O0):
<myFunction4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [8 x i8] c"bla bla\00"
define float @myFunction4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret float undef
}
/* Variables and functions */
int /*<<< orphan*/ f_extern();
int /*<<< orphan*/ f_first();
int /*<<< orphan*/ f_later();
void __attribute__((transaction_may_cancel_outer)) test_mco(void) {
  f_extern();
  f_first();
  f_later();
}


x86 assembly (clang, -O0):
<test_mco>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <f_extern@plt>
mov    $0x0,%al
call   1050 <f_first@plt>
mov    $0x0,%al
call   1030 <f_later@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mco>:
push   %rax
xor    %eax,%eax
call   1040 <f_extern@plt>
xor    %eax,%eax
call   1050 <f_first@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <f_later@plt>

LLVM IR (-O0):
define void @test_mco() {
%1 = call i32 (...) @f_extern()
%2 = call i32 (...) @f_first()
%3 = call i32 (...) @f_later()
ret void
}

LLVM IR (-O2):
define void @test_mco() {
%1 = tail call i32 (...) @f_extern()
%2 = tail call i32 (...) @f_first()
%3 = tail call i32 (...) @f_later()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int f2() { bar(12); }


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

x86 assembly (clang, -O2):
<f2>:
mov    $0xc,%edi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @f2() {
%1 = alloca i32
%2 = call i32 @bar(i32 12)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @f2() {
%1 = tail call i32 @bar(i32 12)
ret i32 undef
}
unsigned int spi_recv8(volatile unsigned int *base) { return *(base + 1); }


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

x86 assembly (clang, -O2):
<spi_recv8>:
mov    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @spi_recv8(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @spi_recv8(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int puts(char *s) {
  while (*s != '\0') {
    putchar(*s++);
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <puts+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @putchar(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M203_f(char *s) {
  debug("M203_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M203_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M203_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M203_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M203_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M203_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M203_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ cgiMakeDropListClassWithStyleAndJavascript(char *, char **,
                                                              int, char *,
                                                              char *, char *,
                                                              char *);
void cgiMakeDropListClassWithStyle(char *name, char *menu[], int menuSize,
                                   char *checked, char *class, char *style) {
  cgiMakeDropListClassWithStyleAndJavascript(name, menu, menuSize, checked,
                                             class, style, "");
}


x86 assembly (clang, -O0):
<cgiMakeDropListClassWithStyle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    0xeb3(%rip),%rax
mov    %rax,(%rsp)
call   1030 <cgiMakeDropListClassWithStyleAndJavascript@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiMakeDropListClassWithStyle>:
push   %rax
lea    0xee8(%rip),%rax
mov    %rax,(%rsp)
call   1030 <cgiMakeDropListClassWithStyleAndJavascript@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @cgiMakeDropListClassWithStyle(i8* %0, i8** %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i8** %1, i8*** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i8**, i8*** %8
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i32 @cgiMakeDropListClassWithStyleAndJavascript(i8* %13, i8** %14, i32 %15, i8* %16, i8* %17, i8* %18, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @cgiMakeDropListClassWithStyle(i8* %0, i8** %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 @cgiMakeDropListClassWithStyleAndJavascript(i8* %0, i8** %1, i32 %2, i8* %3, i8* %4, i8* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int matN_getIndex(int const, int const, int);
int mat3_getIndex(const int row, const int col) {
  return matN_getIndex(row, col, 3);
}


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

x86 assembly (clang, -O2):
<mat3_getIndex>:
mov    $0x3,%edx
jmp    1030 <matN_getIndex@plt>

LLVM IR (-O0):
define i32 @mat3_getIndex(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 @matN_getIndex(i32 %5, i32 %6, i32 3)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mat3_getIndex(i32 %0, i32 %1) {
%3 = tail call i32 @matN_getIndex(i32 %0, i32 %1, i32 3)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int __rsyscall(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
  return __rsyscall(208, ruid, euid, suid, 0, 0, 0);
}


x86 assembly (clang, -O0):
<setresuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xd0,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <__rsyscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setresuid>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    $0xd0,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <__rsyscall@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @setresuid(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__rsyscall(i32 208, i32 %0, i32 %1, i32 %2, i32 0, i32 0, i32 0)
ret i32 %4
}
/* Type definitions */
struct timeval {
  unsigned int tv_sec;
  unsigned int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void s_sleep(unsigned int s, unsigned int u) {
  struct timeval timeout;
  timeout.tv_sec = s;
  timeout.tv_usec = u;
  select(0, NULL, NULL, NULL, &timeout);
}


x86 assembly (clang, -O0):
<s_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_sleep>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @s_sleep(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timeval
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
store i32 %8, i32* %9
%10 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %5)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @s_sleep(i32 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_lz();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ pass();
int main(void) {
  check_lz();
  pass();
  exit(0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_lz()
%2 = tail call i32 (...) @pass()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int ENOSYS;
int xntrace_max_reset(void) { return -ENOSYS; }


x86 assembly (clang, -O0):
<xntrace_max_reset>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2edb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xntrace_max_reset>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @xntrace_max_reset() {
%1 = load i32, i32* @ENOSYS
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @xntrace_max_reset() {
%1 = load i32, i32* @ENOSYS
%2 = sub nsw i32 0, %1
ret i32 %2
}
int inrange(char ch, char lo, char hi) {
  if ((ch >= lo) && (ch <= hi))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<inrange>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %al,-0x7(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jl     1141 <inrange+0x41>
movsbl -0x5(%rbp),%eax
movsbl -0x7(%rbp),%ecx
cmp    %ecx,%eax
jg     1141 <inrange+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <inrange+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inrange>:
cmp    %sil,%dil
setge  %al
cmp    %dl,%dil
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @inrange(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = load i8, i8* %6
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %9, %11
br i1 %12, label %13, label %20
13: ; preds = %3
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = load i8, i8* %7
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %15, %17
br i1 %18, label %19, label %20
19: ; preds = %13
store i32 1, i32* %4
br label %21
20: ; preds = %13, %3
store i32 0, i32* %4
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @inrange(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = icmp sge i8 %0, %1
%5 = icmp sle i8 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ height;
  int /*<<< orphan*/ width;
};
typedef TYPE_1__ XRectangle;
typedef int /*<<< orphan*/ GC;
typedef int /*<<< orphan*/ Drawable;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XCopyArea(int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, scalar_t__, int /*<<< orphan*/,
                             int);
void blit(Display *d, Drawable p, GC gc, XRectangle r) {
  XCopyArea(d, p, p, gc, 0, 0, r.width, r.height - 1, 0, 1);
}


x86 assembly (clang, -O0):
<blit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rcx,-0x10(%rbp)
mov    %r8d,-0x8(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x8(%rbp),%r10d
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
xor    %r9d,%r9d
mov    %r9d,%r8d
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x1,0x18(%rsp)
call   1030 <XCopyArea@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blit>:
push   %rax
mov    %r8d,%r10d
mov    %rcx,%rax
mov    %edx,%ecx
add    $0xffffffffffffffff,%rax
mov    %esi,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x1
push   $0x0
push   %rax
push   %r10
call   1030 <XCopyArea@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i32 }
define void @blit(i32* %0, i32 %1, i32 %2, i64 %3, i32 %4) {
%6 = alloca %struct.TYPE_3__
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = bitcast %struct.TYPE_3__* %6 to { i64, i32 }*
%11 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %10, i32 0, i32 0
store i64 %3, i64* %11
%12 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %10, i32 0, i32 1
store i32 %4, i32* %12
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 1
%18 = load i32, i32* %17
%19 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%20 = load i64, i64* %19
%21 = sub nsw i64 %20, 1
%22 = call i32 @XCopyArea(i32* %13, i32 %14, i32 %15, i32 %16, i32 0, i32 0, i32 %18, i64 %21, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @blit(i32* %0, i32 %1, i32 %2, i64 %3, i32 %4) {
%6 = add nsw i64 %3, -1
%7 = tail call i32 @XCopyArea(i32* %0, i32 %1, i32 %1, i32 %2, i32 0, i32 0, i32 %4, i64 %6, i32 0, i32 1)
ret void
}
void GetXCR0() {}


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

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

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

LLVM IR (-O2):
define void @GetXCR0() {
ret void
}
double f4_sum_two_long(long v1, long v2) {
  return ((double)(v1)) + ((double)(v2));
}


x86 assembly (clang, -O0):
<f4_sum_two_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_two_long>:
cvtsi2sd %rdi,%xmm1
cvtsi2sd %rsi,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_two_long(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = sitofp i64 %5 to double
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to double
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @f4_sum_two_long(i64 %0, i64 %1) {
%3 = sitofp i64 %0 to double
%4 = sitofp i64 %1 to double
%5 = fadd double %3, %4
ret double %5
}
int voidargs(char c) {
  c = 'a';
  return 3;
}


x86 assembly (clang, -O0):
<voidargs>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x61,-0x1(%rbp)
mov    $0x3,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @voidargs(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
store i8 97, i8* %2
ret i32 3
}

LLVM IR (-O2):
define i32 @voidargs(i8 signext %0) {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ do_n_times(int);
void do_half_m2_times(int m) {
  for (int i = 0; i < m; i++) {
    do_n_times(i);
  }
}


x86 assembly (clang, -O0):
<do_half_m2_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1144 <do_half_m2_times+0x34>
mov    -0x8(%rbp),%edi
call   1030 <do_n_times@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <do_half_m2_times+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_half_m2_times>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112e <do_half_m2_times+0x1e>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <do_n_times@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <do_half_m2_times+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @do_half_m2_times(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @do_n_times(i32 %5)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
int close(int);
int TCPclose(int fd) { return close(fd); }


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

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

LLVM IR (-O2):
define i32 @TCPclose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int read(int, char *, int);
int serial_read(int port, char *buffer, int bufferSize) {
  return (read(port, buffer, bufferSize));
}


x86 assembly (clang, -O0):
<serial_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @serial_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Going to exit(42). Use ? in the shell to query the value.\n");
  exit(42);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2a,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2a,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Going to exit(42). Use ? in the shell to query the value.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 42)
unreachable
}

LLVM IR (-O2):
@str = [58 x i8] c"Going to exit(42). Use ? in the shell to query the value.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 42)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ hashfn_uint8_djb(void *, int);
uint32_t hashtable_hashfn_int64(void *k) {
  return hashfn_uint8_djb(k, sizeof(int64_t));
}


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

x86 assembly (clang, -O2):
<hashtable_hashfn_int64>:
mov    $0x4,%esi
jmp    1030 <hashfn_uint8_djb@plt>

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

LLVM IR (-O2):
define i32 @hashtable_hashfn_int64(i8* %0) {
%2 = tail call i32 @hashfn_uint8_djb(i8* %0, i32 4)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_seat_get_sessions(const char *seat, char ***sessions, uid_t **uids,
                     unsigned *n_uids) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_seat_get_sessions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
mov    0x2ec3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_seat_get_sessions>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_seat_get_sessions(i8* %0, i8*** %1, i32** %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8***
%7 = alloca i32**
%8 = alloca i32*
store i8* %0, i8** %5
store i8*** %1, i8**** %6
store i32** %2, i32*** %7
store i32* %3, i32** %8
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_seat_get_sessions(i8* nocapture readnone %0, i8*** nocapture readnone %1, i32** nocapture readnone %2, i32* nocapture readnone %3) {
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}
/* Variables and functions */
int rand();
int RandInt(int x, int y) { return rand() % (y - x + 1) + x; }


x86 assembly (clang, -O0):
<RandInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandInt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @RandInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @RandInt(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Sound_Play(int, int);
void ToneA() { Sound_Play(880, 50); }


x86 assembly (clang, -O0):
<ToneA>:
push   %rbp
mov    %rsp,%rbp
mov    $0x370,%edi
mov    $0x32,%esi
call   1030 <Sound_Play@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToneA>:
mov    $0x370,%edi
mov    $0x32,%esi
jmp    1030 <Sound_Play@plt>

LLVM IR (-O0):
define void @ToneA() {
%1 = call i32 @Sound_Play(i32 880, i32 50)
ret void
}

LLVM IR (-O2):
define void @ToneA() {
%1 = tail call i32 @Sound_Play(i32 880, i32 50)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int yyerror(char *s) { printf("\n%s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
void foo635() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ reiserfs_warning(char *);
void errcatch_print_item(struct item_head *ih, char *item) {
  reiserfs_warning("green-16004: Invalid item type observed, run fsck ASAP\n");
}


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

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

LLVM IR (-O0):
%struct.item_head = type { i32 }
@.str = [56 x i8] c"green-16004: Invalid item type observed, run fsck ASAP\0A\00"
define void @errcatch_print_item(%struct.item_head* %0, i8* %1) {
%3 = alloca %struct.item_head*
%4 = alloca i8*
store %struct.item_head* %0, %struct.item_head** %3
store i8* %1, i8** %4
%5 = call i32 @reiserfs_warning(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.item_head = type { i32 }
@.str = [56 x i8] c"green-16004: Invalid item type observed, run fsck ASAP\0A\00"
define void @errcatch_print_item(%struct.item_head* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @reiserfs_warning(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}
void write16bit(data) int data;
{
  eputc((char)((data & 0xff00) >> 8));
  eputc((char)(data & 0xff));
}


x86 assembly (clang, -O0):
<write16bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
movsbl %al,%edi
mov    $0x0,%al
call   1030 <eputc@plt>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
movsbl %al,%edi
mov    $0x0,%al
call   1030 <eputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write16bit>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x8,%eax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <eputc@plt>
movsbl %bl,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <eputc@plt>

LLVM IR (-O0):
define void @write16bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = trunc i32 %5 to i8
%7 = sext i8 %6 to i32
%8 = call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %7)
%9 = load i32, i32* %2
%10 = and i32 %9, 255
%11 = trunc i32 %10 to i8
%12 = sext i8 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %12)
ret void
}

LLVM IR (-O2):
define void @write16bit(i32 %0) {
%2 = shl i32 %0, 16
%3 = ashr i32 %2, 24
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %3)
%5 = shl i32 %0, 24
%6 = ashr exact i32 %5, 24
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %6)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int sleeper() {
  uint64_t i;
  for (i = 0; i < 1024 * 1024 * 512; i++)
    ;
}


x86 assembly (clang, -O0):
<sleeper>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
cmpl   $0x20000000,-0x8(%rbp)
jge    112b <sleeper+0x2b>
jmp    111d <sleeper+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110b <sleeper+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sleeper() {
ret i32 undef
}
/* Variables and functions */
int validateTestDir1_renamed(char const *, char *);
int validateTestDir1(const char *parentDir) {
  return validateTestDir1_renamed(parentDir, "testdir1");
}


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

x86 assembly (clang, -O2):
<validateTestDir1>:
lea    0xee9(%rip),%rsi
jmp    1030 <validateTestDir1_renamed@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"testdir1\00"
define i32 @validateTestDir1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @validateTestDir1_renamed(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"testdir1\00"
define i32 @validateTestDir1(i8* %0) {
%2 = tail call i32 @validateTestDir1_renamed(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void plus1(void) {
  int a;
  a = 1;
  int b;
  b = 2;
  printf("plus11");
}


x86 assembly (clang, -O0):
<plus1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"plus11\00"
define void @plus1() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int master(int *set, int index) {
  int last = index;
  while (index != set[index])
    index = set[index];
  set[last] = index;
  return (index);
}


x86 assembly (clang, -O0):
<master>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     1138 <master+0x38>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <master+0x11>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<master>:
mov    %esi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,%eax
movslq %ecx,%rdx
mov    (%rdi,%rdx,4),%ecx
cmp    %ecx,%edx
jne    1110 <master+0x10>
movslq %esi,%rcx
mov    %eax,(%rdi,%rcx,4)
ret

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

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