xunge/DecIR huggingface dataset:
int unset_usemalloc() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @unset_usemalloc() {
ret i32 0
}
char *SUMO_Name(void) { return "Supermodel"; }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Supermodel\00"
define i8* @SUMO_Name() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef scalar_t__ wctrans_t;

/* Variables and functions */
int /*<<< orphan*/ towlower(int /*<<< orphan*/);
int /*<<< orphan*/ towupper(int /*<<< orphan*/);
wint_t towctrans(wint_t wc, wctrans_t trans) {
  if (trans == (wctrans_t)1)
    return towupper(wc);
  if (trans == (wctrans_t)2)
    return towlower(wc);
  return wc;
}


x86 assembly (clang, -O0):
<towctrans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    114a <towctrans+0x2a>
mov    -0x8(%rbp),%edi
call   1040 <towupper@plt>
mov    %eax,-0x4(%rbp)
jmp    116b <towctrans+0x4b>
cmpq   $0x2,-0x10(%rbp)
jne    1165 <towctrans+0x45>
mov    -0x8(%rbp),%edi
call   1030 <towlower@plt>
mov    %eax,-0x4(%rbp)
jmp    116b <towctrans+0x4b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towctrans>:
cmp    $0x2,%rsi
je     1131 <towctrans+0x11>
cmp    $0x1,%rsi
jne    1136 <towctrans+0x16>
jmp    1040 <towupper@plt>
jmp    1030 <towlower@plt>
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @towctrans(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i32 @towupper(i32 %9)
store i32 %10, i32* %3
br label %19
11: ; preds = %2
%12 = load i64, i64* %5
%13 = icmp eq i64 %12, 2
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %4
%16 = call i32 @towlower(i32 %15)
store i32 %16, i32* %3
br label %19
17: ; preds = %11
%18 = load i32, i32* %4
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %14, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @towctrans(i32 %0, i64 %1) {
switch i64 %1, label %7 [
i64 1, label %3
i64 2, label %5
]
3: ; preds = %2
%4 = tail call i32 @towupper(i32 %0)
br label %7
5: ; preds = %2
%6 = tail call i32 @towlower(i32 %0)
br label %7
7: ; preds = %2, %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ], [ %0, %2 ]
ret i32 %8
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ getstr(char *);
int /*<<< orphan*/ printw(char *, ...);
int /*<<< orphan*/ timeout(int);
int getRange() {
  int cmRange;
  char str[80];
  timeout(-1);
  printw(
      "Insert tolerance in cm without decimal part; es.: 10 for 10,0 cm\n\r");
  getstr(str);
  cmRange = atoi(str);
  printw("You have set : %d\n\r", cmRange);
  return (cmRange * 58);
}


x86 assembly (clang, -O0):
<getRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    $0xffffffff,%edi
call   1030 <timeout@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
lea    -0x60(%rbp),%rdi
call   1040 <getstr@plt>
lea    -0x60(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
imul   $0x3a,-0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRange>:
push   %rbx
sub    $0x50,%rsp
mov    $0xffffffff,%edi
call   1030 <timeout@plt>
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1050 <printw@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <getstr@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
lea    0xeca(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printw@plt>
imul   $0x3a,%ebx,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [67 x i8] c"Insert tolerance in cm without decimal part; es.: 10 for 10,0 cm\0A\0D\00"
@.str.1 = [20 x i8] c"You have set : %d\0A\0D\00"
define i32 @getRange() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = call i32 @timeout(i32 -1)
%4 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = call i32 @getstr(i8* %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%8 = call i32 @atoi(i8* %7)
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %1
%12 = mul nsw i32 %11, 58
ret i32 %12
}

LLVM IR (-O2):
@.str = [67 x i8] c"Insert tolerance in cm without decimal part; es.: 10 for 10,0 cm\0A\0D\00"
@.str.1 = [20 x i8] c"You have set : %d\0A\0D\00"
define i32 @getRange() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @timeout(i32 -1)
%4 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @getstr(i8* %2)
%6 = call i32 @atoi(i8* %2)
%7 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = mul nsw i32 %6, 58
ret i32 %8
}
/* Variables and functions */
int EOF;
scalar_t__ endBlock();
int getchar();
void skipblock() {
  int c;
  while ((c = getchar()) != EOF)
    if (c == '*')
      if (endBlock())
        return;
  return;
}


x86 assembly (clang, -O0):
<skipblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
je     116b <skipblock+0x4b>
cmpl   $0x2a,-0x4(%rbp)
jne    1166 <skipblock+0x46>
mov    $0x0,%al
call   1040 <endBlock@plt>
cmp    $0x0,%rax
je     1161 <skipblock+0x41>
jmp    1170 <skipblock+0x50>
jmp    1166 <skipblock+0x46>
jmp    1128 <skipblock+0x8>
jmp    1170 <skipblock+0x50>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipblock>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    0x2eb9(%rip),%rbx
jmp    1147 <skipblock+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    (%rbx),%eax
je     115c <skipblock+0x3c>
cmp    $0x2a,%eax
jne    1140 <skipblock+0x20>
xor    %eax,%eax
call   1040 <endBlock@plt>
test   %rax,%rax
je     1140 <skipblock+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @skipblock() {
%1 = alloca i32
br label %2
2: ; preds = %14, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 42
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = call i64 (...) @endBlock()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
br label %16
13: ; preds = %9
br label %14
14: ; preds = %13, %6
br label %2
15: ; preds = %2
br label %16
16: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @skipblock() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %14, label %4
4: ; preds = %0, %10
%5 = phi i32 [ %11, %10 ], [ %1, %0 ]
%6 = icmp eq i32 %5, 42
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i64 (...) @endBlock()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7, %4
%11 = tail call i32 (...) @getchar()
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %4
14: ; preds = %7, %10, %0
ret void
}
int getendcylinder(int partition1[]) {
  int endcyl = 0;
  endcyl = ((partition1[7] << 8) | partition1[6]);
  return endcyl;
}


x86 assembly (clang, -O0):
<getendcylinder>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x18(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getendcylinder>:
mov    0x1c(%rdi),%eax
shl    $0x8,%eax
or     0x18(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getendcylinder(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 7
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 6
%10 = load i32, i32* %9
%11 = or i32 %7, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @getendcylinder(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 6
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long const);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *PrintHello(void *threadid) {
  const long tid = (uintptr_t)threadid;
  printf("Hello World! It's me, thread #%ld!\n", tid);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<PrintHello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHello>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Hello World! It's me, thread #%ld!\0A\00"
define i8* @PrintHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [36 x i8] c"Hello World! It's me, thread #%ld!\0A\00"
define noalias i8* @PrintHello(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void pager_output(const char *s) { printf("%s", s); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @pager_output(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "Usage: %s [Start-city Destination-city] [Max-flight-dist]\n",
          progname);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"Usage: %s [Start-city Destination-city] [Max-flight-dist]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"Usage: %s [Start-city Destination-city] [Max-flight-dist]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int gcd(int a, int b) {
  int c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%eax
test   %edi,%edi
je     111d <gcd+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %5, %4 ], [ %1, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %5, %4 ]
ret i32 %10
}
int operateFMA(int (*fmadd)(int, int, int), int x, int y, int z) {
  return fmadd(x, y, z);
}


x86 assembly (clang, -O0):
<operateFMA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<operateFMA>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
jmp    *%rax

LLVM IR (-O0):
define i32 @operateFMA(i32 (i32, i32, i32)* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32 (i32, i32, i32)*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 (i32, i32, i32)* %0, i32 (i32, i32, i32)** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32 (i32, i32, i32)*, i32 (i32, i32, i32)** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 %9(i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @operateFMA(i32 (i32, i32, i32)* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 %0(i32 %1, i32 %2, i32 %3)
ret i32 %5
}
prs(as) char *as;
{
  register char *s;
  s = as;
  while (*s)
    putc(*s++);
}


x86 assembly (clang, -O0):
<prs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <prs+0x3f>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <putc@plt>
jmp    1124 <prs+0x14>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <prs+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <prs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @prs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ issafediv(int, int);
int safemod(int x, int y) {
  if (!issafediv(x, y)) {
    error("safemod");
  }
  return x % y;
}


x86 assembly (clang, -O0):
<safemod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <issafediv@plt>
cmp    $0x0,%eax
jne    114e <safemod+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <error@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safemod>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <issafediv@plt>
test   %eax,%eax
jne    113c <safemod+0x1c>
lea    0xec9(%rip),%rdi
call   1040 <error@plt>
mov    %ebp,%eax
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"safemod\00"
define i32 @safemod(i32 %0, i32 %1) {
%3 = tail call i32 @issafediv(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = srem i32 %0, %1
ret i32 %8
}
/* Variables and functions */
int serial_tstc();
int tstc(void) { return serial_tstc(); }


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

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

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

LLVM IR (-O2):
define i32 @tstc() {
%1 = tail call i32 (...) @serial_tstc()
ret i32 %1
}
int main() {
  __attribute__((type_annotate("tainted"))) int x = 2;
  __attribute__((type_annotate("tainted"))) float y = (float)x;
  __attribute__((type_annotate("tainted"))) int z;
  z = x + 5;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to float
store float %6, float* %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 5
store i32 %8, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct toml_node {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _toml_tojson(struct toml_node *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void toml_tojson(struct toml_node *toml_root, FILE *output) {
  fprintf(output, "{\n");
  _toml_tojson(toml_root, output, 1);
  fprintf(output, "}\n");
}


x86 assembly (clang, -O0):
<toml_tojson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <_toml_tojson@plt>
mov    -0x10(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toml_tojson>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xecf(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <_toml_tojson@plt>
lea    0xea9(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
%struct.toml_node = type { i32 }
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [3 x i8] c"}\0A\00"
define void @toml_tojson(%struct.toml_node* %0, i32* %1) {
%3 = alloca %struct.toml_node*
%4 = alloca i32*
store %struct.toml_node* %0, %struct.toml_node** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = load %struct.toml_node*, %struct.toml_node** %3
%8 = load i32*, i32** %4
%9 = call i32 @_toml_tojson(%struct.toml_node* %7, i32* %8, i32 1)
%10 = load i32*, i32** %4
%11 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.toml_node = type { i32 }
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [3 x i8] c"}\0A\00"
define void @toml_tojson(%struct.toml_node* %0, i32* %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %1)
%4 = tail call i32 @_toml_tojson(%struct.toml_node* %0, i32* %1, i32 1)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 2, i64 1, i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
char const *inet_ntoa(struct in_addr);
const char *usys_ntoa(uint32_t ip) {
  struct in_addr in;
  in.s_addr = ip;
  return inet_ntoa(in);
}


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

x86 assembly (clang, -O2):
<usys_ntoa>:
jmp    1030 <inet_ntoa@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i8* @usys_ntoa(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.in_addr
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i8* @inet_ntoa(i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @usys_ntoa(i32 %0) {
%2 = tail call i8* @inet_ntoa(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ __syscall(int, int);
void _exit(int stat) {
  while (1)
    __syscall(1, stat);
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <__syscall@plt>
jmp    111b <_exit+0xb>

x86 assembly (clang, -O2):
<_exit>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%edi
mov    %ebx,%esi
call   1030 <__syscall@plt>
jmp    1120 <_exit+0x10>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
%4 = load i32, i32* %2
%5 = call i32 @__syscall(i32 1, i32 %4)
br label %3
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @__syscall(i32 1, i32 %0)
br label %2
}
/* Variables and functions */
char _CRYPT_SALT();
int /*<<< orphan*/ crypt(char *, char *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
void CRYPT(char *_ss, char *_key) {
  char salt[3];
  salt[0] = _CRYPT_SALT();
  salt[1] = _CRYPT_SALT();
  salt[2] = '\0';
  strcpy(_ss, crypt(_key, salt));
}


x86 assembly (clang, -O0):
<CRYPT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <_CRYPT_SALT@plt>
mov    %al,-0x13(%rbp)
mov    $0x0,%al
call   1030 <_CRYPT_SALT@plt>
mov    %al,-0x12(%rbp)
movb   $0x0,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x13(%rbp),%rsi
call   1050 <crypt@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPT>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <_CRYPT_SALT@plt>
mov    %al,0x5(%rsp)
xor    %eax,%eax
call   1030 <_CRYPT_SALT@plt>
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x5(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <crypt@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @CRYPT(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [3 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call signext i8 (...) @_CRYPT_SALT()
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = call signext i8 (...) @_CRYPT_SALT()
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
store i8 %8, i8* %9
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 2
store i8 0, i8* %10
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%14 = call i32 @crypt(i8* %12, i8* %13)
%15 = call i32 @strcpy(i8* %11, i32 %14)
ret void
}

LLVM IR (-O2):
define void @CRYPT(i8* %0, i8* %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = tail call signext i8 (...) @_CRYPT_SALT()
store i8 %5, i8* %4
%6 = tail call signext i8 (...) @_CRYPT_SALT()
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %6, i8* %7
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 0, i8* %8
%9 = call i32 @crypt(i8* %1, i8* %4)
%10 = call i32 @strcpy(i8* %0, i32 %9)
ret void
}
/* Variables and functions */
scalar_t__ strchr(char const *, unsigned int);
unsigned char *_mdirhr(const unsigned char *str, unsigned int c) {
  return (unsigned char *)strchr((const char *)str, c);
}


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

x86 assembly (clang, -O2):
<_mdirhr>:
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i8* @_mdirhr(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 i64 @strchr(i8* %5, i32 %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @_mdirhr(i8* %0, i32 %1) {
%3 = tail call i64 @strchr(i8* %0, i32 %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int ph_http_put_handle_packet(void *handler, const char *packet, size_t len) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @ph_http_put_handle_packet(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @ph_http_put_handle_packet(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
double drand(double *seed) {
  int q;
  *seed *= 1389796;
  q = (int)(*seed / 2147483647);
  *seed -= (double)q * 2147483647;
  return *seed / 2147483647;
}


x86 assembly (clang, -O0):
<drand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xef4(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movq   %xmm0,%rcx
movabs $0x8000000000000000,%rdx
xor    %rdx,%rcx
movq   %rcx,%xmm0
movsd  0xe9d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe81(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drand>:
movsd  (%rdi),%xmm0
mulsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
movsd  %xmm0,(%rdi)
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @drand(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
%4 = load double*, double** %2
%5 = load double, double* %4
%6 = fmul double %5, 0x413534E400000000
store double %6, double* %4
%7 = load double*, double** %2
%8 = load double, double* %7
%9 = fdiv double %8, 0x41DFFFFFFFC00000
%10 = fptosi double %9 to i32
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = load double*, double** %2
%14 = load double, double* %13
%15 = fneg double %12
%16 = call double @llvm.fmuladd.f64(double %15, double 0x41DFFFFFFFC00000, double %14)
store double %16, double* %13
%17 = load double*, double** %2
%18 = load double, double* %17
%19 = fdiv double %18, 0x41DFFFFFFFC00000
ret double %19
}

LLVM IR (-O2):
define double @drand(double* nocapture %0) {
%2 = load double, double* %0
%3 = fmul double %2, 0x413534E400000000
%4 = fdiv double %3, 0x41DFFFFFFFC00000
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = fneg double %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x41DFFFFFFFC00000, double %3)
store double %8, double* %0
%9 = fdiv double %8, 0x41DFFFFFFFC00000
ret double %9
}
/* Type definitions */
struct rtbst_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *rtbst_delete(struct rtbst_table *, void *);
void *(rtbst_assert_delete)(struct rtbst_table *table, void *item) {
  void *p = rtbst_delete(table, item);
  assert(p != NULL);
  return p;
}


x86 assembly (clang, -O0):
<rtbst_assert_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <rtbst_delete@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtbst_assert_delete>:
push   %rbx
call   1030 <rtbst_delete@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.rtbst_table = type { i32 }
define i8* @rtbst_assert_delete(%struct.rtbst_table* %0, i8* %1) {
%3 = alloca %struct.rtbst_table*
%4 = alloca i8*
%5 = alloca i8*
store %struct.rtbst_table* %0, %struct.rtbst_table** %3
store i8* %1, i8** %4
%6 = load %struct.rtbst_table*, %struct.rtbst_table** %3
%7 = load i8*, i8** %4
%8 = call i8* @rtbst_delete(%struct.rtbst_table* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
%struct.rtbst_table = type { i32 }
define i8* @rtbst_assert_delete(%struct.rtbst_table* %0, i8* %1) {
%3 = tail call i8* @rtbst_delete(%struct.rtbst_table* %0, i8* %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void perfx_free(void *data) { free(data); }


x86 assembly (clang, -O0):
<perfx_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):
<perfx_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @perfx_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 @perfx_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
short Snack_Mulaw2Lin(unsigned char u_val) {
  short t;
  u_val = ~u_val;
  t = ((u_val & (0xf)) << 3) + (0x84);
  t <<= ((unsigned)u_val & (0x70)) >> (4);
  return ((u_val & (0x80)) ? ((0x84) - t) : (t - (0x84)));
}


x86 assembly (clang, -O0):
<Snack_Mulaw2Lin>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
shl    $0x3,%eax
add    $0x84,%eax
mov    %ax,-0x4(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x70,%ecx
shr    $0x4,%ecx
movswl -0x4(%rbp),%eax
shl    %cl,%eax
mov    %ax,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1160 <Snack_Mulaw2Lin+0x60>
movswl -0x4(%rbp),%ecx
mov    $0x84,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    116c <Snack_Mulaw2Lin+0x6c>
movswl -0x4(%rbp),%eax
sub    $0x84,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<Snack_Mulaw2Lin>:
not    %dil
movzbl %dil,%edx
lea    0x0(,%rdx,8),%eax
or     $0x84,%eax
movzbl %al,%eax
mov    %edx,%ecx
shr    $0x4,%cl
and    $0x7,%cl
shl    %cl,%eax
mov    $0x84,%ecx
sub    %eax,%ecx
add    $0xffffff7c,%eax
test   $0x80,%dl
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @Snack_Mulaw2Lin(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i16
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = xor i32 %5, -1
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = shl i32 %10, 3
%12 = add nsw i32 %11, 132
%13 = trunc i32 %12 to i16
store i16 %13, i16* %3
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = and i32 %15, 112
%17 = lshr i32 %16, 4
%18 = load i16, i16* %3
%19 = sext i16 %18 to i32
%20 = shl i32 %19, %17
%21 = trunc i32 %20 to i16
store i16 %21, i16* %3
%22 = load i8, i8* %2
%23 = zext i8 %22 to i32
%24 = and i32 %23, 128
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %1
%27 = load i16, i16* %3
%28 = sext i16 %27 to i32
%29 = sub nsw i32 132, %28
br label %34
30: ; preds = %1
%31 = load i16, i16* %3
%32 = sext i16 %31 to i32
%33 = sub nsw i32 %32, 132
br label %34
34: ; preds = %30, %26
%35 = phi i32 [ %29, %26 ], [ %33, %30 ]
%36 = trunc i32 %35 to i16
ret i16 %36
}

LLVM IR (-O2):
define signext i16 @Snack_Mulaw2Lin(i8 zeroext %0) {
%2 = xor i8 %0, -1
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 3
%5 = and i32 %4, 120
%6 = or i32 %5, 132
%7 = lshr i32 %3, 4
%8 = and i32 %7, 7
%9 = shl i32 %6, %8
%10 = and i32 %3, 128
%11 = icmp eq i32 %10, 0
%12 = sub nsw i32 132, %9
%13 = add nuw nsw i32 %9, 65404
%14 = select i1 %11, i32 %13, i32 %12
%15 = trunc i32 %14 to i16
ret i16 %15
}
int generate_key(int fd) {}


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

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

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

LLVM IR (-O2):
define i32 @generate_key(i32 %0) {
ret i32 undef
}
/* Variables and functions */
double fabs(double);
char bnear(double x, double y, double tolerance) {
  if (fabs(x - y) < tolerance)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<bnear>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movaps 0xedc(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1140 <bnear+0x40>
movb   $0x1,-0x1(%rbp)
jmp    1144 <bnear+0x44>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bnear>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
ucomisd %xmm0,%xmm2
seta   %al
ret

LLVM IR (-O0):
define signext i8 @bnear(double %0, double %1, double %2) {
%4 = alloca i8
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fsub double %8, %9
%11 = call double @llvm.fabs.f64(double %10)
%12 = load double, double* %7
%13 = fcmp olt double %11, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i8 1, i8* %4
br label %16
15: ; preds = %3
store i8 0, i8* %4
br label %16
16: ; preds = %15, %14
%17 = load i8, i8* %4
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @bnear(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp olt double %5, %2
%7 = zext i1 %6 to i8
ret i8 %7
}
/* Variables and functions */
int open(char *, int);
int posix_openpt(int oflag) {
  int pt_fd = open("/dev/ptmx", oflag);
  if (pt_fd < 0) {
    return -1;
  }
  return pt_fd;
}


x86 assembly (clang, -O0):
<posix_openpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1143 <posix_openpt+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <posix_openpt+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_openpt>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <open@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/ptmx\00"
define i32 @posix_openpt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/ptmx\00"
define i32 @posix_openpt(i32 %0) {
%2 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp sgt i32 %2, -1
%4 = select i1 %3, i32 %2, i32 -1
ret i32 %4
}
void _infix_operator_mult_float_float(float lhs, float rhs, float *__rval_1) {
  *__rval_1 = lhs * rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_mult_float_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_mult_float_float>:
mulss  %xmm1,%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @_infix_operator_mult_float_float(float %0, float %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fmul float %7, %8
%10 = load float*, float** %6
store float %9, float* %10
ret void
}

LLVM IR (-O2):
define void @_infix_operator_mult_float_float(float %0, float %1, float* nocapture writeonly %2) {
%4 = fmul float %0, %1
store float %4, float* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fooA(int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x = 10;
  printf("The address of x is %p\n", &x);
  fooA(&x);
  printf("The value of x is %d\n", x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <fooA@plt>
mov    0xc(%rsp),%esi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"The address of x is %p\0A\00"
@.str.1 = [22 x i8] c"The value of x is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = call i32 @fooA(i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"The address of x is %p\0A\00"
@.str.1 = [22 x i8] c"The value of x is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @fooA(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(char *, size_t, size_t, int /*<<< orphan*/ *);
int c_fwrite_str_(char *str, int *size, FILE **fp, int maxsize) {
  return fwrite(str, (size_t)*size, (size_t)1, *fp);
}


x86 assembly (clang, -O0):
<c_fwrite_str_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq (%rax),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_fwrite_str_>:
movslq (%rsi),%rsi
mov    (%rdx),%rcx
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define i32 @c_fwrite_str_(i8* %0, i32* %1, i32** %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32**
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32** %2, i32*** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = load i32**, i32*** %7
%14 = load i32*, i32** %13
%15 = call i32 @fwrite(i8* %9, i64 %12, i64 1, i32* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @c_fwrite_str_(i8* nocapture %0, i32* nocapture %1, i32** nocapture %2, i32 %3) {
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = load i32*, i32** %2
%8 = tail call i32 @fwrite(i8* %0, i64 %6, i64 1, i32* %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = sizeof(void *);
  printf("%d\n", a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printInt(int *a, int l) {
  int i;
  for (i = 0; i < l; i++)
    printf("%d, ", a[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printInt>:
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 <printInt+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 <printInt+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printInt>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printInt+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 <printInt+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%d, \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printInt(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 ([5 x i8], [5 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 = [5 x i8] c"%d, \00"
define void @printInt(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 ([5 x i8], [5 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
}