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

/* Variables and functions */
void *MAP_FAILED;
int /*<<< orphan*/ Sys_failure(char *);
void *mmap(void *, size_t, int, int, int, int /*<<< orphan*/);
void *Mmap(void *start, size_t length, int prot, int flags, int fd,
           off_t offset) {
  void *retval;
  retval = mmap(start, length, prot, flags, fd, offset);
  if (retval == MAP_FAILED)
    Sys_failure("mmap");
  return retval;
}


x86 assembly (clang, -O0):
<Mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1030 <mmap@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%rax
jne    117d <Mmap+0x5d>
lea    0xe88(%rip),%rdi
call   1040 <Sys_failure@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mmap>:
push   %rbx
call   1030 <mmap@plt>
mov    %rax,%rbx
mov    0x2eb0(%rip),%rax
cmp    (%rax),%rbx
jne    1141 <Mmap+0x21>
lea    0xec4(%rip),%rdi
call   1040 <Sys_failure@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@MAP_FAILED = global i8* null
@.str = [5 x i8] c"mmap\00"
define i8* @Mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i8*, i8** %7
%15 = load i64, i64* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = call i8* @mmap(i8* %14, i64 %15, i32 %16, i32 %17, i32 %18, i32 %19)
store i8* %20, i8** %13
%21 = load i8*, i8** %13
%22 = load i8*, i8** @MAP_FAILED
%23 = icmp eq i8* %21, %22
br i1 %23, label %24, label %26
24: ; preds = %6
%25 = call i32 @Sys_failure(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %26
26: ; preds = %24, %6
%27 = load i8*, i8** %13
ret i8* %27
}

LLVM IR (-O2):
@MAP_FAILED = global i8* null
@.str = [5 x i8] c"mmap\00"
define i8* @Mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%8 = load i8*, i8** @MAP_FAILED
%9 = icmp eq i8* %7, %8
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %6
ret i8* %7
}
void RTCFlagStatusClear(unsigned long ulFlag) {

  ;
  (*((volatile unsigned long *)(0x40002800 + 0x00000004))) |= ulFlag;
}


x86 assembly (clang, -O0):
<RTCFlagStatusClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x40002804,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x40002804,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTCFlagStatusClear>:
or     %rdi,0x40002804
40
ret

LLVM IR (-O0):
define void @RTCFlagStatusClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1073752068 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1073752068 to i64*)
ret void
}

LLVM IR (-O2):
define void @RTCFlagStatusClear(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1073752068 to i64*)
%3 = or i64 %2, %0
store volatile i64 %3, i64* inttoptr (i64 1073752068 to i64*)
ret void
}
/* Variables and functions */
long double modf(long double param, long double *intpart) {
  *intpart = (int)param;
  return (param - *intpart);
}


