xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((__noreturn__)) void usage(void) {
  fprintf(stderr, "usage: pick [-hvS] [-d [-o]] [-x | -X] [-q query]\n"
                  "    -h          output this help message and exit\n"
                  "    -v          output the version and exit\n"
                  "    -S          disable sorting\n"
                  "    -d          read and display descriptions\n"
                  "    -o          output description of selected on exit\n"
                  "    -x          enable alternate screen\n"
                  "    -X          disable alternate screen\n"
                  "    -q query    supply an initial search query\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [406 x i8] c"usage: pick [-hvS] [-d [-o]] [-x | -X] [-q query]\0A -h output this help message and exit\0A -v output the version and exit\0A -S disable sorting\0A -d read and display descriptions\0A -o output description of selected on exit\0A -x enable alternate screen\0A -X disable alternate screen\0A -q query supply an initial search query\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([406 x i8], [406 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [406 x i8] c"usage: pick [-hvS] [-d [-o]] [-x | -X] [-q query]\0A -h output this help message and exit\0A -v output the version and exit\0A -S disable sorting\0A -d read and display descriptions\0A -o output description of selected on exit\0A -x enable alternate screen\0A -X disable alternate screen\0A -q query supply an initial search query\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([406 x i8], [406 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ SHA512_CTX;

/* Variables and functions */
int SHA512_Update(int /*<<< orphan*/ *, void const *, size_t);
int SHA384_Update(SHA512_CTX *c, const void *data, size_t len) {
  return SHA512_Update(c, data, len);
}


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

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

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

LLVM IR (-O2):
define i32 @SHA384_Update(i32* %0, i8* %1, i64 %2) {
%4 = tail call i32 @SHA512_Update(i32* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ timeout(int);
void trashInput(int quantity) {
  int j;
  timeout(0);
  for (j = 0; j < quantity; j++)
    getch();
  timeout(-1);
}


x86 assembly (clang, -O0):
<trashInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <timeout@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115a <trashInput+0x3a>
mov    $0x0,%al
call   1040 <getch@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <trashInput+0x19>
mov    $0xffffffff,%edi
call   1030 <timeout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trashInput>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <timeout@plt>
test   %ebx,%ebx
jle    113c <trashInput+0x1c>
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getch@plt>
add    $0xffffffff,%ebx
jne    1130 <trashInput+0x10>
mov    $0xffffffff,%edi
pop    %rbx
jmp    1030 <timeout@plt>

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

LLVM IR (-O2):
define void @trashInput(i32 %0) {
%2 = tail call i32 @timeout(i32 0)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 (...) @getch()
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = tail call i32 @timeout(i32 -1)
ret void
}
findhfdigit(fn) char *fn;
{
  register char *p;
  register int chr;
  p = index(fn, '@');
  if (p != 0 && p > fn)
    chr = *(p - 1);
  else
    chr = '0';
  if (!isdigit(chr))
    chr = '0';
  return chr;
}


x86 assembly (clang, -O0):
<findhfdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
call   1040 <index@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1167 <findhfdigit+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1167 <findhfdigit+0x47>
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    116e <findhfdigit+0x4e>
movl   $0x30,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1186 <findhfdigit+0x66>
movl   $0x30,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findhfdigit>:
push   %rbx
mov    %rdi,%rbx
mov    $0x40,%esi
call   1030 <index@plt>
mov    %rax,%rcx
mov    $0x30,%eax
mov    $0x30,%edx
cmp    %rbx,%rcx
jbe    1134 <findhfdigit+0x24>
movsbl -0x1(%rcx),%edx
lea    -0x30(%rdx),%ecx
cmp    $0xa,%ecx
cmovb  %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @findhfdigit(i8* %0) {
%2 = tail call i8* @index(i8* %0, i32 64)
%3 = icmp ugt i8* %2, %0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 -1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 48, %1 ]
%10 = add nsw i32 %9, -48
%11 = icmp ult i32 %10, 10
%12 = select i1 %11, i32 %9, i32 48
ret i32 %12
}
/* Variables and functions */
int _flashinfo(int, int *, char **);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_flashinfo(int snum, int *size, char **base) {
  int ret;
  monLock();
  ret = _flashinfo(snum, size, base);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_flashinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <_flashinfo@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_flashinfo>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <_flashinfo@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_flashinfo(i32 %0, i32* %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8**
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8** %2, i8*** %6
%8 = call i32 (...) @monLock()
%9 = load i32, i32* %4
%10 = load i32*, i32** %5
%11 = load i8**, i8*** %6
%12 = call i32 @_flashinfo(i32 %9, i32* %10, i8** %11)
store i32 %12, i32* %7
%13 = call i32 (...) @monUnlock()
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @mon_flashinfo(i32 %0, i32* %1, i8** %2) {
%4 = tail call i32 (...) @monLock()
%5 = tail call i32 @_flashinfo(i32 %0, i32* %1, i8** %2)
%6 = tail call i32 (...) @monUnlock()
ret i32 %5
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
void w_timeval_to_timespec(const struct timeval a, struct timespec *ts) {
  ts->tv_sec = a.tv_sec;
  ts->tv_nsec = a.tv_usec * 1000;
}


x86 assembly (clang, -O0):
<w_timeval_to_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
imul   $0x3e8,-0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_timeval_to_timespec>:
imul   $0x3e8,%edi,%eax
shr    $0x20,%rdi
mov    %edi,0x4(%rsi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
%struct.timeval = type { i32, i32 }
define void @w_timeval_to_timespec(i64 %0, %struct.timespec* %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timespec*
%5 = bitcast %struct.timeval* %3 to i64*
store i64 %0, i64* %5
store %struct.timespec* %1, %struct.timespec** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %4
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
store i32 %7, i32* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%11 = load i32, i32* %10
%12 = mul nsw i32 %11, 1000
%13 = load %struct.timespec*, %struct.timespec** %4
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 0
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @w_timeval_to_timespec(i64 %0, %struct.timespec* nocapture writeonly %1) {
%3 = trunc i64 %0 to i32
%4 = lshr i64 %0, 32
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i32 %5, i32* %6
%7 = mul nsw i32 %3, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 %7, i32* %8
ret void
}
__attribute__((section(".after_vectors"))) void UsageFault_Handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define void @UsageFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UsageFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
int erasechar() { return (0x08); }


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

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

LLVM IR (-O0):
define i32 @erasechar() {
ret i32 8
}

LLVM IR (-O2):
define i32 @erasechar() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
void notice(char *caller, char *message) {
  fprintf(stdout, "%s: %s\n", caller, message);
}


x86 assembly (clang, -O0):
<notice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notice>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @notice(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void vga_on() {
  asm volatile("mov   $0x0013, %%ax\n"
               "int   $0x10\n"
               "mov   $0xA000, %%ax\n"
               "mov   %%ax, %%es\n"
               :
               :
               : "ax");
}


x86 assembly (clang, -O0):
<vga_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x13,%ax
int    $0x10
mov    $0xa000,%ax
mov    %eax,%es
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_on>:
mov    $0x13,%ax
int    $0x10
mov    $0xa000,%ax
mov    %eax,%es
ret

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

LLVM IR (-O2):
define void @vga_on() {
tail call void asm sideeffect "mov $$0x0013, %ax\0Aint $$0x10\0Amov $$0xA000, %ax\0Amov %ax, %es\0A", "~{ax},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t AUXTDCCounterGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x00000014))));
}


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

x86 assembly (clang, -O2):
<AUXTDCCounterGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x14(%rax),%rax
ret

LLVM IR (-O0):
define i64 @AUXTDCCounterGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 20
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @AUXTDCCounterGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 20
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
int main() {
  char *p1 = 1;
  char *p2 = '1';
  char *p3 = "1";
  printf("%s, %s, %s", p1, p2, p3);
  printf('\n');
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
mov    $0x31,%eax
mov    %rax,-0x18(%rbp)
lea    0xec8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeda(%rip),%rdi
lea    0xed1(%rip),%rcx
mov    $0x1,%esi
mov    $0x31,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [11 x i8] c"%s, %s, %s\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 49 to i8*), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 10 to i8*))
%3 = tail call i32 @putchar(i32 10)
ret i32 0
}
unsigned char pass_all(const char c) {
  (void)c;
  return 1;
}


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

x86 assembly (clang, -O2):
<pass_all>:
mov    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @pass_all(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @pass_all(i8 signext %0) {
ret i8 1
}
int has_tcpinfo_retransmits(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @has_tcpinfo_retransmits() {
ret i32 0
}
__attribute__((always_)) int drwav__is_little_endian() {
  int n = 1;
  return (*(char *)&n) == 1;
}


x86 assembly (clang, -O0):
<drwav__is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movsbl -0x4(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @drwav__is_little_endian() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @drwav__is_little_endian() {
ret i32 1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int get_nibble(char);
uint8_t get_byte(char *buf) {
  return (get_nibble(buf[0]) << 4) + (get_nibble(buf[1]));
}


x86 assembly (clang, -O0):
<get_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <get_nibble@plt>
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <get_nibble@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <get_nibble@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <get_nibble@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_byte(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @get_nibble(i8 signext %5)
%7 = shl i32 %6, 4
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = call i32 @get_nibble(i8 signext %10)
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_byte(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @get_nibble(i8 signext %2)
%4 = shl i32 %3, 4
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i32 @get_nibble(i8 signext %6)
%8 = add nsw i32 %7, %4
ret i32 %8
}
int intervalCount(int nsegs, int *intervals) {
  int retval;
  retval = intervals[1] - intervals[0];
  if (nsegs > 1) {
    retval += intervals[3] - intervals[2];
  }
  return (retval);
}


x86 assembly (clang, -O0):
<intervalCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1139 <intervalCount+0x39>
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
mov    -0x10(%rbp),%rcx
sub    0x8(%rcx),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intervalCount>:
mov    0x4(%rsi),%eax
sub    (%rsi),%eax
cmp    $0x2,%edi
jl     1110 <intervalCount+0x10>
add    0xc(%rsi),%eax
sub    0x8(%rsi),%eax
ret

LLVM IR (-O0):
define i32 @intervalCount(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
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = sub nsw i32 %8, %11
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 1
br i1 %14, label %15, label %25
15: ; preds = %2
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 2
%21 = load i32, i32* %20
%22 = sub nsw i32 %18, %21
%23 = load i32, i32* %5
%24 = add nsw i32 %23, %22
store i32 %24, i32* %5
br label %25
25: ; preds = %15, %2
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @intervalCount(i32 %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = load i32, i32* %3
%5 = load i32, i32* %1
%6 = sub nsw i32 %4, %5
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = getelementptr inbounds i32, i32* %1, i64 3
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %1, i64 2
%12 = load i32, i32* %11
%13 = add i32 %10, %6
%14 = sub i32 %13, %12
br label %15
15: ; preds = %8, %2
%16 = phi i32 [ %14, %8 ], [ %6, %2 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ XFocusInEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XFocusInEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XFocusInEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XFocusInEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XFocusInEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XFocusInEvent>:
test   %rdi,%rdi
je     112a <free_XFocusInEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XFocusInEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XFocusInEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ record_linux_param_description(char *, char *, char *);
void module_param_desc_win_thresh(void) {
  record_linux_param_description(
      "tcp_illinois.c", "win_thresh",
      "Window threshold for starting adaptive sizing");
}


x86 assembly (clang, -O0):
<module_param_desc_win_thresh>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xef1(%rip),%rdx
call   1030 <record_linux_param_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_param_desc_win_thresh>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
lea    0xef5(%rip),%rdx
jmp    1030 <record_linux_param_description@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"tcp_illinois.c\00"
@.str.1 = [11 x i8] c"win_thresh\00"
@.str.2 = [46 x i8] c"Window threshold for starting adaptive sizing\00"
define void @module_param_desc_win_thresh() {
%1 = call i32 @record_linux_param_description(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"tcp_illinois.c\00"
@.str.1 = [11 x i8] c"win_thresh\00"
@.str.2 = [46 x i8] c"Window threshold for starting adaptive sizing\00"
define void @module_param_desc_win_thresh() {
%1 = tail call i32 @record_linux_param_description(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int ENOSYS;
int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *sched) {
  return (ENOSYS);
}


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

x86 assembly (clang, -O2):
<pthread_attr_getschedpolicy>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_attr_getschedpolicy(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
ret i32 %3
}
/* Variables and functions */
double sin(double);
double cbuiltin_sin(double x) { return sin(x); }


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

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

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

LLVM IR (-O2):
define double @cbuiltin_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ errno;
char const *strerror(int /*<<< orphan*/);
const char *sys_msg() { return strerror(errno); }


x86 assembly (clang, -O0):
<sys_msg>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <strerror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_msg>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <strerror@plt>

LLVM IR (-O0):
@errno = global i32 0
define i8* @sys_msg() {
%1 = load i32, i32* @errno
%2 = call i8* @strerror(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@errno = global i32 0
define i8* @sys_msg() {
%1 = load i32, i32* @errno
%2 = tail call i8* @strerror(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello Git"); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello Git\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void byString(const char *x) { printf("byString(%s)\n", x); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"byString(%s)\0A\00"
define void @byString(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void delay(void) {
  volatile uint32_t count;
  for (count = 0; count < 400000; count++) {
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x61a80,%eax
jge    112c <delay+0x2c>
jmp    111e <delay+0x1e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <delay+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x61a7f,%eax
jg     1130 <delay+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x61a80,%eax
jl     1120 <delay+0x20>
ret

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

LLVM IR (-O2):
define void @delay() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp slt i32 %3, 400000
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load volatile i32, i32* %1
%7 = add nsw i32 %6, 1
store volatile i32 %7, i32* %1
%8 = load volatile i32, i32* %1
%9 = icmp slt i32 %8, 400000
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret void
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *, int *);
int main() {
  int a, b;
  while (scanf("%d %d", &a, &b) != EOF)
    printf("%d\n", a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
je     116a <main+0x4a>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%r13
cmp    0x0(%r13),%rax
je     1194 <main+0x74>
lea    0xeaf(%rip),%r14
lea    0xea2(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %4
13: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %16, label %8
8: ; preds = %0, %8
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%14 = load i64, i64* @EOF
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %8
16: ; preds = %8, %0
ret i32 0
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ payload(char *);
int /*<<< orphan*/ unsetenv(char *);
int geteuid() {
  char *cmd;
  if (getenv("LD_PRELOAD") == NULL) {
    return 0;
  }
  unsetenv("LD_PRELOAD");
  if ((cmd = getenv("_evilcmd")) != NULL) {
    payload(cmd);
  }
  return 1;
}


x86 assembly (clang, -O0):
<geteuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
jne    115a <geteuid+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1190 <geteuid+0x60>
lea    0xe9f(%rip),%rdi
call   1050 <unsetenv@plt>
lea    0xe9e(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1189 <geteuid+0x59>
mov    -0x10(%rbp),%rdi
call   1040 <payload@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geteuid>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     116e <geteuid+0x3e>
lea    0xeb7(%rip),%rdi
call   1050 <unsetenv@plt>
lea    0xeb6(%rip),%rdi
call   1030 <getenv@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     1170 <geteuid+0x40>
mov    %rax,%rdi
call   1040 <payload@plt>
jmp    1170 <geteuid+0x40>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"LD_PRELOAD\00"
@.str.1 = [9 x i8] c"_evilcmd\00"
define i32 @geteuid() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %14
6: ; preds = %0
%7 = call i32 @unsetenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i8* %8, i8** %2
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = call i32 @payload(i8* %11)
br label %13
13: ; preds = %10, %6
store i32 1, i32* %1
br label %14
14: ; preds = %13, %5
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [11 x i8] c"LD_PRELOAD\00"
@.str.1 = [9 x i8] c"_evilcmd\00"
define i32 @geteuid() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i32 @unsetenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = tail call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @payload(i8* %5)
br label %9
9: ; preds = %3, %7, %0
%10 = phi i32 [ 0, %0 ], [ 1, %7 ], [ 1, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glGetTexParameterfv_size(int /*<<< orphan*/);
GLint __glGetTexParameteriv_size(GLenum pname) {
  return __glGetTexParameterfv_size(pname);
}


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

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

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

LLVM IR (-O2):
define i32 @__glGetTexParameteriv_size(i32 %0) {
%2 = tail call i32 @__glGetTexParameterfv_size(i32 %0)
ret i32 %2
}
void WatchdogIntTypeSet(unsigned long ulBase, unsigned long ulType) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) =
      ((*((volatile unsigned long *)(ulBase + 0x00000008))) & ~0x00000004) |
      ulType;
}


x86 assembly (clang, -O0):
<WatchdogIntTypeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
and    $0xfffffffffffffffb,%rcx
or     -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogIntTypeSet>:
mov    0x8(%rdi),%rax
and    $0xfffffffffffffffb,%rax
or     %rsi,%rax
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @WatchdogIntTypeSet(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 = add i64 %5, 8
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -5
%10 = load i64, i64* %4
%11 = or i64 %9, %10
%12 = load i64, i64* %3
%13 = add i64 %12, 8
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
ret void
}

LLVM IR (-O2):
define void @WatchdogIntTypeSet(i64 %0, i64 %1) {
%3 = add i64 %0, 8
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -5
%7 = or i64 %6, %1
store volatile i64 %7, i64* %4
ret void
}
int count_digits(int number) {
  int number_of_digits = 0;
  while (number != 0) {
    number = number / 10;
    number_of_digits++;
  }
  return number_of_digits;
}


x86 assembly (clang, -O0):
<count_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <count_digits+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <count_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_digits>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <count_digits+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <count_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main() {
  test(10);
  test(100);
  test(1000);
  test(10000);
  test(100000);
  test(1000000);
  test(10000000);
  test(100000000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <test@plt>
mov    $0x64,%edi
call   1030 <test@plt>
mov    $0x3e8,%edi
call   1030 <test@plt>
mov    $0x2710,%edi
call   1030 <test@plt>
mov    $0x186a0,%edi
call   1030 <test@plt>
mov    $0xf4240,%edi
call   1030 <test@plt>
mov    $0x989680,%edi
call   1030 <test@plt>
mov    $0x5f5e100,%edi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <test@plt>
mov    $0x64,%edi
call   1030 <test@plt>
mov    $0x3e8,%edi
call   1030 <test@plt>
mov    $0x2710,%edi
call   1030 <test@plt>
mov    $0x186a0,%edi
call   1030 <test@plt>
mov    $0xf4240,%edi
call   1030 <test@plt>
mov    $0x989680,%edi
call   1030 <test@plt>
mov    $0x5f5e100,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 10)
%3 = call i32 @test(i32 100)
%4 = call i32 @test(i32 1000)
%5 = call i32 @test(i32 10000)
%6 = call i32 @test(i32 100000)
%7 = call i32 @test(i32 1000000)
%8 = call i32 @test(i32 10000000)
%9 = call i32 @test(i32 100000000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 10)
%2 = tail call i32 @test(i32 100)
%3 = tail call i32 @test(i32 1000)
%4 = tail call i32 @test(i32 10000)
%5 = tail call i32 @test(i32 100000)
%6 = tail call i32 @test(i32 1000000)
%7 = tail call i32 @test(i32 10000000)
%8 = tail call i32 @test(i32 100000000)
ret i32 0
}
/* Variables and functions */
int comp_date(char const *, char const *);
int icomp_date(const char *a, const char *b) { return -comp_date(a, b); }


x86 assembly (clang, -O0):
<icomp_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <comp_date@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icomp_date>:
push   %rax
call   1030 <comp_date@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @icomp_date(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
%7 = call i32 @comp_date(i8* %5, i8* %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @icomp_date(i8* %0, i8* %1) {
%3 = tail call i32 @comp_date(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ interrupts_configure();
int /*<<< orphan*/ operating_frequency_set();
int /*<<< orphan*/ output_ports_configure();
int /*<<< orphan*/ peripheral_modules_enable();
void HardwareSetup(void) {
  operating_frequency_set();
  output_ports_configure();
  interrupts_configure();
  peripheral_modules_enable();
}


x86 assembly (clang, -O0):
<HardwareSetup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <operating_frequency_set@plt>
mov    $0x0,%al
call   1050 <output_ports_configure@plt>
mov    $0x0,%al
call   1060 <interrupts_configure@plt>
mov    $0x0,%al
call   1030 <peripheral_modules_enable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HardwareSetup>:
push   %rax
xor    %eax,%eax
call   1040 <operating_frequency_set@plt>
xor    %eax,%eax
call   1050 <output_ports_configure@plt>
xor    %eax,%eax
call   1060 <interrupts_configure@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <peripheral_modules_enable@plt>

LLVM IR (-O0):
define void @HardwareSetup() {
%1 = call i32 (...) @operating_frequency_set()
%2 = call i32 (...) @output_ports_configure()
%3 = call i32 (...) @interrupts_configure()
%4 = call i32 (...) @peripheral_modules_enable()
ret void
}

LLVM IR (-O2):
define void @HardwareSetup() {
%1 = tail call i32 (...) @operating_frequency_set()
%2 = tail call i32 (...) @output_ports_configure()
%3 = tail call i32 (...) @interrupts_configure()
%4 = tail call i32 (...) @peripheral_modules_enable()
ret void
}
/* Variables and functions */
long map(long, long, long, int /*<<< orphan*/, int);
long ind_map(long val, long val_min, long val_max) {
  return map(val, val_min, val_max, 0, 255);
}


x86 assembly (clang, -O0):
<ind_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0xff,%r8d
call   1030 <map@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ind_map>:
xor    %ecx,%ecx
mov    $0xff,%r8d
jmp    1030 <map@plt>

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

LLVM IR (-O2):
define i64 @ind_map(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 @map(i64 %0, i64 %1, i64 %2, i32 0, i32 255)
ret i64 %4
}
void equality(number, left, right) int number, left, right;
{
  if (left != right)
    basic_error("equality (%d) violated", number);
}


x86 assembly (clang, -O0):
<equality>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     113e <equality+0x2e>
mov    -0x4(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <basic_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equality>:
cmp    %edx,%esi
jne    1115 <equality+0x5>
ret
mov    %edi,%eax
lea    0xee2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
jmp    1030 <basic_error@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"equality (%d) violated\00"
define void @equality(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* %5
%8 = load i32, i32* %6
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %4
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @basic_error to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"equality (%d) violated\00"
define void @equality(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @basic_error to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}