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

/* Variables and functions */
scalar_t__ ferror(int /*<<< orphan*/ *);
int smp_sio_is_stream_err(FILE *fp) {
  if (ferror(fp) == 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<smp_sio_is_stream_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ferror@plt>
cmp    $0x0,%rax
jne    113b <smp_sio_is_stream_err+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1142 <smp_sio_is_stream_err+0x32>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_sio_is_stream_err>:
push   %rax
call   1030 <ferror@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @smp_sio_is_stream_err(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i64 @ferror(i32* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @smp_sio_is_stream_err(i32* nocapture %0) {
%2 = tail call i64 @ferror(i32* %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void USART_InitPortStructs() {}


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

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

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

LLVM IR (-O2):
define void @USART_InitPortStructs() {
ret void
}
/* Variables and functions */
unsigned long genrand_int32();
unsigned long prng(unsigned long min, unsigned long max) {
  return ((genrand_int32() % (max - min + 1)) + min);
}


x86 assembly (clang, -O0):
<prng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <genrand_int32@plt>
mov    -0x10(%rbp),%rcx
sub    -0x8(%rbp),%rcx
add    $0x1,%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prng>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <genrand_int32@plt>
sub    %r14,%rbx
add    $0x1,%rbx
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     113e <prng+0x2e>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
jmp    1144 <prng+0x34>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @prng(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 (...) @genrand_int32()
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub i64 %6, %7
%9 = add i64 %8, 1
%10 = urem i64 %5, %9
%11 = load i64, i64* %3
%12 = add i64 %10, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @prng(i64 %0, i64 %1) {
%3 = tail call i64 (...) @genrand_int32()
%4 = sub i64 1, %0
%5 = add i64 %4, %1
%6 = urem i64 %3, %5
%7 = add i64 %6, %0
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint64_t;

/* Variables and functions */
void a_or_64(volatile uint64_t *p, uint64_t v) { *p |= v; }


x86 assembly (clang, -O0):
<a_or_64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_or_64>:
mov    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
or     %eax,(%rdi)
ret

LLVM IR (-O0):
define void @a_or_64(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store volatile i32 %1, i32* %4
%5 = load volatile i32, i32* %4
%6 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
%8 = or i32 %7, %5
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @a_or_64(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
%5 = load volatile i32, i32* %0
%6 = or i32 %5, %4
store volatile i32 %6, i32* %0
ret void
}
void I2CMasterIntDisableEx(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<I2CMasterIntDisableEx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntDisableEx>:
not    %rsi
and    %rsi,0x10(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterIntDisableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 16
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntDisableEx(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 16
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int a[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%d ", a[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test6(unsigned int f) {
  if ((f >> (32 - 1)) & 64)
    foo();
}


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1f,%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1134 <test6+0x24>
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 31
%5 = and i32 %4, 64
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @foo()
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @test6(i32 %0) {
ret void
}
void hugo_setgametitle(char *t) {}


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

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

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

LLVM IR (-O2):
define void @hugo_setgametitle(i8* nocapture %0) {
ret void
}
long main() {
  char *str;
  str = "not a long";
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"not a long\00"
define i64 @main() {
%1 = alloca i64
%2 = alloca i8*
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @main() {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ close(int const);
void closep(const int *fd) {
  if (*fd >= 0)
    close(*fd);
}


x86 assembly (clang, -O0):
<closep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1134 <closep+0x24>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closep>:
mov    (%rdi),%edi
test   %edi,%edi
js     111b <closep+0xb>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @closep(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %4, %1
ret void
}
int cnt_trailing_set_bits(int num) {
  int i;
  int cnt = 0;
  for (i = 0; (i <= 31) && (num >> i) & 1; i++) {
    cnt++;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<cnt_trailing_set_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x1f,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jg     1138 <cnt_trailing_set_bits+0x38>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1148 <cnt_trailing_set_bits+0x48>
jmp    115f <cnt_trailing_set_bits+0x5f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <cnt_trailing_set_bits+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnt_trailing_set_bits>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
bt     %eax,%edi
jae    114b <cnt_trailing_set_bits+0x4b>
lea    0x1(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jae    1144 <cnt_trailing_set_bits+0x44>
lea    0x2(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jae    1148 <cnt_trailing_set_bits+0x48>
lea    0x3(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jae    114c <cnt_trailing_set_bits+0x4c>
add    $0x4,%eax
cmp    $0x20,%eax
jne    1110 <cnt_trailing_set_bits+0x10>
mov    $0x20,%eax
ret
add    $0x1,%eax
ret
add    $0x2,%eax
ret
add    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @cnt_trailing_set_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %19, %1
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 31
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = ashr i32 %9, %10
%12 = and i32 %11, 1
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %8, %5
%15 = phi i1 [ false, %5 ], [ %13, %8 ]
br i1 %15, label %16, label %22
16: ; preds = %14
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %19
19: ; preds = %16
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %5
22: ; preds = %14
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @cnt_trailing_set_bits(i32 %0) {
br label %2
2: ; preds = %22, %1
%3 = phi i32 [ 0, %1 ], [ %23, %22 ]
%4 = shl nuw i32 1, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
br i1 %6, label %25, label %7
7: ; preds = %2
%8 = or i32 %3, 1
%9 = shl nuw i32 1, %8
%10 = and i32 %9, %0
%11 = icmp eq i32 %10, 0
br i1 %11, label %25, label %12
12: ; preds = %7
%13 = or i32 %3, 2
%14 = shl nuw i32 1, %13
%15 = and i32 %14, %0
%16 = icmp eq i32 %15, 0
br i1 %16, label %25, label %17
17: ; preds = %12
%18 = or i32 %3, 3
%19 = shl nuw i32 1, %18
%20 = and i32 %19, %0
%21 = icmp eq i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %17
%23 = add nuw nsw i32 %3, 4
%24 = icmp eq i32 %23, 32
br i1 %24, label %25, label %2
25: ; preds = %22, %17, %12, %7, %2
%26 = phi i32 [ %3, %2 ], [ %8, %7 ], [ %13, %12 ], [ %18, %17 ], [ 32, %22 ]
ret i32 %26
}
void power_process(void) {}


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

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

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

LLVM IR (-O2):
define void @power_process() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TextPrintMsg(char *);
void ShowTitle(void) {
  TextPrintMsg("\n"
               "**** GLBSP Node Builder "
               "2.27"
               " (C) 2010 Andrew Apted ****\n\n");
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"\0A**** GLBSP Node Builder 2.27 (C) 2010 Andrew Apted ****\0A\0A\00"
define void @ShowTitle() {
%1 = call i32 @TextPrintMsg(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"\0A**** GLBSP Node Builder 2.27 (C) 2010 Andrew Apted ****\0A\0A\00"
define void @ShowTitle() {
%1 = tail call i32 @TextPrintMsg(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int main() {
  switch (fork()) {
  case -1:
    perror("cannot fork");
  case 0:
    printf("I am the child\n");
  default:
    puts("I am the parent");
    wait(NULL);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1070 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0xffffffff,%eax
je     1189 <main+0x39>
jmp    1179 <main+0x29>
mov    -0x8(%rbp),%eax
test   %eax,%eax
je     1195 <main+0x45>
jmp    11a1 <main+0x51>
lea    0xe70(%rip),%rdi
call   1050 <perror@plt>
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <wait@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %eax,%eax
je     115d <main+0x1d>
cmp    $0xffffffff,%eax
jne    1169 <main+0x29>
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <wait@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"cannot fork\00"
@.str.1 = [16 x i8] c"I am the child\0A\00"
@.str.2 = [16 x i8] c"I am the parent\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fork()
switch i32 %2, label %7 [
i32 -1, label %3
i32 0, label %5
]
3: ; preds = %0
%4 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %0, %5
%8 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @wait(i32* null)
br label %10
10: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"cannot fork\00"
@.str.2 = [16 x i8] c"I am the parent\00"
@str = [15 x i8] c"I am the child\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
switch i32 %1, label %6 [
i32 -1, label %2
i32 0, label %4
]
2: ; preds = %0
%3 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %0, %4
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @wait(i32* null)
ret i32 0
}
unsigned strhash(const char *x) {
  int h = 0;
  while (*x)
    h = h * 13 + *(x++);
  return h;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <strhash+0x3c>
imul   $0xd,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strhash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <strhash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,2),%edx
lea    (%rax,%rdx,4),%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strhash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 13
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add nsw i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
int c010(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c010() {
ret i32 0
}
void gtk_cell_layout_clear() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @genjalr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void err(const char *msg) {
  endwin();
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <endwin@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <endwin@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @endwin()
%4 = load i8*, i8** %2
%5 = call i32 @perror(i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @err(i8* nocapture %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @perror(i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void error(char *msg, int no) {
  if (!msg)
    return;
  printf("Error: %s\n", msg);
  exit(no);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1140 <error+0x20>
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
test   %rdi,%rdi
jne    1126 <error+0x6>
ret
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
ret void
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* %4
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %5
4: ; preds = %2
ret void
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Type int has a size of %u bytes.\n", sizeof(int));
  printf("Type char has a size of %u bytes.\n", sizeof(char));
  printf("Type long has a size of %u bytes.\n", sizeof(long));
  printf("Type double has a size of %u bytes.\n", sizeof(double));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Type int has a size of %u bytes.\0A\00"
@.str.1 = [35 x i8] c"Type char has a size of %u bytes.\0A\00"
@.str.2 = [35 x i8] c"Type long has a size of %u bytes.\0A\00"
@.str.3 = [37 x i8] c"Type double has a size of %u bytes.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Type int has a size of %u bytes.\0A\00"
@.str.1 = [35 x i8] c"Type char has a size of %u bytes.\0A\00"
@.str.2 = [35 x i8] c"Type long has a size of %u bytes.\0A\00"
@.str.3 = [37 x i8] c"Type double has a size of %u bytes.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}
int list_cmp(const void *l, const void *r, void *_cmp) {
  int (*cmp)(const void *, const void *) = _cmp;
  return cmp(*(void **)l, *(void **)r);
}


x86 assembly (clang, -O0):
<list_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rdi
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    *%rdx

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

LLVM IR (-O2):
define i32 @list_cmp(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32 (i8*, i8*)*
%5 = bitcast i8* %0 to i8**
%6 = load i8*, i8** %5
%7 = bitcast i8* %1 to i8**
%8 = load i8*, i8** %7
%9 = tail call i32 %4(i8* %6, i8* %8)
ret i32 %9
}
char *mgmtUserName() { return "user"; }


x86 assembly (clang, -O0):
<mgmtUserName>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgmtUserName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"user\00"
define i8* @mgmtUserName() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"user\00"
define i8* @mgmtUserName() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ flash_device_erase();
int /*<<< orphan*/ flash_init();
void erase_flash(void) {
  flash_init();
  flash_device_erase();
}


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

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

LLVM IR (-O0):
define void @erase_flash() {
%1 = call i32 (...) @flash_init()
%2 = call i32 (...) @flash_device_erase()
ret void
}

LLVM IR (-O2):
define void @erase_flash() {
%1 = tail call i32 (...) @flash_init()
%2 = tail call i32 (...) @flash_device_erase()
ret void
}
/* Variables and functions */
int compare_keys(void *, void *, int);
int comp_keys_3(void *key1, void *key2) { return compare_keys(key1, key2, 3); }


x86 assembly (clang, -O0):
<comp_keys_3>:
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    $0x3,%edx
call   1030 <compare_keys@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @comp_keys_3(i8* %0, i8* %1) {
%3 = tail call i32 @compare_keys(i8* %0, i8* %1, i32 3)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void adts_clear_protection_absent(uint8_t *p_adts) { p_adts[1] &= ~0x01; }


x86 assembly (clang, -O0):
<adts_clear_protection_absent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_clear_protection_absent>:
andb   $0xfe,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @adts_clear_protection_absent(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = and i32 %3, -2
store i32 %4, i32* %2
ret void
}
void deeper_nested(char *a) {
  while (*a) {
    while (*a) {
      while (*a) {
      }
    }
    while (*a) {
    }
  }
}


x86 assembly (clang, -O0):
<deeper_nested>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <deeper_nested+0x5f>
jmp    111a <deeper_nested+0x1a>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1143 <deeper_nested+0x43>
jmp    112c <deeper_nested+0x2c>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <deeper_nested+0x3e>
jmp    112c <deeper_nested+0x2c>
jmp    111a <deeper_nested+0x1a>
jmp    1148 <deeper_nested+0x48>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <deeper_nested+0x5a>
jmp    1148 <deeper_nested+0x48>
jmp    1108 <deeper_nested+0x8>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @deeper_nested(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int mlockall(int flags) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<mlockall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlockall>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @mlockall(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Variables and functions */
int(Memento_getBlockNum)(void *i) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Memento_getBlockNum(i8* nocapture readnone %0) {
ret i32 0
}
void dehyphen(char *s) {
  char *t = s;
  char *h = s;
  while (*h)
    if (*h == '_' || *h == '-')
      ++h;
    else
      *t++ = *h++;
  *t = '\0';
}


x86 assembly (clang, -O0):
<dehyphen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     117d <dehyphen+0x7d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     1145 <dehyphen+0x45>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1156 <dehyphen+0x56>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1178 <dehyphen+0x78>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1118 <dehyphen+0x18>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dehyphen>:
mov    %rdi,%rax
jmp    1114 <dehyphen+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x2d,%cl
je     1110 <dehyphen+0x10>
cmp    $0x5f,%cl
je     1110 <dehyphen+0x10>
test   %cl,%cl
je     112d <dehyphen+0x2d>
mov    %cl,(%rdi)
add    $0x1,%rdi
jmp    1110 <dehyphen+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @dehyphen(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = phi i8* [ %0, %1 ], [ %10, %8 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %11
i8 95, label %8
i8 45, label %8
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %5, i8* %3
br label %8
8: ; preds = %2, %2, %6
%9 = phi i8* [ %7, %6 ], [ %3, %2 ], [ %3, %2 ]
%10 = getelementptr inbounds i8, i8* %4, i64 1
br label %2
11: ; preds = %2
store i8 0, i8* %3
ret void
}
int cpudebug_disabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cpudebug_disabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _SC_OPEN_MAX;
int /*<<< orphan*/ close(int);
int sysconf(int /*<<< orphan*/);
void close_fds(void) {
  int fd, max;
  max = sysconf(_SC_OPEN_MAX);
  for (fd = 3; fd < max; fd++)
    close(fd);
}


x86 assembly (clang, -O0):
<close_fds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,-0x8(%rbp)
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <close_fds+0x42>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <close_fds+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_fds>:
push   %rbp
push   %rbx
push   %rax
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
cmp    $0x4,%eax
jl     114e <close_fds+0x2e>
mov    %eax,%ebx
mov    $0x3,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <close@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1140 <close_fds+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @run()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int menu();
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ print();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
int main() {
  int n;
  printf("WELCOME TO THE LINKED LIST APPLICATION\n");
  clear();
  usleep(500000);
  do {
    clear();
    msleep(500);
    print();
    n = menu();
  } while (n != 17);
  clear();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <clear@plt>
mov    $0x7a120,%edi
call   1080 <usleep@plt>
mov    $0x0,%al
call   1070 <clear@plt>
mov    $0x1f4,%edi
call   1040 <msleep@plt>
mov    $0x0,%al
call   1060 <print@plt>
mov    $0x0,%al
call   1030 <menu@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x11,-0x8(%rbp)
jne    118c <main+0x2c>
mov    $0x0,%al
call   1070 <clear@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <clear@plt>
mov    $0x7a120,%edi
call   1080 <usleep@plt>
xchg   %ax,%ax
xor    %eax,%eax
call   1070 <clear@plt>
mov    $0x1f4,%edi
call   1050 <msleep@plt>
xor    %eax,%eax
call   1060 <print@plt>
xor    %eax,%eax
call   1040 <menu@plt>
cmp    $0x11,%eax
jne    1180 <main+0x20>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"WELCOME TO THE LINKED LIST APPLICATION\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @clear()
%5 = call i32 @usleep(i32 500000)
br label %6
6: ; preds = %11, %0
%7 = call i32 (...) @clear()
%8 = call i32 @msleep(i32 500)
%9 = call i32 (...) @print()
%10 = call i32 (...) @menu()
store i32 %10, i32* %2
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 17
br i1 %13, label %6, label %14
14: ; preds = %11
%15 = call i32 (...) @clear()
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@str = [39 x i8] c"WELCOME TO THE LINKED LIST APPLICATION\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @clear()
%3 = tail call i32 @usleep(i32 500000)
br label %4
4: ; preds = %4, %0
%5 = tail call i32 (...) @clear()
%6 = tail call i32 @msleep(i32 500)
%7 = tail call i32 (...) @print()
%8 = tail call i32 (...) @menu()
%9 = icmp eq i32 %8, 17
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = tail call i32 (...) @clear()
ret i32 0
}
/* Variables and functions */
int INT_MIN;
int divide_power2(int x, int k) {
  int sign_mask = INT_MIN;
  int is_negative = x & sign_mask;
  is_negative && (x = x + (1 << k) - 1);
  return x >> k;
}


x86 assembly (clang, -O0):
<divide_power2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     114e <divide_power2+0x4e>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_power2>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    0x2ed8(%rip),%rdx
test   %edi,(%rdx)
lea    -0x1(%rdi,%rax,1),%eax
cmove  %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @divide_power2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* @INT_MIN
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = and i32 %8, %9
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = shl i32 1, %15
%17 = add nsw i32 %14, %16
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %3
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %13, %2
%21 = phi i1 [ false, %2 ], [ %19, %13 ]
%22 = zext i1 %21 to i32
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = ashr i32 %23, %24
ret i32 %25
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @divide_power2(i32 %0, i32 %1) {
%3 = load i32, i32* @INT_MIN
%4 = and i32 %3, %0
%5 = icmp eq i32 %4, 0
%6 = shl nuw i32 1, %1
%7 = add i32 %0, -1
%8 = add i32 %7, %6
%9 = select i1 %5, i32 %0, i32 %8
%10 = ashr i32 %9, %1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ test_psf2();
int main(int argc, char *argv[]) {
  test_psf2();
  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    $0x0,%al
call   1030 <test_psf2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_psf2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @test_psf2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_psf2()
ret i32 0
}
void ff_hevc_put_hevc_pel_pixels32_8_sse4() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void *tool_thread_init(pthread_t args) {
  printf("initializing thread %#lx\n", args);
}


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

x86 assembly (clang, -O2):
<tool_thread_init>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [26 x i8] c"initializing thread %#lx\0A\00"
define noalias i8* @tool_thread_init(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* undef
}
OP(fd, b3) { op_b3(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_b3()
ret i32 undef
}
void CopyRow_ERMS() {}


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

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

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

LLVM IR (-O2):
define void @CopyRow_ERMS() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mm_yy_flex_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @mm_yy_flex_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}