xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strdup(char const *);
char *CRYPTO_strdup(const char *str, const char *file, int line) {
  return strdup(str);
}


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

x86 assembly (clang, -O2):
<CRYPTO_strdup>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @CRYPTO_strdup(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i8* @strdup(i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int fegetenv(fenv_t *envp) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @fegetenv(i32* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int multiply(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", multiply(6, 7));
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ times(struct tms *);
__attribute__((__weak__, __always___)) clock_t
softboundcets_times(struct tms *buf) {
  return times(buf);
}


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

x86 assembly (clang, -O2):
<softboundcets_times>:
jmp    1030 <times@plt>

LLVM IR (-O0):
%struct.tms = type { i32 }
define weak i32 @softboundcets_times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
%3 = load %struct.tms*, %struct.tms** %2
%4 = call i32 @times(%struct.tms* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define weak i32 @softboundcets_times(%struct.tms* %0) {
%2 = tail call i32 @times(%struct.tms* %0)
ret i32 %2
}
/* Variables and functions */
int is_prime(int);
long get_kth_primer(int K) {
  int num, count;
  for (num = 1, count = 0;; num++) {
    if (is_prime(num) == true) {
      count++;
    }
    if (count == K) {
      break;
    }
  }
  return num;
}


x86 assembly (clang, -O0):
<get_kth_primer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <is_prime@plt>
cmp    $0x1,%eax
jne    1143 <get_kth_primer+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1154 <get_kth_primer+0x44>
jmp    1167 <get_kth_primer+0x57>
jmp    1159 <get_kth_primer+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <get_kth_primer+0x19>
movslq -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_kth_primer>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    %ebx,%edi
call   1030 <is_prime@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %ecx,%ebp
cmp    %r14d,%ebp
jne    1120 <get_kth_primer+0x10>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @get_kth_primer(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %10, %2 ]
%4 = phi i32 [ 0, %1 ], [ %8, %2 ]
%5 = tail call i32 @is_prime(i32 %3)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = add nuw nsw i32 %4, %7
%9 = icmp eq i32 %8, %0
%10 = add nuw nsw i32 %3, 1
br i1 %9, label %11, label %2
11: ; preds = %2
%12 = zext i32 %3 to i64
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hallo!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"Hallo!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *prog) {
  printf("Usage of the program:\n");
  printf("    %s server <port>\n", prog);
  printf("    %s client [-4|-6] <host> <port>\n", prog);
  printf("    %s forwarder <port>\n", prog);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xf29(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage of the program:\0A\00"
@.str.1 = [22 x i8] c" %s server <port>\0A\00"
@.str.2 = [37 x i8] c" %s client [-4|-6] <host> <port>\0A\00"
@.str.3 = [25 x i8] c" %s forwarder <port>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c" %s server <port>\0A\00"
@.str.2 = [37 x i8] c" %s client [-4|-6] <host> <port>\0A\00"
@.str.3 = [25 x i8] c" %s forwarder <port>\0A\00"
@str = [22 x i8] c"Usage of the program:\00"
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %0)
ret void
}
int nussl_version_match(int major, int minor) {
  return 0 != major || 1 < minor || (0 == 0 && 1 != minor);
}


x86 assembly (clang, -O0):
<nussl_version_match>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
jne    113b <nussl_version_match+0x3b>
mov    $0x1,%al
mov    $0x1,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0x9(%rbp)
jl     113b <nussl_version_match+0x3b>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nussl_version_match>:
xor    $0x1,%esi
xor    %eax,%eax
or     %edi,%esi
setne  %al
ret

LLVM IR (-O0):
define i32 @nussl_version_match(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 = icmp ne i32 0, %5
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp slt i32 1, %8
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp ne i32 1, %11
br label %13
13: ; preds = %10, %7, %2
%14 = phi i1 [ true, %7 ], [ true, %2 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @nussl_version_match(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 1
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void gtk_hbox_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_hbox_new() {
ret void
}
/* Type definitions */
struct v4l2_fmtdesc {
  int index;
  int type;
};
typedef enum v4l2_buf_type { ____Placeholder_v4l2_buf_type } v4l2_buf_type;

/* Variables and functions */
int /*<<< orphan*/ VIDIOC_ENUM_FMT;
int xioctl(int, int /*<<< orphan*/, struct v4l2_fmtdesc *);
int get_nth_format(int fd, enum v4l2_buf_type type, int n,
                   struct v4l2_fmtdesc *format) {
  format->index = n;
  format->type = type;
  return xioctl(fd, VIDIOC_ENUM_FMT, format);
}


x86 assembly (clang, -O0):
<get_nth_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
call   1030 <xioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nth_format>:
mov    %edx,(%rcx)
mov    %esi,0x4(%rcx)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
mov    %rcx,%rdx
jmp    1030 <xioctl@plt>

LLVM IR (-O0):
%struct.v4l2_fmtdesc = type { i32, i32 }
@VIDIOC_ENUM_FMT = global i32 0
define i32 @get_nth_format(i32 %0, i32 %1, i32 %2, %struct.v4l2_fmtdesc* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.v4l2_fmtdesc*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.v4l2_fmtdesc* %3, %struct.v4l2_fmtdesc** %8
%9 = load i32, i32* %7
%10 = load %struct.v4l2_fmtdesc*, %struct.v4l2_fmtdesc** %8
%11 = getelementptr inbounds %struct.v4l2_fmtdesc, %struct.v4l2_fmtdesc* %10, i32 0, i32 0
store i32 %9, i32* %11
%12 = load i32, i32* %6
%13 = load %struct.v4l2_fmtdesc*, %struct.v4l2_fmtdesc** %8
%14 = getelementptr inbounds %struct.v4l2_fmtdesc, %struct.v4l2_fmtdesc* %13, i32 0, i32 1
store i32 %12, i32* %14
%15 = load i32, i32* %5
%16 = load i32, i32* @VIDIOC_ENUM_FMT
%17 = load %struct.v4l2_fmtdesc*, %struct.v4l2_fmtdesc** %8
%18 = call i32 @xioctl(i32 %15, i32 %16, %struct.v4l2_fmtdesc* %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.v4l2_fmtdesc = type { i32, i32 }
@VIDIOC_ENUM_FMT = global i32 0
define i32 @get_nth_format(i32 %0, i32 %1, i32 %2, %struct.v4l2_fmtdesc* %3) {
%5 = getelementptr inbounds %struct.v4l2_fmtdesc, %struct.v4l2_fmtdesc* %3, i64 0, i32 0
store i32 %2, i32* %5
%6 = getelementptr inbounds %struct.v4l2_fmtdesc, %struct.v4l2_fmtdesc* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = load i32, i32* @VIDIOC_ENUM_FMT
%8 = tail call i32 @xioctl(i32 %0, i32 %7, %struct.v4l2_fmtdesc* %3)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ banner();
int /*<<< orphan*/ usage();
int info(void) {
  banner();
  usage();
  return 0;
}


x86 assembly (clang, -O0):
<info>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <banner@plt>
mov    $0x0,%al
call   1040 <usage@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<info>:
push   %rax
xor    %eax,%eax
call   1030 <banner@plt>
xor    %eax,%eax
call   1040 <usage@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @info() {
%1 = call i32 (...) @banner()
%2 = call i32 (...) @usage()
ret i32 0
}

LLVM IR (-O2):
define i32 @info() {
%1 = tail call i32 (...) @banner()
%2 = tail call i32 (...) @usage()
ret i32 0
}
void caller_1_1_1_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_1_2_2_1_2() {
ret void
}
int cparam(int x, int y) {
  if (x < 0)
    y = 0;
  return x + y;
}


x86 assembly (clang, -O0):
<cparam>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111b <cparam+0x1b>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cparam>:
xor    %eax,%eax
test   %edi,%edi
cmovns %esi,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cparam(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = select i1 %3, i32 0, i32 %1
%5 = add nsw i32 %4, %0
ret i32 %5
}
int main(int argc, const char *argv[]) {
  int fibonacci[10];
  fibonacci[0] = fibonacci[1] = 1;
  int i;
  for (i = 2; i < 10; i++) {
    fibonacci[i] = fibonacci[i - 1] + fibonacci[i - 2];
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x3c(%rbp)
movl   $0x1,-0x40(%rbp)
movl   $0x2,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    115f <main+0x5f>
mov    -0x44(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x40(%rbp,%rax,4),%ecx
mov    -0x44(%rbp),%eax
sub    $0x2,%eax
cltq
add    -0x40(%rbp,%rax,4),%ecx
movslq -0x44(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1127 <main+0x27>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void isr_GP_exc(void) {
  print("GP fault\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<isr_GP_exc>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <print@plt>
jmp    1120 <isr_GP_exc+0x10>

x86 assembly (clang, -O2):
<isr_GP_exc>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <print@plt>
nopl   (%rax)
jmp    1120 <isr_GP_exc+0x10>

LLVM IR (-O0):
@.str = [10 x i8] c"GP fault\0A\00"
define void @isr_GP_exc() {
%1 = call i32 @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [10 x i8] c"GP fault\0A\00"
define void @isr_GP_exc() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) { nrerror("usage: AnalyseDist [-X[swn]]"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"usage: AnalyseDist [-X[swn]]\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"usage: AnalyseDist [-X[swn]]\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long sysfs_get_freq_hardware(unsigned int);
unsigned long cpufreq_get_freq_hardware(unsigned int cpu) {
  return sysfs_get_freq_hardware(cpu);
}


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

x86 assembly (clang, -O2):
<cpufreq_get_freq_hardware>:
jmp    1030 <sysfs_get_freq_hardware@plt>

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

LLVM IR (-O2):
define i64 @cpufreq_get_freq_hardware(i32 %0) {
%2 = tail call i64 @sysfs_get_freq_hardware(i32 %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ omp_lock_t;

/* Variables and functions */
void omp_init_lock(omp_lock_t *_Lock) {}


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

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

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

LLVM IR (-O2):
define void @omp_init_lock(i32* nocapture %0) {
ret void
}
void glutSpaceballButtonFunc(void (*func)(int button, int state)) {}


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

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

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

LLVM IR (-O2):
define void @glutSpaceballButtonFunc(void (i32, i32)* nocapture %0) {
ret void
}
char *state_name(int i) {
  if (i == -1)
    return "unknown";
  if (i == 0)
    return "sleeping";
  if (i == 1)
    return "active";
  return "internal error";
}


x86 assembly (clang, -O0):
<state_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1121 <state_name+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <state_name+0x60>
cmpl   $0x0,-0xc(%rbp)
jne    113b <state_name+0x3b>
lea    0xed6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <state_name+0x60>
cmpl   $0x1,-0xc(%rbp)
jne    1155 <state_name+0x55>
lea    0xec5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <state_name+0x60>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<state_name>:
add    $0x1,%edi
cmp    $0x2,%edi
ja     111a <state_name+0x1a>
movslq %edi,%rax
lea    0xf16(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xef7(%rip),%rax
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
@.str.1 = [9 x i8] c"sleeping\00"
@.str.2 = [7 x i8] c"active\00"
@.str.3 = [15 x i8] c"internal error\00"
@reltable.state_name = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.state_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.state_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.state_name to i64)) to i32)]
define i8* @state_name(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.state_name to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %9
}
/* Variables and functions */
int htoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char s[6] = "0x10";
  printf("decimal: %d\n", htoi(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <htoi@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x0,0x4(%rsp)
movl   $0x30317830,(%rsp)
mov    %rsp,%rdi
call   1040 <htoi@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@__const.main.s = [6 x i8] c"0x10\00\00"
@.str = [13 x i8] c"decimal: %d\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @htoi(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
__attribute__((section(".after_vectors"))) void IntDefaultHandler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define void @IntDefaultHandler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @IntDefaultHandler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int getConfigInt(char *, int);
int /*<<< orphan*/ setLogLevel(int);
void setCustomLogLevel() {
  int dbLogLevel = getConfigInt("cap.loglevel", 1);
  if (dbLogLevel > 0) {
    setLogLevel(dbLogLevel);
  }
}


x86 assembly (clang, -O0):
<setCustomLogLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x1,%esi
call   1030 <getConfigInt@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114e <setCustomLogLevel+0x2e>
mov    -0x4(%rbp),%edi
call   1040 <setLogLevel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCustomLogLevel>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
call   1030 <getConfigInt@plt>
test   %eax,%eax
jle    113e <setCustomLogLevel+0x1e>
mov    %eax,%edi
pop    %rax
jmp    1040 <setLogLevel@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"cap.loglevel\00"
define void @setCustomLogLevel() {
%1 = alloca i32
%2 = call i32 @getConfigInt(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @setLogLevel(i32 %6)
br label %8
8: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"cap.loglevel\00"
define void @setCustomLogLevel() {
%1 = tail call i32 @getConfigInt(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @setLogLevel(i32 %1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
char *__kernel_strcpy(char *, char const *);
int __kernel_strlen(char *);
char *strcat(char *dest, const char *src) {
  return __kernel_strcpy(dest + __kernel_strlen(dest), src);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__kernel_strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__kernel_strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <__kernel_strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <__kernel_strcpy@plt>

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @__kernel_strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i8* @__kernel_strcpy(i8* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* %1) {
%3 = tail call i32 @__kernel_strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i8* @__kernel_strcpy(i8* %5, i8* %1)
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint64_t cread_u16(const void *const ptr) {
  return (uint64_t)(*(uint16_t *)(ptr));
}


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

x86 assembly (clang, -O2):
<cread_u16>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @cread_u16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *tmalloc(size_t size) {
  void *result = malloc(size);
  if (!result) {
    perror("malloc");
    exit(255);
  }
  return result;
}


x86 assembly (clang, -O0):
<tmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <tmalloc+0x3a>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
mov    $0xff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <tmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0xff,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @tmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 255)
unreachable
7: ; preds = %1
ret i8* %2
}
int test_01(volatile short *x, unsigned int y) { return x[y]; }


x86 assembly (clang, -O0):
<test_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,2),%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_01>:
mov    %esi,%eax
movswl (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @test_01(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = load i16*, i16** %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i16, i16* %5, i64 %7
%9 = load volatile i16, i16* %8
%10 = sext i16 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_01(i16* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i16, i16* %0, i64 %3
%5 = load volatile i16, i16* %4
%6 = sext i16 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void __attribute__((constructor)) init_openssl(void) {
  SSL_library_init();
  SSL_load_error_strings();
}


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init_openssl, i8* null }]
define void @init_openssl() {
%1 = call i32 (...) @SSL_library_init()
%2 = call i32 (...) @SSL_load_error_strings()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init_openssl, i8* null }]
define void @init_openssl() {
%1 = tail call i32 (...) @SSL_library_init()
%2 = tail call i32 (...) @SSL_load_error_strings()
ret void
}
/* Variables and functions */
int REG_EXTENDED;
void regex_flag_extend_short(char c __attribute__((unused)), void *data) {
  int *cflags = data;
  *cflags |= REG_EXTENDED;
}


x86 assembly (clang, -O0):
<regex_flag_extend_short>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<regex_flag_extend_short>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
or     %eax,(%rsi)
ret

LLVM IR (-O0):
@REG_EXTENDED = global i32 0
define void @regex_flag_extend_short(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32*
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* @REG_EXTENDED
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = or i32 %10, %8
store i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
@REG_EXTENDED = global i32 0
define void @regex_flag_extend_short(i8 signext %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* @REG_EXTENDED
%5 = load i32, i32* %3
%6 = or i32 %5, %4
store i32 %6, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(unsigned char *, int);
scalar_t__ munge_all(unsigned char *);
int /*<<< orphan*/ printflag();
int main(int argc, char **argv) {
  int fd;
  unsigned char data[32];
  bzero(data, 32);
  if (munge_all(data)) {
    printflag();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x20,%esi
call   1040 <bzero@plt>
lea    -0x40(%rbp),%rdi
call   1030 <munge_all@plt>
cmp    $0x0,%rax
je     116e <main+0x3e>
mov    $0x0,%al
call   1050 <printflag@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <bzero@plt>
mov    %rbx,%rdi
call   1030 <munge_all@plt>
test   %rax,%rax
je     1159 <main+0x29>
xor    %eax,%eax
call   1050 <printflag@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [32 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%9 = call i32 @bzero(i8* %8, i32 32)
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%11 = call i64 @munge_all(i8* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (...) @printflag()
br label %15
15: ; preds = %13, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @bzero(i8* %4, i32 32)
%6 = call i64 @munge_all(i8* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 (...) @printflag()
br label %10
10: ; preds = %8, %2
ret i32 0
}
long TIME() {
  long time();
  return (time(0L));
}


x86 assembly (clang, -O0):
<TIME>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
mov    $0x0,%al
call   1030 <time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TIME>:
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <time@plt>

LLVM IR (-O0):
define i64 @TIME() {
%1 = call i64 (i64, ...) bitcast (i64 (...)* @time to i64 (i64, ...)*)(i64 0)
ret i64 %1
}

LLVM IR (-O2):
define i64 @TIME() {
%1 = tail call i64 (i64, ...) bitcast (i64 (...)* @time to i64 (i64, ...)*)(i64 0)
ret i64 %1
}
/* Variables and functions */
double RAND_MAX;
int rand();
double rand_uniform_1(void) {
  int val = rand();
  return (double)val / RAND_MAX;
}


x86 assembly (clang, -O0):
<rand_uniform_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
mov    0x2eba(%rip),%rax
divsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_uniform_1>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %eax,%xmm0
mov    0x2ec5(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rand_uniform_1() {
%1 = alloca i32
%2 = call i32 (...) @rand()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand_uniform_1() {
%1 = tail call i32 (...) @rand()
%2 = sitofp i32 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int fgetc(unsigned int);
long fget_long(unsigned handle) {
  int low, high;
  long l;
  low = fgetc(handle);
  high = fgetc(handle);
  l = ((long)high) << 32;
  l |= low;
  return l;
}


x86 assembly (clang, -O0):
<fget_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fgetc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x20,%rax
mov    %rax,-0x18(%rbp)
movslq -0x8(%rbp),%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fget_long>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <fgetc@plt>
shl    $0x20,%rax
movslq %ebp,%rcx
or     %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @fget_long(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @fgetc(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @fgetc(i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = shl i64 %11, 32
store i64 %12, i64* %5
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = load i64, i64* %5
%16 = or i64 %15, %14
store i64 %16, i64* %5
%17 = load i64, i64* %5
ret i64 %17
}

LLVM IR (-O2):
define i64 @fget_long(i32 %0) {
%2 = tail call i32 @fgetc(i32 %0)
%3 = tail call i32 @fgetc(i32 %0)
%4 = zext i32 %3 to i64
%5 = shl nuw i64 %4, 32
%6 = sext i32 %2 to i64
%7 = or i64 %5, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_MediaRenderer_AVTransport_GetDeviceCapabilities(void *, char *,
                                                             char *, char *);
int /*<<< orphan*/ printf(char *, unsigned int);
void UpnpMediaRenderer_AVTransport_GetDeviceCapabilities(
    void *upnptoken, unsigned int InstanceID) {
  printf("Invoke: UpnpMediaRenderer_AVTransport_GetDeviceCapabilities(%u);\r\n",
         InstanceID);
  UpnpResponse_MediaRenderer_AVTransport_GetDeviceCapabilities(
      upnptoken, "Sample String", "Sample String", "Sample String");
}


x86 assembly (clang, -O0):
<UpnpMediaRenderer_AVTransport_GetDeviceCapabilities>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xefa(%rip),%rcx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1040 <UpnpResponse_MediaRenderer_AVTransport_GetDeviceCapabilities@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpMediaRenderer_AVTransport_GetDeviceCapabilities>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0c(%rip),%rcx
mov    %rbx,%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
pop    %rbx
jmp    1040 <UpnpResponse_MediaRenderer_AVTransport_GetDeviceCapabilities@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"Invoke: UpnpMediaRenderer_AVTransport_GetDeviceCapabilities(%u);\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UpnpMediaRenderer_AVTransport_GetDeviceCapabilities(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UpnpResponse_MediaRenderer_AVTransport_GetDeviceCapabilities(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [67 x i8] c"Invoke: UpnpMediaRenderer_AVTransport_GetDeviceCapabilities(%u);\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UpnpMediaRenderer_AVTransport_GetDeviceCapabilities(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UpnpResponse_MediaRenderer_AVTransport_GetDeviceCapabilities(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dailyWeather2(int, double *, double *, int, int, int, int);
void C_dailyWeather2_R(int *nSites, double latitudes[], double longitudes[],
                       int *year, int *month, int *type, int *printdebug) {
  dailyWeather2(*nSites, latitudes, longitudes, *year, *month, *type,
                *printdebug);
}


x86 assembly (clang, -O0):
<C_dailyWeather2_R>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%rax
mov    (%rax),%r9d
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
call   1030 <dailyWeather2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_dailyWeather2_R>:
push   %rax
mov    0x10(%rsp),%rax
mov    (%rdi),%edi
mov    (%rcx),%ecx
mov    (%r8),%r8d
mov    (%r9),%r9d
mov    (%rax),%eax
mov    %eax,(%rsp)
call   1030 <dailyWeather2@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @C_dailyWeather2_R(i32* %0, double* %1, double* %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = alloca i32*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
store i32* %0, i32** %8
store double* %1, double** %9
store double* %2, double** %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load double*, double** %9
%18 = load double*, double** %10
%19 = load i32*, i32** %11
%20 = load i32, i32* %19
%21 = load i32*, i32** %12
%22 = load i32, i32* %21
%23 = load i32*, i32** %13
%24 = load i32, i32* %23
%25 = load i32*, i32** %14
%26 = load i32, i32* %25
%27 = call i32 @dailyWeather2(i32 %16, double* %17, double* %18, i32 %20, i32 %22, i32 %24, i32 %26)
ret void
}

LLVM IR (-O2):
define void @C_dailyWeather2_R(i32* nocapture %0, double* %1, double* %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32* nocapture %6) {
%8 = load i32, i32* %0
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = tail call i32 @dailyWeather2(i32 %8, double* %1, double* %2, i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display_sequence(char *, char *, int, int *, int, int);
int strlen(char *);
void connect_sequence(char *str0, char *str1) {
  int tab[100];
  int len_str1 = strlen(str1);
  int depth = 0;
  int pos = 0;
  display_sequence(str0, str1, len_str1, tab, depth, pos);
}


x86 assembly (clang, -O0):
<connect_sequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1a4(%rbp)
movl   $0x0,-0x1a8(%rbp)
movl   $0x0,-0x1ac(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1a4(%rbp),%edx
lea    -0x1a0(%rbp),%rcx
mov    -0x1a8(%rbp),%r8d
mov    -0x1ac(%rbp),%r9d
call   1040 <display_sequence@plt>
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connect_sequence>:
push   %r14
push   %rbx
sub    $0x198,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rsp,%rcx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <display_sequence@plt>
add    $0x198,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @connect_sequence(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [100 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = call i32 @display_sequence(i8* %11, i8* %12, i32 %13, i32* %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @connect_sequence(i8* %0, i8* %1) {
%3 = alloca [100 x i32]
%4 = bitcast [100 x i32]* %3 to i8*
%5 = tail call i32 @strlen(i8* %1)
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%7 = call i32 @display_sequence(i8* %0, i8* %1, i32 %5, i32* %6, i32 0, i32 0)
ret void
}