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

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char);
void PrintChar(void *elem, void *fp) {
  fprintf((FILE *)fp, "%c", *(char *)elem);
  fflush((FILE *)fp);
}


x86 assembly (clang, -O0):
<PrintChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
lea    0xec1(%rip),%rsi
movsbl (%rax),%edx
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintChar>:
push   %rbx
mov    %rsi,%rbx
movsbl (%rdi),%edi
call   1030 <fputc@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
define void @PrintChar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
%6 = tail call i32 @fputc(i32 %5, i32* %3)
%7 = tail call i32 @fflush(i32* %3)
ret void
}
void X509_VERIFY_PARAM_free(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_VERIFY_PARAM_free() {
ret void
}
/* Variables and functions */
char *GetNextChar(const char *psz) {
  while (*psz == ' ' || *psz == '\t')
    psz++;
  return (char *)psz;
}


x86 assembly (clang, -O0):
<GetNextChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <GetNextChar+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <GetNextChar+0x3d>
jmp    114e <GetNextChar+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <GetNextChar+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNextChar>:
mov    %rdi,%rax
jmp    1114 <GetNextChar+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <GetNextChar+0x10>
cmp    $0x9,%cl
je     1110 <GetNextChar+0x10>
ret

LLVM IR (-O0):
define i8* @GetNextChar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ true, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @GetNextChar(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ cng_put_pixel(int, int);
int Affiche1(int x, int y) { cng_put_pixel(x, y); }


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

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

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

LLVM IR (-O2):
define i32 @Affiche1(i32 %0, i32 %1) {
%3 = tail call i32 @cng_put_pixel(i32 %0, i32 %1)
ret i32 undef
}
/* Variables and functions */
int atomic_swap(void *, int);
int test_and_set(void *v) {
  int old;
  old = atomic_swap(v, 1);
  return old != 0;
}


x86 assembly (clang, -O0):
<test_and_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <atomic_swap@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_set>:
push   %rax
mov    $0x1,%esi
call   1030 <atomic_swap@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_and_set(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @atomic_swap(i8* %4, i32 1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_and_set(i8* %0) {
%2 = tail call i32 @atomic_swap(i8* %0, i32 1)
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int drand48();
double log_domain(void) { return (1 / drand48()); }


x86 assembly (clang, -O0):
<log_domain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <drand48@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_domain>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <drand48@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovb  %eax,%ebx
cvtsi2sd %ebx,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @log_domain() {
%1 = call i32 (...) @drand48()
%2 = sdiv i32 1, %1
%3 = sitofp i32 %2 to double
ret double %3
}

LLVM IR (-O2):
define double @log_domain() {
%1 = tail call i32 (...) @drand48()
%2 = add i32 %1, 1
%3 = icmp ult i32 %2, 3
%4 = select i1 %3, i32 %1, i32 0
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ clkDelay();
void NupAndDown(void) {
  do {
    *((unsigned int *)0xC000A040) &= ~(1 << 0);
    clkDelay();
  } while (0);
  do {
    clkDelay();
    *((unsigned int *)0xC000A040) |= (1 << 0);
  } while (0);
}


x86 assembly (clang, -O0):
<NupAndDown>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <NupAndDown+0x9>
mov    $0xc000a040,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0xc000a040,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <clkDelay@plt>
jmp    1136 <NupAndDown+0x26>
mov    $0x0,%al
call   1030 <clkDelay@plt>
mov    $0xc000a040,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0xc000a040,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<NupAndDown>:
push   %rbx
mov    $0xc000a040,%ebx
andb   $0xfe,(%rbx)
xor    %eax,%eax
call   1030 <clkDelay@plt>
xor    %eax,%eax
call   1030 <clkDelay@plt>
orb    $0x1,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @NupAndDown() {
br label %1
1: ; preds = %0
%2 = load i32, i32* inttoptr (i64 3221266496 to i32*)
%3 = and i32 %2, -2
store i32 %3, i32* inttoptr (i64 3221266496 to i32*)
%4 = call i32 (...) @clkDelay()
br label %5
5: ; preds = %1
br label %6
6: ; preds = %5
%7 = call i32 (...) @clkDelay()
%8 = load i32, i32* inttoptr (i64 3221266496 to i32*)
%9 = or i32 %8, 1
store i32 %9, i32* inttoptr (i64 3221266496 to i32*)
br label %10
10: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @NupAndDown() {
%1 = load i32, i32* inttoptr (i64 3221266496 to i32*)
%2 = and i32 %1, -2
store i32 %2, i32* inttoptr (i64 3221266496 to i32*)
%3 = tail call i32 (...) @clkDelay()
%4 = tail call i32 (...) @clkDelay()
%5 = load i32, i32* inttoptr (i64 3221266496 to i32*)
%6 = or i32 %5, 1
store i32 %6, i32* inttoptr (i64 3221266496 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kputchar(int);
void kprint(const char *data, size_t data_length) {
  for (size_t i = 0; i < data_length; i++)
    kputchar((int)((const unsigned char *)data)[i]);
}


x86 assembly (clang, -O0):
<kprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <kprint+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <kputchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <kprint+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kprint>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <kprint+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%edi
call   1030 <kputchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <kprint+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @kprint(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = call i32 @kputchar(i32 %15)
br label %17
17: ; preds = %10
%18 = load i64, i64* %5
%19 = add i64 %18, 1
store i64 %19, i64* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @kprint(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = tail call i32 @kputchar(i32 %9)
%11 = add nuw i64 %6, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void notified_event(void *instance, const char *event) {
  printf("\n%s\n", event);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s\0A\00"
define void @notified_event(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int shr2(int x) { return 2 * x; }


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

x86 assembly (clang, -O2):
<shr2>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @shr2(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  int i = 0;
  while (*argv) {
    printf("ARGV[%d]:%s\n", i, *argv);
    argv++;
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     116b <main+0x5b>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    (%rsi),%rdx
test   %rdx,%rdx
je     1148 <main+0x38>
mov    %rsi,%r14
xor    %ebx,%ebx
lea    0xed7(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x8(%r14,%rbx,8),%rdx
add    $0x1,%rbx
test   %rdx,%rdx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"ARGV[%d]:%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %12, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8** [ %10, %5 ], [ %1, %2 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %6)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = add nuw nsw i32 %7, 1
%12 = load i8*, i8** %10
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret i32 0
}
double ldexp(double x, int exp) {
  printf("tcl>>> %s\n", __func__);
  return -1;
}


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
lea    0xee1(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xec3(%rip),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
push   %rax
lea    0xef0(%rip),%rdi
lea    0xef4(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsd  0xed2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"tcl>>> %s\0A\00"
@__func__.ldexp = [6 x i8] c"ldexp\00"
define double @ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.ldexp, i64 0, i64 0))
ret double -1.000000e+00
}

LLVM IR (-O2):
@.str = [11 x i8] c"tcl>>> %s\0A\00"
@__func__.ldexp = [6 x i8] c"ldexp\00"
define double @ldexp(double %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.ldexp, i64 0, i64 0))
ret double -1.000000e+00
}
double Sleef_fmod(double x, double y) { return __builtin_fmod(x, y); }


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

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

LLVM IR (-O0):
define double @Sleef_fmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @fmod(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @Sleef_fmod(double %0, double %1) {
%3 = tail call double @fmod(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ lou_logPrint(char *, char const *);
void defaultLogCallback(int level, const char *message) {
  lou_logPrint("%s", message);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @defaultLogCallback(i32 %0, i8* %1) {
%3 = tail call i32 @lou_logPrint(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
size_t write_FD_BE(int, float const *, int);
size_t float32WriteToFD(int fd, const float *data) {
  return write_FD_BE(fd, data, sizeof(float));
}


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

x86 assembly (clang, -O2):
<float32WriteToFD>:
mov    $0x4,%edx
jmp    1030 <write_FD_BE@plt>

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

LLVM IR (-O2):
define i64 @float32WriteToFD(i32 %0, float* %1) {
%3 = tail call i64 @write_FD_BE(i32 %0, float* %1, i32 4)
ret i64 %3
}
void register_smp_ops(struct plat_smp_ops *ops) {}


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

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

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

LLVM IR (-O2):
%struct.plat_smp_ops = type opaque
define void @register_smp_ops(%struct.plat_smp_ops* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ _waitpid(int /*<<< orphan*/, int *, int);
pid_t waitpid(pid_t pid, int *stat_loc, int options) {
  return _waitpid(pid, stat_loc, options);
}


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

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

LLVM IR (-O0):
define i32 @waitpid(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 @_waitpid(i32 %7, i32* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @_waitpid(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
int *multiplicar_1_svc(int a, int b, struct svc_req *rqstp) {
  static int r;
  r = a * b;
  return (&r);
}


x86 assembly (clang, -O0):
<multiplicar_1_svc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,0x2f09(%rip)
lea    0x2f02(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplicar_1_svc>:
imul   %esi,%edi
mov    %edi,0x2f1b(%rip)
lea    0x2f14(%rip),%rax
ret

LLVM IR (-O0):
%struct.svc_req = type opaque
@multiplicar_1_svc.r = internal global i32 0
define i32* @multiplicar_1_svc(i32 %0, i32 %1, %struct.svc_req* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.svc_req*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
store i32 %9, i32* @multiplicar_1_svc.r
ret i32* @multiplicar_1_svc.r
}

LLVM IR (-O2):
%struct.svc_req = type opaque
@multiplicar_1_svc.r = internal global i32 0
define i32* @multiplicar_1_svc(i32 %0, i32 %1, %struct.svc_req* nocapture readnone %2) {
%4 = mul nsw i32 %1, %0
store i32 %4, i32* @multiplicar_1_svc.r
ret i32* @multiplicar_1_svc.r
}
void hclib_get_avg_time(double *t_work, double *t_ovh, double *t_search) {
  *t_work = 0;
  *t_ovh = 0;
  *t_search = 0;
}


x86 assembly (clang, -O0):
<hclib_get_avg_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @hclib_get_avg_time(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
store double 0.000000e+00, double* %7
%8 = load double*, double** %5
store double 0.000000e+00, double* %8
%9 = load double*, double** %6
store double 0.000000e+00, double* %9
ret void
}

LLVM IR (-O2):
define void @hclib_get_avg_time(double* nocapture writeonly %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
store double 0.000000e+00, double* %0
store double 0.000000e+00, double* %1
store double 0.000000e+00, double* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a;
  a = 0;
  char *byte = (char *)&a;
  byte[0] = 0xab;
  byte[1] = 0xab;
  byte[2] = 0xab;
  byte[3] = 0xab;
  test_assert(a == 0xabababab);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0xab,(%rax)
mov    -0x10(%rbp),%rax
movb   $0xab,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0xab,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0xab,0x3(%rax)
cmpl   $0xabababab,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 -85, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 -85, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8 -85, i8* %10
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 3
store i8 -85, i8* %12
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, -1414812757
%15 = zext i1 %14 to i32
%16 = call i32 @test_assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ build_hands(char *);
void play(char line[50]) { build_hands(line); }


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

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

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

LLVM IR (-O2):
define void @play(i8* %0) {
%2 = tail call i32 @build_hands(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_tx_string(char const *);
void print_emerg(const char *str) { console_tx_string(str); }


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

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

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

LLVM IR (-O2):
define void @print_emerg(i8* %0) {
%2 = tail call i32 @console_tx_string(i8* %0)
ret void
}
char *strcat(char *d, const char *s) {
  char *p = d;
  while (*p++ != '\0')
    ;
  while (*s != '\0') {
    *p++ = *s++;
  }
  *p = '\0';
  return d;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1134 <strcat+0x34>
jmp    1114 <strcat+0x14>
jmp    1139 <strcat+0x39>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1170 <strcat+0x70>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1139 <strcat+0x39>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
mov    (%rsi),%dl
test   %dl,%dl
je     1143 <strcat+0x43>
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %dl,(%rcx,%rdi,1)
movzbl 0x1(%rsi,%rdi,1),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1130 <strcat+0x30>
add    %rdi,%rcx
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %16, %11 ], [ %5, %8 ]
%14 = phi i8* [ %15, %11 ], [ %1, %8 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %13
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %5, %8 ], [ %16, %11 ]
store i8 0, i8* %20
ret i8* %0
}
int get_micro_version(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_micro_version() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void usage(void) { die("Usage: build setup system [rootdev] [> image]"); }


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"Usage: build setup system [rootdev] [> image]\00"
define void @usage() {
%1 = call i32 @die(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Usage: build setup system [rootdev] [> image]\00"
define void @usage() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rom_present(char *);
int oti067_077_available(void) {
  return (rom_present(L"roms/video/oti/oti077.vbi"));
}


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

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

LLVM IR (-O0):
@.str = [26 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 111, i32 116, i32 105, i32 47, i32 111, i32 116, i32 105, i32 48, i32 55, i32 55, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @oti067_077_available() {
%1 = call i32 @rom_present(i8* bitcast ([26 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [26 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 111, i32 116, i32 105, i32 47, i32 111, i32 116, i32 105, i32 48, i32 55, i32 55, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @oti067_077_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([26 x i32]* @.str to i8*))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int popen2_impl(int /*<<< orphan*/ **, char const *, char const *const *,
                char const *const *, int, char const *);
int popen2_arr_p(FILE **in_or_out, const char *program,
                 const char *const argv[], const char *const envp[],
                 const char *mode) {
  return popen2_impl(in_or_out, program, argv, envp, 1, mode);
}


x86 assembly (clang, -O0):
<popen2_arr_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r9
mov    $0x1,%r8d
call   1030 <popen2_impl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popen2_arr_p>:
mov    %r8,%r9
mov    $0x1,%r8d
jmp    1030 <popen2_impl@plt>

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

LLVM IR (-O2):
define i32 @popen2_arr_p(i32** %0, i8* %1, i8** %2, i8** %3, i8* %4) {
%6 = tail call i32 @popen2_impl(i32** %0, i8* %1, i8** %2, i8** %3, i32 1, i8* %4)
ret i32 %6
}
void foo036() {}


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

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

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

LLVM IR (-O2):
define void @foo036() {
ret void
}
/* Variables and functions */
int geteuid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ seteuid(int /*<<< orphan*/);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
main() {
  printf("Content-Type: text/plain\r\n\r\n%d %d\n", getuid(), geteuid());
  setuid(0);
  seteuid(0);
  printf("%d %d\n", getuid(), geteuid());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <setuid@plt>
xor    %edi,%edi
call   1070 <seteuid@plt>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <geteuid@plt>
lea    0xe98(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <setuid@plt>
xor    %edi,%edi
call   1070 <seteuid@plt>
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <geteuid@plt>
lea    0xe86(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Content-Type: text/plain\0D\0A\0D\0A%d %d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = call i32 (...) @getuid()
%2 = call i32 (...) @geteuid()
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = call i32 @setuid(i32 0)
%5 = call i32 @seteuid(i32 0)
%6 = call i32 (...) @getuid()
%7 = call i32 (...) @geteuid()
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Content-Type: text/plain\0D\0A\0D\0A%d %d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 (...) @geteuid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = tail call i32 @setuid(i32 0)
%5 = tail call i32 @seteuid(i32 0)
%6 = tail call i32 (...) @getuid()
%7 = tail call i32 (...) @geteuid()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
int binarySearch(int *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[] = {4, 7, 9, 12, 20, 45};
  printf("Target at index: %d\n", binarySearch(arr, 0, 5, 45));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
mov    $0x2d,%ecx
call   1040 <binarySearch@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x5,%edx
mov    $0x2d,%ecx
call   1040 <binarySearch@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [6 x i32] [i32 4, i32 7, i32 9, i32 12, i32 20, i32 45]
@.str = [21 x i8] c"Target at index: %d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @binarySearch(i32* %3, i32 0, i32 5, i32 45)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [6 x i32] [i32 4, i32 7, i32 9, i32 12, i32 20, i32 45]
@.str = [21 x i8] c"Target at index: %d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @binarySearch(i32* %3, i32 0, i32 5, i32 45)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("test\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"test\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 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"test\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ GetRecord(int /*<<< orphan*/);
int /*<<< orphan*/ PutRecord(int /*<<< orphan*/);
int /*<<< orphan*/ ReadHeader(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  ReadHeader(stdin);
  while (GetRecord(stdin))
    PutRecord(stdout);
  exit(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    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1030 <ReadHeader@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <GetRecord@plt>
cmp    $0x0,%rax
je     118f <main+0x4f>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1040 <PutRecord@plt>
jmp    1164 <main+0x24>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e9d(%rip),%r14
mov    (%r14),%edi
call   1030 <ReadHeader@plt>
mov    (%r14),%edi
call   1050 <GetRecord@plt>
test   %rax,%rax
je     1184 <main+0x44>
mov    0x2e71(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%edi
call   1040 <PutRecord@plt>
mov    (%r14),%edi
call   1050 <GetRecord@plt>
test   %rax,%rax
jne    1170 <main+0x30>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
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* @stdin
%7 = call i32 @ReadHeader(i32 %6)
br label %8
8: ; preds = %12, %2
%9 = load i32, i32* @stdin
%10 = call i64 @GetRecord(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* @stdout
%14 = call i32 @PutRecord(i32 %13)
br label %8
15: ; preds = %8
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @ReadHeader(i32 %3)
%5 = load i32, i32* @stdin
%6 = tail call i64 @GetRecord(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2, %8
%9 = load i32, i32* @stdout
%10 = tail call i32 @PutRecord(i32 %9)
%11 = load i32, i32* @stdin
%12 = tail call i64 @GetRecord(i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %8
14: ; preds = %8, %2
%15 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned int etp_npending();
unsigned int eio_npending(void) { return etp_npending(); }


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

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

LLVM IR (-O0):
define i32 @eio_npending() {
%1 = call i32 (...) @etp_npending()
ret i32 %1
}

LLVM IR (-O2):
define i32 @eio_npending() {
%1 = tail call i32 (...) @etp_npending()
ret i32 %1
}
void msm_cpr_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @msm_cpr_enable() {
ret void
}
void __cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
             unsigned int *edx) {
  asm volatile("cpuid;"
               : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx)
               : "0"(*eax), "2"(*ecx));
}


x86 assembly (clang, -O0):
<__cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
cpuid
mov    %eax,%r9d
mov    -0x38(%rbp),%rax
mov    %ecx,%esi
mov    -0x30(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cpuid>:
push   %rbx
mov    %rcx,%r8
mov    %rdx,%r9
mov    (%rdi),%eax
mov    (%rdx),%ecx
cpuid
mov    %eax,(%rdi)
mov    %ebx,(%rsi)
mov    %ecx,(%r9)
mov    %edx,(%r8)
pop    %rbx
ret

LLVM IR (-O0):
define void @__cpuid(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = load i32*, i32** %7
%16 = load i32, i32* %15
%17 = call { i32, i32, i32, i32 } asm sideeffect "cpuid;", "={ax},={bx},={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 %14, i32 %16)
%18 = extractvalue { i32, i32, i32, i32 } %17, 0
%19 = extractvalue { i32, i32, i32, i32 } %17, 1
%20 = extractvalue { i32, i32, i32, i32 } %17, 2
%21 = extractvalue { i32, i32, i32, i32 } %17, 3
store i32 %18, i32* %9
store i32 %19, i32* %10
store i32 %20, i32* %11
store i32 %21, i32* %12
ret void
}

LLVM IR (-O2):
define void @__cpuid(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid;", "={ax},={bx},={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
%8 = extractvalue { i32, i32, i32, i32 } %7, 0
%9 = extractvalue { i32, i32, i32, i32 } %7, 1
%10 = extractvalue { i32, i32, i32, i32 } %7, 2
%11 = extractvalue { i32, i32, i32, i32 } %7, 3
store i32 %8, i32* %0
store i32 %9, i32* %1
store i32 %10, i32* %2
store i32 %11, i32* %3
ret void
}
double QuadraticEaseInOut(double p) {
  if (p < 0.5) {
    return 2 * p * p;
  } else {
    return (-2 * p * p) + (4 * p) - 1;
  }
}


x86 assembly (clang, -O0):
<QuadraticEaseInOut>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1138 <QuadraticEaseInOut+0x38>
movsd  0xefc(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1170 <QuadraticEaseInOut+0x70>
movsd  0xed8(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xebe(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuadraticEaseInOut>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    111f <QuadraticEaseInOut+0x1f>
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret
movsd  0xee1(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xed9(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xed5(%rip),%xmm0
ret

LLVM IR (-O0):
define double @QuadraticEaseInOut(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 5.000000e-01
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fmul double 2.000000e+00, %7
%9 = load double, double* %3
%10 = fmul double %8, %9
store double %10, double* %2
br label %19
11: ; preds = %1
%12 = load double, double* %3
%13 = fmul double -2.000000e+00, %12
%14 = load double, double* %3
%15 = load double, double* %3
%16 = fmul double 4.000000e+00, %15
%17 = call double @llvm.fmuladd.f64(double %13, double %14, double %16)
%18 = fsub double %17, 1.000000e+00
store double %18, double* %2
br label %19
19: ; preds = %11, %6
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
define double @QuadraticEaseInOut(double %0) {
%2 = fcmp olt double %0, 5.000000e-01
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fmul double %0, 2.000000e+00
%5 = fmul double %4, %0
br label %11
6: ; preds = %1
%7 = fmul double %0, -2.000000e+00
%8 = fmul double %0, 4.000000e+00
%9 = tail call double @llvm.fmuladd.f64(double %7, double %0, double %8)
%10 = fadd double %9, -1.000000e+00
br label %11
11: ; preds = %6, %3
%12 = phi double [ %5, %3 ], [ %10, %6 ]
ret double %12
}
void zterp_os_init_term(void) {}


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

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

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

LLVM IR (-O2):
define void @zterp_os_init_term() {
ret void
}