xunge/DecIR huggingface dataset:
/* Variables and functions */
double getDouble();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  double num1;
  printf("Enter double string (MAX 12 CHARS) > ");
  num1 = getDouble();
  printf("num1 = %lf\n", num1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getDouble@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xed1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getDouble@plt>
lea    0xee9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Enter double string (MAX 12 CHARS) > \00"
@.str.1 = [12 x i8] c"num1 = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call double (...) @getDouble()
store double %4, double* %2
%5 = load double, double* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Enter double string (MAX 12 CHARS) > \00"
@.str.1 = [12 x i8] c"num1 = %lf\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = tail call double (...) @getDouble()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *strstr(char *, char *);
void process_string(char str[]) {
  char *set;
  if (set = strstr(str, "SET=")) {
    strcpy(set + 4, set + 5);
  }
}


x86 assembly (clang, -O0):
<process_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115f <process_string+0x3f>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rsi
add    $0x5,%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_string>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     1143 <process_string+0x23>
lea    0x4(%rax),%rdi
add    $0x5,%rax
mov    %rax,%rsi
pop    %rax
jmp    1030 <strcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"SET=\00"
define void @process_string(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 4
%6 = getelementptr inbounds i8, i8* %2, i64 5
%7 = tail call i32 @strcpy(i8* %5, i8* %6)
br label %8
8: ; preds = %4, %1
ret void
}
void print_SOF(const unsigned char *stream) {
  int width, height, nr_components, precision;
  precision = stream[2];
  height = (((stream + 3)[0] << 8) | (stream + 3)[1]);
  width = (((stream + 5)[0] << 8) | (stream + 5)[1]);
  nr_components = stream[7];
}


x86 assembly (clang, -O0):
<print_SOF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x4(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%eax
mov    %eax,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @print_SOF(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
store i32 %10, i32* %6
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 3
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 8
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 3
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = or i32 %16, %21
store i32 %22, i32* %4
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i64 5
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = shl i32 %27, 8
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i64 5
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = or i32 %28, %33
store i32 %34, i32* %3
%35 = load i8*, i8** %2
%36 = getelementptr inbounds i8, i8* %35, i64 7
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
store i32 %38, i32* %5
ret void
}

LLVM IR (-O2):
define void @print_SOF(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char);
signed char test_func_fn(signed char a1, signed char a2) {
  signed char result;
  result = a1 + a2;
  printf("%d %d: %d\n", a1, a2, result);
  return result;
}


x86 assembly (clang, -O0):
<test_func_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
lea    0xec2(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x3(%rbp),%ecx
call   1030 <printf@plt>
movsbl -0x3(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_fn>:
push   %rbx
mov    %esi,%edx
mov    %edi,%esi
lea    (%rdx,%rsi,1),%eax
movsbl %al,%ebx
lea    0xede(%rip),%rdi
mov    %ebx,%ecx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%d %d: %d\0A\00"
define signext i8 @test_func_fn(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %5
%12 = load i8, i8* %3
%13 = load i8, i8* %4
%14 = load i8, i8* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %12, i8 signext %13, i8 signext %14)
%16 = load i8, i8* %5
ret i8 %16
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d %d: %d\0A\00"
define signext i8 @test_func_fn(i8 signext %0, i8 signext %1) {
%3 = add i8 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1, i8 signext %3)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ raise(int);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void sigalrm_handler(int sig) {
  fprintf(stderr, "\n\n SIGALRM RECEIVED\n\n");
  signal(sig, SIG_DFL);
  raise(sig);
}


x86 assembly (clang, -O0):
<sigalrm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x4(%rbp),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    -0x4(%rbp),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigalrm_handler>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <signal@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <raise@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"\0A\0A SIGALRM RECEIVED\0A\0A\00"
@SIG_DFL = global i32 0
define void @sigalrm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = load i32, i32* @SIG_DFL
%7 = call i32 @signal(i32 %5, i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @raise(i32 %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"\0A\0A SIGALRM RECEIVED\0A\0A\00"
@SIG_DFL = global i32 0
define void @sigalrm_handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @SIG_DFL
%5 = tail call i32 @signal(i32 %0, i32 %4)
%6 = tail call i32 @raise(i32 %0)
ret void
}
void MmioUtil_Write8(void *base, const unsigned long offset,
                     const unsigned char val) {
  *(volatile unsigned char *)(void *)((char *)(base) + (offset)) = (val);
}


x86 assembly (clang, -O0):
<MmioUtil_Write8>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MmioUtil_Write8>:
mov    %dl,(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @MmioUtil_Write8(i8* %0, i64 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = getelementptr inbounds i8, i8* %8, i64 %9
store volatile i8 %7, i8* %10
ret void
}

LLVM IR (-O2):
define void @MmioUtil_Write8(i8* %0, i64 %1, i8 zeroext %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
store volatile i8 %2, i8* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_OSERR;
int /*<<< orphan*/ pfpanic(char *, unsigned short, unsigned short, char const *,
                           char const *, int, int, int /*<<< orphan*/);
void __pfpanic_daemon(unsigned short _syslog, unsigned short _verbose,
                      const char *_function_name, const char *_file_name,
                      int _line_number, int _errno) {
  pfpanic("Unable to become daemon", _syslog, _verbose, _function_name,
          _file_name, _line_number, _errno, EX_OSERR);
}


x86 assembly (clang, -O0):
<__pfpanic_daemon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%r10d
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
lea    0xea2(%rip),%rdi
movzwl %si,%esi
movzwl %dx,%edx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <pfpanic@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pfpanic_daemon>:
push   %rax
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eb8(%rip),%rdi
mov    (%rdi),%eax
lea    0xecf(%rip),%rdi
push   %rax
push   %r10
call   1030 <pfpanic@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Unable to become daemon\00"
@EX_OSERR = global i32 0
define void @__pfpanic_daemon(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i16 %0, i16* %7
store i16 %1, i16* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i16, i16* %7
%14 = load i16, i16* %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = load i32, i32* @EX_OSERR
%20 = call i32 @pfpanic(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i16 zeroext %13, i16 zeroext %14, i8* %15, i8* %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Unable to become daemon\00"
@EX_OSERR = global i32 0
define void @__pfpanic_daemon(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = load i32, i32* @EX_OSERR
%8 = tail call i32 @pfpanic(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %7)
ret void
}
int intcmp(const void *a, const void *b) {
  if (*(unsigned char *)a < *(unsigned char *)b)
    return 1;
  if (*(unsigned char *)a > *(unsigned char *)b)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jge    112e <intcmp+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1157 <intcmp+0x57>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jle    1150 <intcmp+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <intcmp+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
xor    %edx,%edx
cmp    %cl,%al
seta   %dl
neg    %edx
cmp    %cl,%al
mov    $0x1,%eax
cmovae %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ult i8 %3, %4
%6 = icmp ugt i8 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
/* Type definitions */
struct ottery_state {
  int dummy;
};

/* Variables and functions */
scalar_t__ ottery_st_rand_check_init(struct ottery_state *);
scalar_t__ ottery_st_rand_check_pid(struct ottery_state *);
int ottery_st_rand_check_nolock(struct ottery_state *st) {
  if (ottery_st_rand_check_init(st))
    return -1;
  if (ottery_st_rand_check_pid(st))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<ottery_st_rand_check_nolock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ottery_st_rand_check_init@plt>
cmp    $0x0,%rax
je     114b <ottery_st_rand_check_nolock+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <ottery_st_rand_check_nolock+0x51>
mov    -0x10(%rbp),%rdi
call   1040 <ottery_st_rand_check_pid@plt>
cmp    $0x0,%rax
je     116a <ottery_st_rand_check_nolock+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <ottery_st_rand_check_nolock+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ottery_st_rand_check_nolock>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ottery_st_rand_check_init@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1138 <ottery_st_rand_check_nolock+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <ottery_st_rand_check_pid@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.ottery_state = type { i32 }
define i32 @ottery_st_rand_check_nolock(%struct.ottery_state* %0) {
%2 = tail call i64 @ottery_st_rand_check_init(%struct.ottery_state* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ottery_st_rand_check_pid(%struct.ottery_state* %0)
%6 = icmp ne i64 %5, 0
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *);
int main() {
  int i;
  int p = scanf("%s", &i);
  printf("%d\n", i);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
void RTSemEventWaitNoResume(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemEventWaitNoResume() {
ret void
}
/* Variables and functions */
char *getenv(char *);
double todouble(char *);
double getDouble(char *name, double def) {
  return ({
    char *_s;
    ((_s = getenv(name)) != NULL) ? todouble(_s) : def;
  });
}


x86 assembly (clang, -O0):
<getDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115b <getDouble+0x3b>
mov    -0x18(%rbp),%rdi
call   1040 <todouble@plt>
movsd  %xmm0,-0x28(%rbp)
jmp    1165 <getDouble+0x45>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDouble>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <getenv@plt>
test   %rax,%rax
je     1139 <getDouble+0x19>
mov    %rax,%rdi
pop    %rax
jmp    1040 <todouble@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @getDouble(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca i8*
%6 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%7 = load i8*, i8** %3
%8 = call i8* @getenv(i8* %7)
store i8* %8, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call double @todouble(i8* %11)
br label %15
13: ; preds = %2
%14 = load double, double* %4
br label %15
15: ; preds = %13, %10
%16 = phi double [ %12, %10 ], [ %14, %13 ]
store double %16, double* %6
%17 = load double, double* %6
ret double %17
}

LLVM IR (-O2):
define double @getDouble(i8* nocapture %0, double %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call double @todouble(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi double [ %6, %5 ], [ %1, %2 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void output(int *ar, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d. %d\n", i, ar[i]);
  }
}


x86 assembly (clang, -O0):
<output>:
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    115a <output+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <output+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <output+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <output+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d. %d\0A\00"
define void @output(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  char *name = calloc(sizeof(char), 5);
  if (name == NULL) {
    exit(1);
  }
  strcpy(name, "Adam");
  fprintf(stdout, "name: %s\n", name);
  free(name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x5,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1187 <main+0x37>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1040 <strcpy@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe5a(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x5,%esi
call   1050 <calloc@plt>
test   %rax,%rax
je     119b <main+0x4b>
mov    %rax,%rbx
lea    0xe91(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    0xe7e(%rip),%rsi
mov    %rbx,%rdx
call   1060 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"Adam\00"
@stdout = global i32 0
@.str.1 = [10 x i8] c"name: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @calloc(i32 1, i32 5)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = load i8*, i8** %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %2
%15 = call i32 @free(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"Adam\00"
@stdout = global i32 0
@.str.1 = [10 x i8] c"name: %s\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(5) i8* @calloc(i32 1, i32 5)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 1)
unreachable
5: ; preds = %0
%6 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%9 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ whine();
int hello() {
  printf("hello autotools\n");
  whine();
  return 0;
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <whine@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"hello autotools\0A\00"
define i32 @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @whine()
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"hello autotools\00"
define i32 @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @whine()
ret i32 0
}
int test_imm_9Cuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x9C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Cuint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x9c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Cuint64_lowword_reg>:
test   $0x9c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Cuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 156
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void set_var(int *foo) { *foo = 20; }


x86 assembly (clang, -O0):
<set_var>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x14,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_var>:
movl   $0x14,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_var(i32* nocapture writeonly %0) {
store i32 20, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
void srand48(long seed) { srand((unsigned)seed); }


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

x86 assembly (clang, -O2):
<srand48>:
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @srand48(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @srand(i32 %4)
ret void
}

LLVM IR (-O2):
define void @srand48(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
void HUMIDITY_MAKE_PWR_INPUT() {}


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

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

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

LLVM IR (-O2):
define void @HUMIDITY_MAKE_PWR_INPUT() {
ret void
}
int user_id_verify(char *user_id) {
  if (user_id[0] == '-' && user_id[1] == '_' && user_id[2] == '-' &&
      user_id[3] == 'd')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<user_id_verify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1157 <user_id_verify+0x57>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x5f,%eax
jne    1157 <user_id_verify+0x57>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x2d,%eax
jne    1157 <user_id_verify+0x57>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x64,%eax
jne    1157 <user_id_verify+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <user_id_verify+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_id_verify>:
cmpb   $0x2d,(%rdi)
jne    111c <user_id_verify+0x1c>
cmpb   $0x5f,0x1(%rdi)
jne    111c <user_id_verify+0x1c>
cmpb   $0x2d,0x2(%rdi)
jne    111c <user_id_verify+0x1c>
mov    $0x1,%eax
cmpb   $0x64,0x3(%rdi)
je     111e <user_id_verify+0x1e>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @user_id_verify(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
br i1 %3, label %4, label %16
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 95
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 45
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 100
br i1 %15, label %17, label %16
16: ; preds = %12, %8, %4, %1
br label %17
17: ; preds = %12, %16
%18 = phi i32 [ 0, %16 ], [ 1, %12 ]
ret i32 %18
}
int security_file_send_sigiotask(struct task_struct *tsk,
                                 struct fown_struct *fown, int fd, int reason) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
%struct.fown_struct = type opaque
define i32 @security_file_send_sigiotask(%struct.task_struct* %0, %struct.fown_struct* %1, i32 %2, i32 %3) {
%5 = alloca %struct.task_struct*
%6 = alloca %struct.fown_struct*
%7 = alloca i32
%8 = alloca i32
store %struct.task_struct* %0, %struct.task_struct** %5
store %struct.fown_struct* %1, %struct.fown_struct** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.task_struct = type opaque
%struct.fown_struct = type opaque
define i32 @security_file_send_sigiotask(%struct.task_struct* nocapture readnone %0, %struct.fown_struct* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
int count(const char *p) {
  int i;
  int sum = 0;
  for (i = 0; p[i] != '\0'; i++)
    sum += (p[i] - '0');
  return sum;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114e <count+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <count+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <count+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count+0x10>
ret
xor    %eax,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define void @doalarm(i32 %0) {
ret void
}
void g_type_class_peek() {}


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

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

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

LLVM IR (-O2):
define void @g_type_class_peek() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_dynarray_steal_last() {
  printf("NOT IMPLEMENTED:"
         "pa_dynarray_steal_last"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_dynarray_steal_last\00"
define i32 @pa_dynarray_steal_last() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ drv_Newhaven_sendCommand(char, char *, int);
int drv_Newhaven_brightness(int brightness) {
  char cmd;
  char wData[1];
  if (brightness < 1)
    brightness = 1;
  if (brightness > 8)
    brightness = 8;
  cmd = 0x53;
  wData[0] = brightness;
  drv_Newhaven_sendCommand(cmd, wData, 1);
  return brightness;
}


x86 assembly (clang, -O0):
<drv_Newhaven_brightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    112c <drv_Newhaven_brightness+0x1c>
movl   $0x1,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jle    113d <drv_Newhaven_brightness+0x2d>
movl   $0x8,-0x4(%rbp)
movb   $0x53,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
movsbl %al,%edi
call   1030 <drv_Newhaven_sendCommand@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_Newhaven_brightness>:
push   %rbx
sub    $0x10,%rsp
test   %edi,%edi
mov    $0x1,%eax
cmovle %eax,%edi
cmp    $0x8,%edi
mov    $0x8,%ebx
cmovb  %edi,%ebx
mov    %bl,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x53,%edi
mov    $0x1,%edx
call   1030 <drv_Newhaven_sendCommand@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @drv_Newhaven_brightness(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [1 x i8]
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 8
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 8, i32* %2
br label %12
12: ; preds = %11, %8
store i8 83, i8* %3
%13 = load i32, i32* %2
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
store i8 %14, i8* %15
%16 = load i8, i8* %3
%17 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
%18 = call i32 @drv_Newhaven_sendCommand(i8 signext %16, i8* %17, i32 1)
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @drv_Newhaven_brightness(i32 %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%4 = icmp sgt i32 %0, 1
%5 = select i1 %4, i32 %0, i32 1
%6 = icmp ult i32 %5, 8
%7 = select i1 %6, i32 %5, i32 8
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = call i32 @drv_Newhaven_sendCommand(i8 signext 83, i8* %3, i32 1)
ret i32 %7
}
void RTLatin1CalcUtf8Len(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLatin1CalcUtf8Len() {
ret void
}
/* Variables and functions */
int answer();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", answer());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <answer@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%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
store i32 0, i32* %1
%2 = call i32 (...) @answer()
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @answer()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void cli_val_text_attr_deinit(struct cli_val_text_attr *a) {}


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

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

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

LLVM IR (-O2):
%struct.cli_val_text_attr = type opaque
define void @cli_val_text_attr_deinit(%struct.cli_val_text_attr* nocapture %0) {
ret void
}
/* Variables and functions */
int func1(int, int);
int func2(int, int);
int func3(int, int);
int main(void) {
  int a, b, c, d, e;
  a = 2;
  b = 3;
  c = func1(a, b);
  d = func2(a, b);
  e = func3(a, b);
  return c + d + e;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <func1@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <func2@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <func3@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <func1@plt>
mov    %eax,%ebx
mov    $0x2,%edi
mov    $0x3,%esi
call   1050 <func2@plt>
mov    %eax,%ebp
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <func3@plt>
add    %ebx,%ebp
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @func1(i32 %7, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @func2(i32 %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @func3(i32 %13, i32 %14)
store i32 %15, i32* %6
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %6
%20 = add nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func1(i32 2, i32 3)
%2 = tail call i32 @func2(i32 2, i32 3)
%3 = tail call i32 @func3(i32 2, i32 3)
%4 = add nsw i32 %2, %1
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(size_t *);
void arr_free(void *a) { free((size_t *)a - 1); }


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

x86 assembly (clang, -O2):
<arr_free>:
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @arr_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = getelementptr inbounds i64, i64* %4, i64 -1
%6 = call i32 @free(i64* %5)
ret void
}

LLVM IR (-O2):
define void @arr_free(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i64*
%4 = tail call i32 @free(i64* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ count_dir_size(char *);
int main(int argc, char **argv) {
  char *curr_dir = ".";
  if (argc > 1)
    curr_dir = argv[1];
  count_dir_size(curr_dir);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1147 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <count_dir_size@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     111c <main+0xc>
mov    0x8(%rsi),%rdi
jmp    1123 <main+0x13>
lea    0xedd(%rip),%rdi
call   1030 <count_dir_size@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 @count_dir_size(i8* %8)
ret i32 0
}
void __blast_assert(void) {
  {
  ERROR:
    goto ERROR;
  }
}


x86 assembly (clang, -O0):
<__blast_assert>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <__blast_assert+0x9>
jmp    1109 <__blast_assert+0x9>

x86 assembly (clang, -O2):
<__blast_assert>:
jmp    1100 <__blast_assert>

LLVM IR (-O0):
define void @__blast_assert() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @__blast_assert() {
br label %1
1: ; preds = %1, %0
br label %1
}
int security_acct(struct file *file) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define i32 @security_acct(%struct.file* nocapture readnone %0) {
ret i32 0
}