x86 assembly (clang, -O0):
<modf>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x22(%rbp)
movzwl -0x22(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x24(%rbp)
fldcw  -0x24(%rbp)
fistpl -0x20(%rbp)
fldcw  -0x22(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
fildl  -0x1c(%rbp)
mov    -0x18(%rbp),%rax
fstpt  (%rax)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fsubrp %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<modf>:
fldt   0x8(%rsp)
fnstcw -0xc(%rsp)
movzwl -0xc(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0xa(%rsp)
fldcw  -0xa(%rsp)
fistl  -0x8(%rsp)
fldcw  -0xc(%rsp)
mov    -0x8(%rsp),%eax
mov    %eax,-0x4(%rsp)
fildl  -0x4(%rsp)
fld    %st(0)
fstpt  (%rdi)
fsubrp %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @modf(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptosi x86_fp80 %5 to i32
%7 = sitofp i32 %6 to x86_fp80
%8 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %7, x86_fp80* %8
%9 = load x86_fp80, x86_fp80* %3
%10 = load x86_fp80*, x86_fp80** %4
%11 = load x86_fp80, x86_fp80* %10
%12 = fsub x86_fp80 %9, %11
ret x86_fp80 %12
}

LLVM IR (-O2):
define x86_fp80 @modf(x86_fp80 %0, x86_fp80* nocapture writeonly %1) {
%3 = fptosi x86_fp80 %0 to i32
%4 = sitofp i32 %3 to x86_fp80
store x86_fp80 %4, x86_fp80* %1
%5 = fsub x86_fp80 %0, %4
ret x86_fp80 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(stderr, "FONT.ROM translator from KANJI-ROM for Quasi88 Ver 0.1\n");
  fprintf(stderr, "Usage: kanji2font [KANJI-ROM filename] [output filename]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeef(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"FONT.ROM translator from KANJI-ROM for Quasi88 Ver 0.1\0A\00"
@.str.1 = [58 x i8] c"Usage: kanji2font [KANJI-ROM filename] [output filename]\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"FONT.ROM translator from KANJI-ROM for Quasi88 Ver 0.1\0A\00"
@.str.1 = [58 x i8] c"Usage: kanji2font [KANJI-ROM filename] [output filename]\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
void PWM_OC123_IRQHandler(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @inside_f3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void playlistEndedCallback(void *user) { printf("Playlist ended!"); }


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Playlist ended!\00"
define void @playlistEndedCallback(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned fui(unsigned a) { return a + -1; }


x86 assembly (clang, -O0):
<fui>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fui>:
lea    -0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @fui(i32 %0) {
%2 = add i32 %0, -1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_scale_each_cs(long, long);
void test_scale_all_permutations(long dim_a, long dim_b) {
  test_scale_each_cs(dim_a, dim_b);
  test_scale_each_cs(dim_b, dim_a);
}


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

x86 assembly (clang, -O2):
<test_scale_all_permutations>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <test_scale_each_cs@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <test_scale_each_cs@plt>

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

LLVM IR (-O2):
define void @test_scale_all_permutations(i64 %0, i64 %1) {
%3 = tail call i32 @test_scale_each_cs(i64 %0, i64 %1)
%4 = tail call i32 @test_scale_each_cs(i64 %1, i64 %0)
ret void
}
void test_islessgreater(double x, double y, int true) {
  if (__builtin_islessgreater(x, y)) {
    if (!true)
      abort();
  } else {
    if (true)
      abort();
  }
}


x86 assembly (clang, -O0):
<test_islessgreater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
je     1149 <test_islessgreater+0x39>
cmpl   $0x0,-0x14(%rbp)
jne    1144 <test_islessgreater+0x34>
call   1030 <abort@plt>
jmp    115d <test_islessgreater+0x4d>
cmpl   $0x0,-0x14(%rbp)
je     1158 <test_islessgreater+0x48>
call   1030 <abort@plt>
jmp    115d <test_islessgreater+0x4d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_islessgreater>:
push   %rax
ucomisd %xmm1,%xmm0
je     111d <test_islessgreater+0xd>
test   %edi,%edi
je     1121 <test_islessgreater+0x11>
pop    %rax
ret
test   %edi,%edi
je     111b <test_islessgreater+0xb>
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test_islessgreater(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp one double %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %10
unreachable
14: ; preds = %10
br label %20
15: ; preds = %3
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
unreachable
19: ; preds = %15
br label %20
20: ; preds = %19, %14
ret void
}

LLVM IR (-O2):
define void @test_islessgreater(double %0, double %1, i32 %2) {
%4 = fcmp ueq double %0, %1
%5 = icmp eq i32 %2, 0
br i1 %4, label %8, label %6
6: ; preds = %3
br i1 %5, label %7, label %10
7: ; preds = %6
tail call void @abort()
unreachable
8: ; preds = %3
br i1 %5, label %10, label %9
9: ; preds = %8
tail call void @abort()
unreachable
10: ; preds = %8, %6
ret void
}
void ez_def_mutex_unlock(volatile void *_mutex) { (*(int *)_mutex)--; }


x86 assembly (clang, -O0):
<ez_def_mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ez_def_mutex_unlock>:
addl   $0xffffffff,(%rdi)
ret

LLVM IR (-O0):
define void @ez_def_mutex_unlock(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = add nsw i32 %5, -1
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @ez_def_mutex_unlock(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dequeueList();
int /*<<< orphan*/ peekList();
int /*<<< orphan*/ reportError(char);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int rBrack() {
  if (strcmp(peekList(), "]") != 0) {
    reportError(']');
    return 0;
  }
  dequeueList();
  return 1;
}


x86 assembly (clang, -O0):
<rBrack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <peekList@plt>
mov    %eax,%edi
lea    0xea8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     117d <rBrack+0x3d>
mov    $0x5d,%edi
call   1030 <reportError@plt>
movl   $0x0,-0x4(%rbp)
jmp    118b <rBrack+0x4b>
mov    $0x0,%al
call   1060 <dequeueList@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rBrack>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <peekList@plt>
lea    0xeaf(%rip),%rsi
mov    %eax,%edi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1169 <rBrack+0x29>
mov    $0x5d,%edi
call   1030 <reportError@plt>
jmp    1175 <rBrack+0x35>
xor    %eax,%eax
call   1060 <dequeueList@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"]\00"
define i32 @rBrack() {
%1 = alloca i32
%2 = call i32 (...) @peekList()
%3 = call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @reportError(i8 signext 93)
store i32 0, i32* %1
br label %9
7: ; preds = %0
%8 = call i32 (...) @dequeueList()
store i32 1, i32* %1
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"]\00"
define i32 @rBrack() {
%1 = tail call i32 (...) @peekList()
%2 = tail call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @reportError(i8 signext 93)
br label %8
6: ; preds = %0
%7 = tail call i32 (...) @dequeueList()
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 0, %4 ], [ 1, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void stderr_putchar(char c) { write(2, &c, 1); }


x86 assembly (clang, -O0):
<stderr_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stderr_putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @stderr_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 2, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @stderr_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 2, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Content-type: text/html\n\n"
         "<HTML><HEAD>\n"
         "<TITLE>Manual Pages</TITLE>\n"
         "</HEAD><BODY>\n"
         "<H1>Manual Pages</H1>\n"
         "This is a HyperText interface to the UNIX manpages.\n"
         "You can enter a program name, the section, an extra\n"
         "directory (using -M) or a full name. For example\n"
         "<UL><LI><TT>elm</TT>\n"
         "<LI><TT>elm 1</TT>\n"
         "<LI><TT>-M /usr/local/man elm</TT>\n"
         "<LI><TT>/local/gcc/man/man1/gperf.1</TT>\n"
         "</UL>\n"
         "<ISINDEX>\n"
         "<P>\n"
         "This man2html converter was written by \n"
         "<A HREF=\"http://wsinwp01.win.tue.nl:1234/index.html\">"
         "Richard Verhoeven</A>\n"
         "</BODY></HTML>\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [522 x i8] c"Content-type: text/html\0A\0A<HTML><HEAD>\0A<TITLE>Manual Pages</TITLE>\0A</HEAD><BODY>\0A<H1>Manual Pages</H1>\0AThis is a HyperText interface to the UNIX manpages.\0AYou can enter a program name, the section, an extra\0Adirectory (using -M) or a full name. For example\0A<UL><LI><TT>elm</TT>\0A<LI><TT>elm 1</TT>\0A<LI><TT>-M /usr/local/man elm</TT>\0A<LI><TT>/local/gcc/man/man1/gperf.1</TT>\0A</UL>\0A<ISINDEX>\0A<P>\0AThis man2html converter was written by \0A<A HREF=\22http://wsinwp01.win.tue.nl:1234/index.html\22>Richard Verhoeven</A>\0A</BODY></HTML>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([522 x i8], [522 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [521 x i8] c"Content-type: text/html\0A\0A<HTML><HEAD>\0A<TITLE>Manual Pages</TITLE>\0A</HEAD><BODY>\0A<H1>Manual Pages</H1>\0AThis is a HyperText interface to the UNIX manpages.\0AYou can enter a program name, the section, an extra\0Adirectory (using -M) or a full name. For example\0A<UL><LI><TT>elm</TT>\0A<LI><TT>elm 1</TT>\0A<LI><TT>-M /usr/local/man elm</TT>\0A<LI><TT>/local/gcc/man/man1/gperf.1</TT>\0A</UL>\0A<ISINDEX>\0A<P>\0AThis man2html converter was written by \0A<A HREF=\22http://wsinwp01.win.tue.nl:1234/index.html\22>Richard Verhoeven</A>\0A</BODY></HTML>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([521 x i8], [521 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void indent(int i) {
  for (; i > 0; i--)
    printf("  ");
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113f <indent+0x2f>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <indent+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1140 <indent+0x30>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nsw i32 %4, -1
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
void strncat_overflow_1(char *y) {
  char x[4] = "12";
  if (strlen(y) == 3)
    strncat(x, y, strlen(y));
}


x86 assembly (clang, -O0):
<strncat_overflow_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
jne    116f <strncat_overflow_1+0x4f>
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat_overflow_1>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x3231,0xc(%rsp)
call   1030 <strlen@plt>
cmp    $0x3,%eax
jne    1151 <strncat_overflow_1+0x31>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncat@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.strncat_overflow_1.x = [4 x i8] c"12\00\00"
define void @strncat_overflow_1(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = bitcast [4 x i8]* %3 to i8*
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = icmp eq i32 %6, 3
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = load i8*, i8** %2
%11 = load i8*, i8** %2
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @strncat(i8* %9, i8* %10, i32 %12)
br label %14
14: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @strncat_overflow_1(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 12849, i32* %2
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @strlen(i8* %0)
%8 = call i32 @strncat(i8* %3, i8* %0, i32 %7)
br label %9
9: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void printStuff() { puts("alalalalonglonglilonglonglong"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"alalalalonglonglilonglonglong\00"
define void @printStuff() {
%1 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"alalalalonglonglilonglonglong\00"
define void @printStuff() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_POT_SELECT_INPUT() { clear_io_bit(0x45, 5); }


x86 assembly (clang, -O0):
<TOSH_MAKE_POT_SELECT_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
mov    $0x5,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_POT_SELECT_INPUT>:
mov    $0x45,%edi
mov    $0x5,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_POT_SELECT_INPUT() {
%1 = call i32 @clear_io_bit(i32 69, i32 5)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_POT_SELECT_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 69, i32 5)
ret void
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 == *s2++) {
    if (*s1++ == '\0')
      return 0;
  }
  return *s1 - *--s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <strcmp+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <strcmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1178 <strcmp+0x78>
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
movsbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <strcmp+0x27>
add    $0x1,%rcx
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %17, label %3
13: ; preds = %3
%14 = sext i8 %6 to i32
%15 = sext i8 %7 to i32
%16 = sub nsw i32 %14, %15
br label %17
17: ; preds = %9, %13
%18 = phi i32 [ %16, %13 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintFromalib2() {
  printf("Hello from my alib2\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Hello from my alib2\00"
define void @PrintFromalib2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_87int8_mem(signed char *val) {
  return ((*val) & (-0x87 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_87int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff79,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_87int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -135
%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_87int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -135
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRSETVIEWPORTORG_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 2, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRSETVIEWPORTORG_swap>:
mov    %esi,%edx
mov    $0x2,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRSETVIEWPORTORG_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 2, i32 %1)
ret void
}
unsigned int isInput(char input) {
  if (input == 8 || input == 13 || input == 27 || (input >= 32 && input <= 126))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isInput>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x8,%eax
je     114b <isInput+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     114b <isInput+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x1b,%eax
je     114b <isInput+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jl     1157 <isInput+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x7e,%eax
jg     1157 <isInput+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <isInput+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInput>:
cmp    $0x1b,%dil
ja     111b <isInput+0x1b>
mov    $0x1,%eax
movzbl %dil,%ecx
mov    $0x8002100,%edx
bt     %rcx,%rdx
jae    111b <isInput+0x1b>
ret
lea    -0x20(%rdi),%ecx
xor    %eax,%eax
cmp    $0x5f,%cl
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isInput(i8 signext %0) {
switch i8 %0, label %2 [
i8 27, label %6
i8 13, label %6
i8 8, label %6
]
2: ; preds = %1
%3 = add i8 %0, -32
%4 = icmp ult i8 %3, 95
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %2, %1, %1, %1
%7 = phi i32 [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ %5, %2 ]
ret i32 %7
}
/* Type definitions */
struct sk_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree_skb(struct sk_buff *);
void dev_kfree_skb(struct sk_buff *skb) { kfree_skb(skb); }


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

x86 assembly (clang, -O2):
<dev_kfree_skb>:
jmp    1030 <kfree_skb@plt>

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

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
define void @dev_kfree_skb(%struct.sk_buff* %0) {
%2 = tail call i32 @kfree_skb(%struct.sk_buff* %0)
ret void
}
void literal_string_parameter(char *s) {
  int a[112];
  a[s[0]] = 0;
}


x86 assembly (clang, -O0):
<literal_string_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbq (%rax),%rax
movl   $0x0,-0x1d0(%rbp,%rax,4)
add    $0x150,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @literal_string_parameter(i8* %0) {
%2 = alloca i8*
%3 = alloca [112 x i32]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i64
%8 = getelementptr inbounds [112 x i32], [112 x i32]* %3, i64 0, i64 %7
store i32 0, i32* %8
ret void
}

LLVM IR (-O2):
define void @literal_string_parameter(i8* nocapture %0) {
ret void
}
long stub_syscall4(long syscall, long arg1, long arg2, long arg3, long arg4) {
  __asm__("movl %0, %%esi; " : : "g"(arg4) : "%esi");
  return (stub_syscall3(syscall, arg1, arg2, arg3));
}


x86 assembly (clang, -O0):
<stub_syscall4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%esi
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1030 <stub_syscall3@plt>
cltq
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i64 @stub_syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i64, i64* %10
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = call i32 (i64, i64, i64, i64, ...) bitcast (i32 (...)* @stub_syscall3 to i32 (i64, i64, i64, i64, ...)*)(i64 %12, i64 %13, i64 %14, i64 %15)
%17 = sext i32 %16 to i64
ret i64 %17
}

LLVM IR (-O2):
void foo(int x) {
  unsigned int a = 0;
  int b = 3;
  if (x)
    b = 0;
lab:
  if (x)
    goto lab;
  a++;
  if (b != 2)
    __builtin_printf("%u", a);
  goto lab;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113a <foo+0x2a>
movl   $0x0,-0xc(%rbp)
jmp    113f <foo+0x2f>
cmpl   $0x0,-0x4(%rbp)
je     114e <foo+0x3e>
jmp    113f <foo+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0xc(%rbp)
je     1172 <foo+0x62>
mov    -0x8(%rbp),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    113f <foo+0x2f>

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     1122 <foo+0x12>
nopl   0x0(%rax,%rax,1)
jmp    1120 <foo+0x10>
mov    $0x1,%ebx
lea    0xed2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1130 <foo+0x20>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1, %3
br label %3
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ 0, %1 ]
%6 = add i32 %5, 1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ wDateTimePush(char, int /*<<< orphan*/);
int /*<<< orphan*/ wStackPopDateTime();
void wBuiltinMinute() { wDateTimePush('n', wStackPopDateTime()); }


x86 assembly (clang, -O0):
<wBuiltinMinute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <wStackPopDateTime@plt>
mov    %eax,%esi
mov    $0x6e,%edi
call   1030 <wDateTimePush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinMinute>:
push   %rax
xor    %eax,%eax
call   1040 <wStackPopDateTime@plt>
mov    $0x6e,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <wDateTimePush@plt>

LLVM IR (-O0):
define void @wBuiltinMinute() {
%1 = call i32 (...) @wStackPopDateTime()
%2 = call i32 @wDateTimePush(i8 signext 110, i32 %1)
ret void
}

LLVM IR (-O2):
define void @wBuiltinMinute() {
%1 = tail call i32 (...) @wStackPopDateTime()
%2 = tail call i32 @wDateTimePush(i8 signext 110, i32 %1)
ret void
}
int get_sensdesc(unsigned char sa, int snum, char *sensdesc, int *pstyp,
                 int *pidx) {
  return (-1);
}


x86 assembly (clang, -O0):
<get_sensdesc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_sensdesc(i8 zeroext %0, i32 %1, i8* %2, i32* %3, i32* %4) {
%6 = alloca i8
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
store i8 %0, i8* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
ret i32 -1
}

LLVM IR (-O2):
define i32 @get_sensdesc(i8 zeroext %0, i32 %1, i8* nocapture readnone %2, i32* nocapture readnone %3, i32* nocapture readnone %4) {
ret i32 -1
}
double getBW_nomatchg32(double eff) {
  if (eff == 0)
    return 0;
  double intercept = 66.560;
  double W = 164.83;
  return intercept + W * eff;
}


x86 assembly (clang, -O0):
<getBW_nomatchg32>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112e <getBW_nomatchg32+0x2e>
jp     112e <getBW_nomatchg32+0x2e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1164 <getBW_nomatchg32+0x64>
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBW_nomatchg32>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
xorpd  %xmm2,%xmm2
cmpeqsd %xmm2,%xmm0
andnpd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @getBW_nomatchg32(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %1
store double 0.000000e+00, double* %2
br label %14
9: ; preds = %1
store double 6.656000e+01, double* %4
store double 1.648300e+02, double* %5
%10 = load double, double* %4
%11 = load double, double* %5
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double %11, double %12, double %10)
store double %13, double* %2
br label %14
14: ; preds = %9, %8
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @getBW_nomatchg32(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = tail call double @llvm.fmuladd.f64(double %0, double 1.648300e+02, double 6.656000e+01)
%4 = select i1 %2, double 0.000000e+00, double %3
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_key_t;

/* Variables and functions */
int kthread_setspecific(int /*<<< orphan*/, void const *);
int pthread_setspecific(pthread_key_t key, const void *value) {
  return kthread_setspecific(key, value);
}


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

x86 assembly (clang, -O2):
<pthread_setspecific>:
jmp    1030 <kthread_setspecific@plt>

LLVM IR (-O0):
define i32 @pthread_setspecific(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 i8*, i8** %4
%7 = call i32 @kthread_setspecific(i32 %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pthread_setspecific(i32 %0, i8* %1) {
%3 = tail call i32 @kthread_setspecific(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ readable(char *);
scalar_t__ writable(char *);
int find_RW(char *myLoc) {
  if (readable(myLoc)) {
    if (writable(myLoc)) {
      return 1;
    } else
      return 0;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<find_RW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <readable@plt>
cmp    $0x0,%rax
je     116a <find_RW+0x4a>
mov    -0x10(%rbp),%rdi
call   1040 <writable@plt>
cmp    $0x0,%rax
je     115e <find_RW+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1171 <find_RW+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1171 <find_RW+0x51>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_RW>:
push   %rbx
mov    %rdi,%rbx
call   1030 <readable@plt>
test   %rax,%rax
je     1143 <find_RW+0x23>
mov    %rbx,%rdi
call   1040 <writable@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @find_RW(i8* %0) {
%2 = tail call i64 @readable(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @writable(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
void doNotInvalidateWhenPassedToSystemCalls(char *s) {
  char *p = malloc(12);
  strlen(p);
  strcpy(p, s);
}


x86 assembly (clang, -O0):
<doNotInvalidateWhenPassedToSystemCalls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doNotInvalidateWhenPassedToSystemCalls>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @doNotInvalidateWhenPassedToSystemCalls(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 12)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @strcpy(i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @doNotInvalidateWhenPassedToSystemCalls(i8* %0) {
%2 = tail call dereferenceable_or_null(12) i8* @malloc(i32 12)
%3 = tail call i32 @strlen(i8* %2)
%4 = tail call i32 @strcpy(i8* %2, i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ isupper(char);
char mod(char, int);
char shiftbackward(char c, int key) {
  if (isupper(c))
    return mod(c - 'A' - key, 26) + 'A';
  return mod(c - 'a' - key, 26) + 'a';
}


x86 assembly (clang, -O0):
<shiftbackward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x2(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1169 <shiftbackward+0x49>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
sub    -0x8(%rbp),%eax
mov    $0x1a,%esi
movsbl %al,%edi
call   1030 <mod@plt>
movsbl %al,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    1189 <shiftbackward+0x69>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
sub    -0x8(%rbp),%eax
mov    $0x1a,%esi
movsbl %al,%edi
call   1030 <mod@plt>
movsbl %al,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftbackward>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1040 <isupper@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %bl
setne  %cl
shl    $0x5,%ecx
add    %ebp,%ecx
shl    $0x5,%bl
sub    %r14d,%ecx
add    $0x9f,%ecx
movsbl %cl,%edi
mov    $0x1a,%esi
call   1030 <mod@plt>
add    %bl,%al
add    $0x41,%al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @shiftbackward(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i8, i8* %4
%7 = call i64 @isupper(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %2
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 65
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = trunc i32 %14 to i8
%16 = call signext i8 @mod(i8 signext %15, i32 26)
%17 = sext i8 %16 to i32
%18 = add nsw i32 %17, 65
%19 = trunc i32 %18 to i8
store i8 %19, i8* %3
br label %31
20: ; preds = %2
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 97
%24 = load i32, i32* %5
%25 = sub nsw i32 %23, %24
%26 = trunc i32 %25 to i8
%27 = call signext i8 @mod(i8 signext %26, i32 26)
%28 = sext i8 %27 to i32
%29 = add nsw i32 %28, 97
%30 = trunc i32 %29 to i8
store i8 %30, i8* %3
br label %31
31: ; preds = %20, %9
%32 = load i8, i8* %3
ret i8 %32
}

LLVM IR (-O2):
define signext i8 @shiftbackward(i8 signext %0, i32 %1) {
%3 = tail call i64 @isupper(i8 signext %0)
%4 = icmp eq i64 %3, 0
%5 = zext i8 %0 to i32
%6 = select i1 %4, i32 159, i32 191
%7 = select i1 %4, i8 97, i8 65
%8 = add nuw nsw i32 %6, %5
%9 = sub i32 %8, %1
%10 = trunc i32 %9 to i8
%11 = tail call signext i8 @mod(i8 signext %10, i32 26)
%12 = add i8 %11, %7
ret i8 %12
}