xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
char *now();
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ system(char *);
int main() {
  char comment[80];
  char cmd[120];
  fgets(comment, 80, stdin);
  sprintf(cmd, "echo '%s %s' >> reports.log", comment, now());
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
lea    -0xe0(%rbp),%rax
mov    %rax,-0xf0(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    $0x0,%al
call   1050 <now@plt>
mov    -0xf0(%rbp),%rdi
mov    -0xe8(%rbp),%rdx
mov    %rax,%rcx
lea    0xe5f(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x50,%esi
call   1040 <fgets@plt>
xor    %eax,%eax
call   1050 <now@plt>
lea    0xe8f(%rip),%rsi
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %rax,%rcx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [28 x i8] c"echo '%s %s' >> reports.log\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca [120 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 80, i32 %5)
%7 = getelementptr inbounds [120 x i8], [120 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%9 = call i8* (...) @now()
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [120 x i8], [120 x i8]* %3, i64 0, i64 0
%12 = call i32 @system(i8* %11)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [28 x i8] c"echo '%s %s' >> reports.log\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca [120 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [120 x i8], [120 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %3, i32 80, i32 %5)
%7 = call i8* (...) @now()
%8 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %7)
%9 = call i32 @system(i8* %4)
ret i32 0
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glutSwapBuffers();
void RenderFunction(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<RenderFunction>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1040 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RenderFunction>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @RenderFunction() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @RenderFunction() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 (...) @glutSwapBuffers()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void greet() { printf("Hello World!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @greet() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @greet() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
int arm_cannot_fetch_register(int regno) { return (regno >= 26); }


x86 assembly (clang, -O0):
<arm_cannot_fetch_register>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1a,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_cannot_fetch_register>:
xor    %eax,%eax
cmp    $0x1a,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @arm_cannot_fetch_register(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @arm_cannot_fetch_register(i32 %0) {
%2 = icmp sgt i32 %0, 25
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_ivector(int *v, int nl, int nh) { free((char *)(v + nl - 1)); }


x86 assembly (clang, -O0):
<free_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ivector>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
add    $0xfffffffffffffffc,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_ivector(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 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = getelementptr inbounds i32, i32* %10, i64 -1
%12 = bitcast i32* %11 to i8*
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
define void @free_ivector(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = getelementptr inbounds i32, i32* %5, i64 -1
%7 = bitcast i32* %6 to i8*
%8 = tail call i32 @free(i8* %7)
ret void
}
int test_imm_3Euint16_mem(unsigned short *val) {
  return ((*val) & (0x3E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Euint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x3e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Euint16_mem>:
testb  $0x3e,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Euint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 62
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_3Euint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 62
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int ParseIsEscaped(const char *line, const char *c) {
  int active = 0;
  for (;;) {
    if (line == c)
      return active;
    if (*--c != '\\')
      return active;
    active = !active;
  }
}


x86 assembly (clang, -O0):
<ParseIsEscaped>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    112c <ParseIsEscaped+0x2c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <ParseIsEscaped+0x69>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
movsbl -0x1(%rax),%eax
cmp    $0x5c,%eax
je     1153 <ParseIsEscaped+0x53>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <ParseIsEscaped+0x69>
cmpl   $0x0,-0x1c(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <ParseIsEscaped+0x13>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseIsEscaped>:
xor    %eax,%eax
cmp    %rdi,%rsi
je     1122 <ParseIsEscaped+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x5c,-0x1(%rsi)
jne    1122 <ParseIsEscaped+0x22>
add    $0xffffffffffffffff,%rsi
xor    $0x1,%eax
cmp    %rdi,%rsi
jne    1110 <ParseIsEscaped+0x10>
ret

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

LLVM IR (-O2):
define i32 @ParseIsEscaped(i8* readnone %0, i8* %1) {
%3 = icmp eq i8* %1, %0
br i1 %3, label %13, label %4
4: ; preds = %2, %10
%5 = phi i32 [ %11, %10 ], [ 0, %2 ]
%6 = phi i8* [ %7, %10 ], [ %1, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 92
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = xor i32 %5, 1
%12 = icmp eq i8* %7, %0
br i1 %12, label %13, label %4
13: ; preds = %10, %4, %2
%14 = phi i32 [ 0, %2 ], [ %5, %4 ], [ %11, %10 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ CANBaseValid(unsigned long);
unsigned long CANIntNumberGet(unsigned long);
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void CANIntUnregister(unsigned long ulBase) {
  unsigned long ulIntNumber;
  DEBUG_ASSERT(CANBaseValid(ulBase));
  ulIntNumber = CANIntNumberGet(ulBase);
  IntDisable(ulIntNumber);
  IntUnregister(ulIntNumber);
}


x86 assembly (clang, -O0):
<CANIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <CANBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1060 <CANIntNumberGet@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x10(%rbp),%rdi
call   1070 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntUnregister>:
push   %rbx
mov    %rdi,%rbx
call   1050 <CANBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
call   1060 <CANIntNumberGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1070 <IntUnregister@plt>

LLVM IR (-O0):
define void @CANIntUnregister(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @CANBaseValid(i64 %4)
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = call i64 @CANIntNumberGet(i64 %7)
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i32 @IntDisable(i64 %9)
%11 = load i64, i64* %3
%12 = call i32 @IntUnregister(i64 %11)
ret void
}

LLVM IR (-O2):
define void @CANIntUnregister(i64 %0) {
%2 = tail call i32 @CANBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = tail call i64 @CANIntNumberGet(i64 %0)
%5 = tail call i32 @IntDisable(i64 %4)
%6 = tail call i32 @IntUnregister(i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ KaDisp_send_page_cache(unsigned short);
void KaDisp_send_cache_all_pages(void) {
  unsigned short p;
  for (p = 0; p < 8; p++) {
    KaDisp_send_page_cache(p);
  }
}


x86 assembly (clang, -O0):
<KaDisp_send_cache_all_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x8,%eax
jge    1145 <KaDisp_send_cache_all_pages+0x35>
movzwl -0x2(%rbp),%edi
call   1030 <KaDisp_send_page_cache@plt>
mov    -0x2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x2(%rbp)
jmp    111e <KaDisp_send_cache_all_pages+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KaDisp_send_cache_all_pages>:
push   %rax
xor    %edi,%edi
call   1030 <KaDisp_send_page_cache@plt>
mov    $0x1,%edi
call   1030 <KaDisp_send_page_cache@plt>
mov    $0x2,%edi
call   1030 <KaDisp_send_page_cache@plt>
mov    $0x3,%edi
call   1030 <KaDisp_send_page_cache@plt>
mov    $0x4,%edi
call   1030 <KaDisp_send_page_cache@plt>
mov    $0x5,%edi
call   1030 <KaDisp_send_page_cache@plt>
mov    $0x6,%edi
call   1030 <KaDisp_send_page_cache@plt>
mov    $0x7,%edi
pop    %rax
jmp    1030 <KaDisp_send_page_cache@plt>

LLVM IR (-O0):
define void @KaDisp_send_cache_all_pages() {
%1 = alloca i16
store i16 0, i16* %1
br label %2
2: ; preds = %9, %0
%3 = load i16, i16* %1
%4 = zext i16 %3 to i32
%5 = icmp slt i32 %4, 8
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = load i16, i16* %1
%8 = call i32 @KaDisp_send_page_cache(i16 zeroext %7)
br label %9
9: ; preds = %6
%10 = load i16, i16* %1
%11 = add i16 %10, 1
store i16 %11, i16* %1
br label %2
12: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @KaDisp_send_cache_all_pages() {
%1 = tail call i32 @KaDisp_send_page_cache(i16 zeroext 0)
%2 = tail call i32 @KaDisp_send_page_cache(i16 zeroext 1)
%3 = tail call i32 @KaDisp_send_page_cache(i16 zeroext 2)
%4 = tail call i32 @KaDisp_send_page_cache(i16 zeroext 3)
%5 = tail call i32 @KaDisp_send_page_cache(i16 zeroext 4)
%6 = tail call i32 @KaDisp_send_page_cache(i16 zeroext 5)
%7 = tail call i32 @KaDisp_send_page_cache(i16 zeroext 6)
%8 = tail call i32 @KaDisp_send_page_cache(i16 zeroext 7)
ret void
}
int kmemcpy(addr, offset, size)
char *addr;
long offset;
int size;
{
  bcopy((char *)offset, addr, size);
  return 0;
}


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

x86 assembly (clang, -O2):
<kmemcpy>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <bcopy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @kmemcpy(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %5
%8 = inttoptr i64 %7 to i8*
%9 = load i8*, i8** %4
%10 = load i32, i32* %6
%11 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bcopy to i32 (i8*, i8*, i32, ...)*)(i8* %8, i8* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @kmemcpy(i8* %0, i64 %1, i32 %2) {
%4 = inttoptr i64 %1 to i8*
%5 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bcopy to i32 (i8*, i8*, i32, ...)*)(i8* %4, i8* %0, i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
void rte_mov256(uint8_t *dst, const uint8_t *src) { memcpy(dst, src, 256); }


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

x86 assembly (clang, -O2):
<rte_mov256>:
mov    $0x100,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @rte_mov256(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 256)
ret void
}

LLVM IR (-O2):
define void @rte_mov256(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 256)
ret void
}
int Bad(unsigned int N) {
  if (N == 0)
    return 0;
  else
    return Bad(N / 3 + 1) + N - 1;
}


x86 assembly (clang, -O0):
<Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <Bad+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1150 <Bad+0x40>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
add    $0x1,%edi
call   1030 <Bad@plt>
add    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bad>:
test   %edi,%edi
je     1135 <Bad+0x25>
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
mov    $0xaaaaaaab,%edi
imul   %rax,%rdi
shr    $0x21,%rdi
add    $0x1,%edi
call   1030 <Bad@plt>
add    %ebx,%eax
add    $0xffffffff,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Bad(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %10, %5 ], [ 0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = udiv i32 %0, 3
%7 = add nuw nsw i32 %6, 1
%8 = tail call i32 @Bad(i32 %7)
%9 = add i32 %0, -1
%10 = add i32 %9, %8
br label %3
}
void fsg_get_gog_game_path(char *out, const char *app_id) {
  out[0] = '\0';
  (void)app_id;
}


x86 assembly (clang, -O0):
<fsg_get_gog_game_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsg_get_gog_game_path>:
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @fsg_get_gog_game_path(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 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
%7 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @fsg_get_gog_game_path(i8* nocapture writeonly %0, i8* nocapture readnone %1) {
store i8 0, i8* %0
ret void
}
/* Variables and functions */
float max(float, float);
float blendSubtract(float base, float blend) {
  return max(base + blend - 1.0f, 0.0f);
}


x86 assembly (clang, -O0):
<blendSubtract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  0xecc(%rip),%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
call   1030 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blendSubtract>:
addss  %xmm1,%xmm0
addss  0xee4(%rip),%xmm0
xorps  %xmm1,%xmm1
jmp    1030 <max@plt>

LLVM IR (-O0):
define float @blendSubtract(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
%8 = fsub float %7, 1.000000e+00
%9 = call float @max(float %8, float 0.000000e+00)
ret float %9
}

LLVM IR (-O2):
define float @blendSubtract(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fadd float %3, -1.000000e+00
%5 = tail call float @max(float %4, float 0.000000e+00)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char c = 0;
  while (c < 100) {
    if ((c % 2) == 0) {
      printf("%d, ", c);
    }
    c++;
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jge    1164 <main+0x54>
movsbl -0x5(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1157 <main+0x47>
movsbl -0x5(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1123 <main+0x13>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rbx
xor    %ebp,%ebp
jmp    1138 <main+0x18>
xchg   %ax,%ax
add    $0x1,%ebp
cmp    $0x64,%ebp
je     114c <main+0x2c>
test   $0x1,%bpl
jne    1130 <main+0x10>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1130 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 0, %0 ], [ %8, %7 ]
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %5, %1
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 100
br i1 %9, label %10, label %1
10: ; preds = %7
%11 = tail call i32 @putchar(i32 10)
ret i32 0
}
void gtk_scale_get_layout_offsets() {}


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

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

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @RGBAToI420() {
ret void
}
/* Type definitions */
typedef scalar_t__ max;

/* Variables and functions */
int rand();
float RandomNumber(int min, int max) {
  return ((rand() % (int)(((max) + 1) - (min))) + (min));
}


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

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

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

LLVM IR (-O2):
define float @RandomNumber(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
%8 = sitofp i32 %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_rttime_new() {
  printf("NOT IMPLEMENTED:"
         "pa_context_rttime_new"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_context_rttime_new\00"
define i32 @pa_context_rttime_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct isal_zstream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ icf_body_hash1_fillgreedy_lazy(struct isal_zstream *);
void isal_deflate_icf_body_lvl3(struct isal_zstream *stream) {
  icf_body_hash1_fillgreedy_lazy(stream);
}


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

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

LLVM IR (-O0):
%struct.isal_zstream = type { i32 }
define void @isal_deflate_icf_body_lvl3(%struct.isal_zstream* %0) {
%2 = alloca %struct.isal_zstream*
store %struct.isal_zstream* %0, %struct.isal_zstream** %2
%3 = load %struct.isal_zstream*, %struct.isal_zstream** %2
%4 = call i32 @icf_body_hash1_fillgreedy_lazy(%struct.isal_zstream* %3)
ret void
}

LLVM IR (-O2):
%struct.isal_zstream = type { i32 }
define void @isal_deflate_icf_body_lvl3(%struct.isal_zstream* %0) {
%2 = tail call i32 @icf_body_hash1_fillgreedy_lazy(%struct.isal_zstream* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t mp_mul_384(uint64_t c[12], uint64_t a[6], uint64_t b[6]) {
  c[0] = a[1] + b[2];
  return 0;
}


x86 assembly (clang, -O0):
<mp_mul_384>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x18(%rbp),%rax
add    0x10(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_mul_384>:
mov    0x10(%rdx),%rax
add    0x8(%rsi),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @mp_mul_384(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** %5
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = load i64*, i64** %6
%11 = getelementptr inbounds i64, i64* %10, i64 2
%12 = load i64, i64* %11
%13 = add nsw i64 %9, %12
%14 = load i64*, i64** %4
%15 = getelementptr inbounds i64, i64* %14, i64 0
store i64 %13, i64* %15
ret i64 0
}

LLVM IR (-O2):
define i64 @mp_mul_384(i64* nocapture writeonly %0, i64* nocapture %1, i64* nocapture %2) {
%4 = getelementptr inbounds i64, i64* %1, i64 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds i64, i64* %2, i64 2
%7 = load i64, i64* %6
%8 = add nsw i64 %7, %5
store i64 %8, i64* %0
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) usage(const char *filepath) {
  fprintf(stderr, "Usage: %s [-h] [-l len] [-n num] [-r] [-s] [-v]\n",
          filepath);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"Usage: %s [-h] [-l len] [-n num] [-r] [-s] [-v]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"Usage: %s [-h] [-l len] [-n num] [-r] [-s] [-v]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("add(1, 2) = %d\n", add(1, 2));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"add(1, 2) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 1, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
int /*<<< orphan*/ NID_commonName;
int set_cn(int /*<<< orphan*/ *, int /*<<< orphan*/, char const *,
           int /*<<< orphan*/);
int set_cn1(X509 *crt, const char *name) {
  return set_cn(crt, NID_commonName, name, 0);
}


x86 assembly (clang, -O0):
<set_cn1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <set_cn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cn1>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
xor    %ecx,%ecx
jmp    1030 <set_cn@plt>

LLVM IR (-O0):
@NID_commonName = global i32 0
define i32 @set_cn1(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* @NID_commonName
%7 = load i8*, i8** %4
%8 = call i32 @set_cn(i32* %5, i32 %6, i8* %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
@NID_commonName = global i32 0
define i32 @set_cn1(i32* %0, i8* %1) {
%3 = load i32, i32* @NID_commonName
%4 = tail call i32 @set_cn(i32* %0, i32 %3, i8* %1, i32 0)
ret i32 %4
}
unsigned int ilog(int x) {
  unsigned int r = 0;
  while (x > 0) {
    r += 1;
    x >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<ilog>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112f <ilog+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <ilog+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilog>:
xor    %eax,%eax
test   %edi,%edi
jle    111c <ilog+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <ilog+0x10>
ret

LLVM IR (-O0):
define i32 @ilog(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 sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = ashr i32 %10, 1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @ilog(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
struct _tuple4 {
  int dummy;
};
struct Cyc_Sexp_Parser {
  int dummy;
};

/* Variables and functions */
struct _tuple4 *Cyc_Sexp_mk_uint(unsigned int);
unsigned int Cyc_Sexp_parse_int(struct Cyc_Sexp_Parser *);
struct _tuple4 *Cyc_Sexp_parse_uint(struct Cyc_Sexp_Parser *p) {
  unsigned _T0;
  struct _tuple4 *_T1;
  _T0 = Cyc_Sexp_parse_int(p);
  _T1 = Cyc_Sexp_mk_uint(_T0);
  return _T1;
}


x86 assembly (clang, -O0):
<Cyc_Sexp_parse_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Cyc_Sexp_parse_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <Cyc_Sexp_mk_uint@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Sexp_parse_uint>:
push   %rax
call   1030 <Cyc_Sexp_parse_int@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <Cyc_Sexp_mk_uint@plt>

LLVM IR (-O0):
%struct._tuple4 = type { i32 }
%struct.Cyc_Sexp_Parser = type { i32 }
define %struct._tuple4* @Cyc_Sexp_parse_uint(%struct.Cyc_Sexp_Parser* %0) {
%2 = alloca %struct.Cyc_Sexp_Parser*
%3 = alloca i32
%4 = alloca %struct._tuple4*
store %struct.Cyc_Sexp_Parser* %0, %struct.Cyc_Sexp_Parser** %2
%5 = load %struct.Cyc_Sexp_Parser*, %struct.Cyc_Sexp_Parser** %2
%6 = call i32 @Cyc_Sexp_parse_int(%struct.Cyc_Sexp_Parser* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call %struct._tuple4* @Cyc_Sexp_mk_uint(i32 %7)
store %struct._tuple4* %8, %struct._tuple4** %4
%9 = load %struct._tuple4*, %struct._tuple4** %4
ret %struct._tuple4* %9
}

LLVM IR (-O2):
%struct._tuple4 = type { i32 }
%struct.Cyc_Sexp_Parser = type { i32 }
define %struct._tuple4* @Cyc_Sexp_parse_uint(%struct.Cyc_Sexp_Parser* %0) {
%2 = tail call i32 @Cyc_Sexp_parse_int(%struct.Cyc_Sexp_Parser* %0)
%3 = tail call %struct._tuple4* @Cyc_Sexp_mk_uint(i32 %2)
ret %struct._tuple4* %3
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int htonl(int /*<<< orphan*/);
uint64_t htonll(uint64_t value) {
  int num = 1;
  if (*(char *)&num == 1)
    return htonl((uint32_t)(value & 0xFFFFFFFF)) |
           htonl((uint32_t)(value >> 32));
  return value;
}


x86 assembly (clang, -O0):
<htonll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movsbl -0xc(%rbp),%eax
cmp    $0x1,%eax
jne    115b <htonll+0x4b>
mov    -0x8(%rbp),%edi
and    $0xffffffff,%edi
call   1030 <htonl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <htonll+0x51>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonll>:
push   %rbx
call   1030 <htonl@plt>
mov    %eax,%ebx
call   1030 <htonl@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @htonll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %4
%5 = bitcast i32* %4 to i8*
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i32, i32* %3
%11 = and i32 %10, -1
%12 = call i32 @htonl(i32 %11)
%13 = load i32, i32* %3
%14 = ashr i32 %13, 32
%15 = call i32 @htonl(i32 %14)
%16 = or i32 %12, %15
store i32 %16, i32* %2
br label %19
17: ; preds = %1
%18 = load i32, i32* %3
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %9
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @htonll(i32 %0) {
%2 = tail call i32 @htonl(i32 %0)
%3 = tail call i32 @htonl(i32 poison)
%4 = or i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f22(long j) {
  if ((j & ((1UL << (22)) - 1)) >= ((1UL << ((22) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f22>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3fffff,%rax
cmp    $0x200002,%rax
jb     1139 <f22+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f22>:
and    $0x3ffffe,%edi
cmp    $0x200002,%edi
jae    111f <f22+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f22(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4194303
%5 = icmp uge i64 %4, 2097154
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f22(i64 %0) {
%2 = and i64 %0, 4194302
%3 = icmp ugt i64 %2, 2097153
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int w5100_read(int, int /*<<< orphan*/ *, int);
unsigned w5100_readSIPR(uint8_t *buff) { return w5100_read(0x000F, buff, 4); }


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

x86 assembly (clang, -O2):
mov    %rdi,%rsi
mov    $0xf,%edi
mov    $0x4,%edx
jmp    1030 <w5100_read@plt>

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

LLVM IR (-O2):
define i32 @w5100_readSIPR(i32* %0) {
%2 = tail call i32 @w5100_read(i32 15, i32* %0, i32 4)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void print_separator(int fd) { fputs("--------", (FILE *)fd); }


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

x86 assembly (clang, -O2):
<print_separator>:
movslq %edi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"--------\00"
define void @print_separator(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"--------\00"
define void @print_separator(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8, i64 1, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
void remove_pidfile(void) {
  unlink("/var/run/opiealarm.pid");
  signal(SIGUSR2, SIG_DFL);
}


x86 assembly (clang, -O0):
<remove_pidfile>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_pidfile>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
pop    %rax
jmp    1040 <signal@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"/var/run/opiealarm.pid\00"
@SIGUSR2 = global i32 0
@SIG_DFL = global i32 0
define void @remove_pidfile() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @SIGUSR2
%3 = load i32, i32* @SIG_DFL
%4 = call i32 @signal(i32 %2, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"/var/run/opiealarm.pid\00"
@SIGUSR2 = global i32 0
@SIG_DFL = global i32 0
define void @remove_pidfile() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @SIGUSR2
%3 = load i32, i32* @SIG_DFL
%4 = tail call i32 @signal(i32 %2, i32 %3)
ret void
}
/* Variables and functions */
float log10(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int swl = 100;
  int r = 10;
  float log_r = log10(r);
  int p2 = swl - (20 * log_r) - 8;
  printf("%f\n", log_r);
  printf("L2 = %i\n", p2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <log10@plt>
movss  %xmm0,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
movss  0xea8(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xe94(%rip),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
cvttss2si -0x10(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <log10@plt>
cvttss2si %xmm0,%esi
mulss  0xec9(%rip),%xmm0
addss  0xec5(%rip),%xmm0
addss  0xec1(%rip),%xmm0
cvttss2si %xmm0,%ebx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [9 x i8] c"L2 = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
store i32 10, i32* %3
%6 = load i32, i32* %3
%7 = call float @log10(i32 %6)
store float %7, float* %4
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to float
%10 = load float, float* %4
%11 = call float @llvm.fmuladd.f32(float -2.000000e+01, float %10, float %9)
%12 = fsub float %11, 8.000000e+00
%13 = fptosi float %12 to i32
store i32 %13, i32* %5
%14 = load float, float* %4
%15 = fptosi float %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [9 x i8] c"L2 = %i\0A\00"
define i32 @main() {
%1 = tail call float @log10(i32 10)
%2 = tail call float @llvm.fmuladd.f32(float %1, float -2.000000e+01, float 1.000000e+02)
%3 = fadd float %2, -8.000000e+00
%4 = fptosi float %3 to i32
%5 = fptosi float %1 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
void close_archive(fd) int fd;
{ (void)close(fd); }


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

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

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

LLVM IR (-O2):
define void @close_archive(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
ret void
}
void I422ToARGB1555Row_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @I422ToARGB1555Row_Any_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _endhostdnsent();
int /*<<< orphan*/ _endhosthtent();
void endhostent() {
  _endhosthtent();
  _endhostdnsent();
}


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

x86 assembly (clang, -O2):
<endhostent>:
push   %rax
xor    %eax,%eax
call   1030 <_endhosthtent@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <_endhostdnsent@plt>

LLVM IR (-O0):
define void @endhostent() {
%1 = call i32 (...) @_endhosthtent()
%2 = call i32 (...) @_endhostdnsent()
ret void
}

LLVM IR (-O2):
define void @endhostent() {
%1 = tail call i32 (...) @_endhosthtent()
%2 = tail call i32 (...) @_endhostdnsent()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, size_t);
void read_handler(void *rm_addr, size_t size) {
  printf("*** READ_HANDLER *** rm_addr = %p, size = %d\n", rm_addr, size);
}


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

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

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

LLVM IR (-O2):
@.str = [46 x i8] c"*** READ_HANDLER *** rm_addr = %p, size = %d\0A\00"
define void @read_handler(i8* %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
ret void
}