xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char *, size_t);
int str_here(char *haystack, size_t hay_size, size_t bufpos, char *needle,
             size_t needle_size) {
  if (needle_size <= hay_size - bufpos) {
    if (!memcmp(needle, haystack + bufpos, needle_size))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<str_here>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    -0x20(%rbp),%rcx
cmp    %rcx,%rax
ja     1170 <str_here+0x60>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
jne    116b <str_here+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1177 <str_here+0x67>
jmp    1170 <str_here+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_here>:
sub    %rdx,%rsi
cmp    %r8,%rsi
jb     1136 <str_here+0x26>
push   %rax
mov    %rdi,%rax
add    %rdx,%rax
mov    %rcx,%rdi
mov    %rax,%rsi
mov    %r8,%rdx
call   1030 <bcmp@plt>
test   %eax,%eax
lea    0x8(%rsp),%rsp
je     1139 <str_here+0x29>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @str_here(i8* nocapture %0, i64 %1, i64 %2, i8* nocapture %3, i64 %4) {
%6 = sub i64 %1, %2
%7 = icmp ult i64 %6, %4
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %0, i64 %2
%10 = tail call i32 @bcmp(i8* %3, i8* %9, i64 %4)
%11 = icmp eq i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8, %5
br label %13
13: ; preds = %8, %12
%14 = phi i32 [ 0, %12 ], [ 1, %8 ]
ret i32 %14
}
void stress_dir_sync(const char *path) { (void)path; }


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

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

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

LLVM IR (-O2):
define void @stress_dir_sync(i8* nocapture %0) {
ret void
}
void foo788(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo788(i32 %0) {
ret void
}
int adhoc_sizeS(float item) { return sizeof(item); }


x86 assembly (clang, -O0):
<adhoc_sizeS>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    $0x4,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @adhoc_sizeS(float %0) {
ret i32 4
}
int all_null(const void *buf, const int len) {
  const char *bp = buf;
  int i;
  for (i = 0; i < len; i++) {
    if (bp[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<all_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1157 <all_null+0x57>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1144 <all_null+0x44>
movl   $0x0,-0x4(%rbp)
jmp    115e <all_null+0x5e>
jmp    1149 <all_null+0x49>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111a <all_null+0x1a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_null>:
mov    $0x1,%eax
test   %esi,%esi
jle    111f <all_null+0x1f>
mov    %esi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpb   $0x0,(%rdi,%rdx,1)
jne    1120 <all_null+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <all_null+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @all_null(i8* 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 %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %6, label %14
14: ; preds = %8, %6, %2
%15 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %15
}
void gk20a_debug_dump_device(struct platform_device *pdev) {}


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define void @gk20a_debug_dump_device(%struct.platform_device* nocapture %0) {
ret void
}
char *get_process() {}


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

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

LLVM IR (-O0):
define i8* @get_process() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @get_process() {
ret i8* undef
}
char *one_one_OK() {
  static char *const base = (char *)1;
  static const unsigned long offset = 1;
  return base + offset;
}


x86 assembly (clang, -O0):
<one_one_OK>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
add    $0x1,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@one_one_OK.base = internal constant i8* inttoptr (i64 1 to i8*)
@one_one_OK.offset = internal constant i64 1
define i8* @one_one_OK() {
ret i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 1)
}

LLVM IR (-O2):
define i8* @one_one_OK() {
ret i8* inttoptr (i64 2 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int foo();
int main() {
  bar();
  return foo();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @foo()
ret i32 %2
}
int left_child(int i) { return (i << 1) + 1; }


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

x86 assembly (clang, -O2):
<left_child>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @left_child(i32 %0) {
%2 = shl i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void cpu_dev_release_cb(void *p) { _zfree((p), 24, __func__); }


x86 assembly (clang, -O0):
<cpu_dev_release_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x18,%esi
lea    0xed4(%rip),%rdx
mov    $0x0,%al
call   1030 <_zfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_dev_release_cb>:
lea    0xee9(%rip),%rdx
mov    $0x18,%esi
xor    %eax,%eax
jmp    1030 <_zfree@plt>

LLVM IR (-O0):
@__func__.cpu_dev_release_cb = [19 x i8] c"cpu_dev_release_cb\00"
define void @cpu_dev_release_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @_zfree to i32 (i8*, i32, i8*, ...)*)(i8* %3, i32 24, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.cpu_dev_release_cb, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.cpu_dev_release_cb = [19 x i8] c"cpu_dev_release_cb\00"
define void @cpu_dev_release_cb(i8* %0) {
%2 = tail call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @_zfree to i32 (i8*, i32, i8*, ...)*)(i8* %0, i32 24, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.cpu_dev_release_cb, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ voidpf;
typedef scalar_t__ uLong;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fread(void *, int, size_t, int /*<<< orphan*/ *);
uLong fread_file_func(voidpf opaque, voidpf stream, void *buf, uLong size) {
  uLong ret;
  ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
  return ret;
}


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

x86 assembly (clang, -O2):
<fread_file_func>:
mov    %rdx,%rdi
mov    %rsi,%rax
mov    $0x1,%esi
mov    %rcx,%rdx
mov    %rax,%rcx
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i64 @fread_file_func(i64 %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = inttoptr i64 %1 to i32*
%6 = tail call i64 @fread(i8* %2, i32 1, i64 %3, i32* %5)
ret i64 %6
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + (unsigned char)234;
    local1 = 0UL;
    while (local1 < (unsigned char)0) {
      state[0UL] = state[local1] + state[0UL];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - 515147141UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x30dd5ac,%rax
add    $0xea,%rax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x0,%eax
jge    1155 <RandomFunc+0x55>
movzbl -0x12(%rbp),%eax
movzbl -0x11(%rbp,%rax,1),%eax
movzbl -0x11(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x11(%rbp)
movzbl -0x12(%rbp),%eax
add    $0x2,%rax
mov    %al,-0x12(%rbp)
jmp    1126 <RandomFunc+0x26>
movzbl -0x11(%rbp),%eax
sub    $0x1eb48585,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
add    $0x11,%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = add i64 %10, 51238316
%12 = add i64 %11, 234
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %13, i8* %14
store i8 0, i8* %6
br label %15
15: ; preds = %19, %2
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %35
19: ; preds = %15
%20 = load i8, i8* %6
%21 = zext i8 %20 to i64
%22 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = add nsw i32 %24, %27
%29 = trunc i32 %28 to i8
%30 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %29, i8* %30
%31 = load i8, i8* %6
%32 = zext i8 %31 to i64
%33 = add i64 %32, 2
%34 = trunc i64 %33 to i8
store i8 %34, i8* %6
br label %15
35: ; preds = %15
%36 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%37 = load i8, i8* %36
%38 = zext i8 %37 to i64
%39 = sub i64 %38, 515147141
%40 = trunc i64 %39 to i8
%41 = load i8*, i8** %4
%42 = getelementptr inbounds i8, i8* %41, i64 0
store i8 %40, i8* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, 17
store i8 %4, i8* %1
ret void
}
void rop3_29_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ *D;
  stk2 = S & stk3;
  stk1 = *D ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_29_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_29_1_0>:
mov    (%rdi),%al
xor    %al,%dl
and    %sil,%dl
xor    %al,%dl
or     %sil,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_29_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = xor i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = xor i32 %31, -1
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = and i32 %42, %44
%46 = or i32 %39, %45
%47 = trunc i32 %46 to i8
%48 = load i8*, i8** %4
store i8 %47, i8* %48
ret void
}

LLVM IR (-O2):
define void @rop3_29_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %6, %4
%8 = or i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %4, %1
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int fn();
int main(void) { return 1 + fn(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fn()
%2 = add nsw i32 %1, 1
ret i32 %2
}
unsigned short in_chksum_icmp6(unsigned short *w, int blen) { return 0; }


x86 assembly (clang, -O0):
<in_chksum_icmp6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @in_chksum_icmp6(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @in_chksum_icmp6(i16* nocapture readnone %0, i32 %1) {
ret i16 0
}
int exynos_dpi_remove(struct device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @exynos_dpi_remove(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int _InterlockedIncrement(int volatile *);
int test_InterlockedIncrement(int volatile *Addend) {
  return _InterlockedIncrement(Addend);
}


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

x86 assembly (clang, -O2):
<test_InterlockedIncrement>:
jmp    1030 <_InterlockedIncrement@plt>

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

LLVM IR (-O2):
define i32 @test_InterlockedIncrement(i32* %0) {
%2 = tail call i32 @_InterlockedIncrement(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", "Hello world!");
  printf("%s\n", "100");
  printf("%s\n", "while");
  printf("%s\n", "return");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
lea    0xee5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [13 x i8] c"Hello world!\00"
@.str.2 = [4 x i8] c"100\00"
@.str.3 = [6 x i8] c"while\00"
@.str.4 = [7 x i8] c"return\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [13 x i8] c"Hello world!\00"
@.str.2 = [4 x i8] c"100\00"
@.str.3 = [6 x i8] c"while\00"
@.str.4 = [7 x i8] c"return\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(int argc, char **argv) {
  int a = 10;
  int b = 2;
  printf("%d\n", a / b);
  printf("%d\n", b / a);
  printf("%f\n", (float)b / (float)a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cvtsi2ss %eax,%xmm0
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cvtsi2ss %eax,%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x18(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef0(%rip),%rbx
movss  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
movss  0xec2(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 10, i32* %5
store i32 2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = sdiv i32 %7, %8
%10 = sitofp i32 %9 to float
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %10)
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = sdiv i32 %12, %13
%15 = sitofp i32 %14 to float
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %15)
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to float
%19 = load i32, i32* %5
%20 = sitofp i32 %19 to float
%21 = fdiv float %18, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 5.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0.000000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 0x3FC99999A0000000)
ret i32 0
}
/* Variables and functions */
void *ssds_find_class_new(char *, int /*<<< orphan*/ *);
void *ssds_find_class(char *name) { return ssds_find_class_new(name, NULL); }


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

x86 assembly (clang, -O2):
<ssds_find_class>:
xor    %esi,%esi
jmp    1030 <ssds_find_class_new@plt>

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

LLVM IR (-O2):
define i8* @ssds_find_class(i8* %0) {
%2 = tail call i8* @ssds_find_class_new(i8* %0, i32* null)
ret i8* %2
}
int cairo_code_draw_casValueLabel_get_width() { return 33; }


x86 assembly (clang, -O0):
<cairo_code_draw_casValueLabel_get_width>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casValueLabel_get_width() {
ret i32 33
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casValueLabel_get_width() {
ret i32 33
}
/* Variables and functions */
int rgb_shift(unsigned int, int);
unsigned rgb_nibble_extract(unsigned value, int shift, unsigned mask) {
  return rgb_shift(value & mask, shift);
}


x86 assembly (clang, -O0):
<rgb_nibble_extract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
and    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <rgb_shift@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_nibble_extract>:
and    %edx,%edi
jmp    1030 <rgb_shift@plt>

LLVM IR (-O0):
define i32 @rgb_nibble_extract(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = and i32 %7, %8
%10 = load i32, i32* %5
%11 = call i32 @rgb_shift(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @rgb_nibble_extract(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, %0
%5 = tail call i32 @rgb_shift(i32 %4, i32 %1)
ret i32 %5
}
void search() {}


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

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

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

LLVM IR (-O2):
define void @search() {
ret void
}
int sign(double a) {
  if (a < 0) {
    return -1;
  }
  if (a > 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1123 <sign+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <sign+0x48>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1141 <sign+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <sign+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sign(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %2
br label %12
11: ; preds = %7
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = select i1 %2, i32 -1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ get_sp();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() { printf("0x%lx\n", get_sp()); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"0x%lx\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @get_sp()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int search(int val, short *table, int size) {
  int i;
  for (i = 0; i < size; i++) {
    if (val <= *table++)
      return i;
  }
  return size;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115c <search+0x5c>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x2,%rdx
mov    %rdx,-0x10(%rbp)
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1149 <search+0x49>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <search+0x62>
jmp    114e <search+0x4e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <search+0x15>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    %edx,%eax
test   %edx,%edx
jle    1120 <search+0x20>
mov    %eax,%eax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movswl (%rsi,%rcx,2),%edx
cmp    %edi,%edx
jge    1121 <search+0x21>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <search+0x10>
ret
mov    %ecx,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define void @update_voice() {
ret void
}
const char *pathconN_nm5_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathconN_nm5_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <pathconN_nm5_name_out+0x2b>
jmp    111a <pathconN_nm5_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <pathconN_nm5_name_out+0x3b>
jmp    114b <pathconN_nm5_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathconN_nm5_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathconN_nm5_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm5_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathconN_nm5_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathconN_nm5_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ k_error(char *);
void bt_not_a_btree() { k_error("Not a BTree"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Not a BTree\00"
define void @bt_not_a_btree() {
%1 = call i32 @k_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Not a BTree\00"
define void @bt_not_a_btree() {
%1 = tail call i32 @k_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ redrawScreen();
redrawCmd() { redrawScreen(); }


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

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

LLVM IR (-O0):
define i32 @redrawCmd() {
%1 = alloca i32
%2 = call i32 (...) @redrawScreen()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @redrawCmd() {
%1 = tail call i32 (...) @redrawScreen()
ret i32 undef
}
void gdk_gc_set_clip_rectangle() {}


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

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

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

LLVM IR (-O2):
define void @gdk_gc_set_clip_rectangle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chega_cliente(int);
int /*<<< orphan*/ cliente();
void main(void) {
  chega_cliente(321);
  cliente();
  for (int i = 0; i < 5; i++) {
    chega_cliente(i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x141,%edi
call   1030 <chega_cliente@plt>
mov    $0x0,%al
call   1040 <cliente@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1160 <main+0x40>
mov    -0x4(%rbp),%edi
call   1030 <chega_cliente@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <main+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x141,%edi
call   1030 <chega_cliente@plt>
xor    %eax,%eax
call   1040 <cliente@plt>
xor    %edi,%edi
call   1030 <chega_cliente@plt>
mov    $0x1,%edi
call   1030 <chega_cliente@plt>
mov    $0x2,%edi
call   1030 <chega_cliente@plt>
mov    $0x3,%edi
call   1030 <chega_cliente@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <chega_cliente@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = call i32 @chega_cliente(i32 321)
%3 = call i32 (...) @cliente()
store i32 0, i32* %1
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %1
%9 = call i32 @chega_cliente(i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @chega_cliente(i32 321)
%2 = tail call i32 (...) @cliente()
%3 = tail call i32 @chega_cliente(i32 0)
%4 = tail call i32 @chega_cliente(i32 1)
%5 = tail call i32 @chega_cliente(i32 2)
%6 = tail call i32 @chega_cliente(i32 3)
%7 = tail call i32 @chega_cliente(i32 4)
ret void
}
/* Type definitions */
struct sockaddr_in6 {
  int /*<<< orphan*/ sin6_addr;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
scalar_t__ inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
char *is_ipv6(char *ip_addr) {
  char *ans = "";
  struct sockaddr_in6 sa_6;
  ans = inet_pton(AF_INET6, ip_addr, &(sa_6.sin6_addr)) ? "yes" : "no";
  return ans;
}


x86 assembly (clang, -O0):
<is_ipv6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xee3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <inet_pton@plt>
mov    %rax,%rdx
lea    0xebd(%rip),%rax
lea    0xeb2(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ipv6>:
push   %rax
mov    %rdi,%rsi
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
call   1030 <inet_pton@plt>
test   %rax,%rax
lea    0xed5(%rip),%rcx
lea    0xeca(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32 }
@.str = [1 x i8] zeroinitializer
@AF_INET6 = global i32 0
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"no\00"
define i8* @is_ipv6(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca %struct.sockaddr_in6
store i8* %0, i8** %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i32, i32* @AF_INET6
%6 = load i8*, i8** %2
%7 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %4, i32 0, i32 0
%8 = call i64 @inet_pton(i32 %5, i8* %6, i32* %7)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type { i32 }
@AF_INET6 = global i32 0
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"no\00"
define i8* @is_ipv6(i8* %0) {
%2 = alloca %struct.sockaddr_in6
%3 = bitcast %struct.sockaddr_in6* %2 to i8*
%4 = load i32, i32* @AF_INET6
%5 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %2, i64 0, i32 0
%6 = call i64 @inet_pton(i32 %4, i8* %0, i32* %5)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
ret i8* %8
}
/* Variables and functions */
size_t float64PackSize(const double *data) { return sizeof(*data); }


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

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

LLVM IR (-O0):
define i64 @float64PackSize(double* %0) {
%2 = alloca double*
store double* %0, double** %2
ret i64 8
}

LLVM IR (-O2):
define i64 @float64PackSize(double* nocapture readnone %0) {
ret i64 8
}
OP(dd, b3) { op_b3(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_b3()
ret i32 undef
}
/* Variables and functions */
scalar_t__ isNumericOk(char *, int, int);
int /*<<< orphan*/ setConfigTextValue(char *, char *);
int updateSummaryInterval(char *value) {
  if (isNumericOk(value, 1000, 60000)) {
    setConfigTextValue("web.summary_interval", value);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<updateSummaryInterval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3e8,%esi
mov    $0xea60,%edx
call   1040 <isNumericOk@plt>
cmp    $0x0,%rax
je     1165 <updateSummaryInterval+0x45>
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <setConfigTextValue@plt>
movl   $0x1,-0x4(%rbp)
jmp    116c <updateSummaryInterval+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateSummaryInterval>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3e8,%esi
mov    $0xea60,%edx
call   1040 <isNumericOk@plt>
test   %rax,%rax
je     114e <updateSummaryInterval+0x2e>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <setConfigTextValue@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"web.summary_interval\00"
define i32 @updateSummaryInterval(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @isNumericOk(i8* %4, i32 1000, i32 60000)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @setConfigTextValue(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8)
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [21 x i8] c"web.summary_interval\00"
define i32 @updateSummaryInterval(i8* %0) {
%2 = tail call i64 @isNumericOk(i8* %0, i32 1000, i32 60000)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @setConfigTextValue(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
void fa0(void) {
p0A:
  goto p0A;
  goto a;
a:
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa0>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa0+0x4>

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

LLVM IR (-O0):
define void @fa0() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa0() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ fstat(int, struct stat *);
int /*<<< orphan*/ unix_error(char *);
void Fstat(int fd, struct stat *buf) {
  if (fstat(fd, buf) < 0)
    unix_error("Fstat error");
}


x86 assembly (clang, -O0):
<Fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0x0,%rax
jge    1151 <Fstat+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fstat>:
push   %rax
call   1040 <fstat@plt>
test   %rax,%rax
js     112d <Fstat+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <unix_error@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [12 x i8] c"Fstat error\00"
define void @Fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i64 @fstat(i32 %5, %struct.stat* %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @unix_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [12 x i8] c"Fstat error\00"
define void @Fstat(i32 %0, %struct.stat* nocapture %1) {
%3 = tail call i64 @fstat(i32 %0, %struct.stat* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}