xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strchr(const char *s, int charwanted) {
  register char c;
  while ((c = *s++) != (char)charwanted)
    if (c == 0)
      return NULL;
  return ((char *)--s);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x15(%rbp)
movsbl %al,%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
je     114f <strchr+0x4f>
movsbl -0x15(%rbp),%eax
cmp    $0x0,%eax
jne    114a <strchr+0x4a>
movq   $0x0,-0x8(%rbp)
jmp    115f <strchr+0x5f>
jmp    110b <strchr+0xb>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
nopw   0x0(%rax,%rax,1)
movsbl (%rax),%edx
cmp    %edx,%ecx
je     1121 <strchr+0x21>
add    $0x1,%rax
test   %dl,%dl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %10, %2
%6 = phi i8* [ %0, %2 ], [ %11, %10 ]
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %4, %8
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i8 %7, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %10
%14 = phi i8* [ null, %10 ], [ %6, %5 ]
ret i8* %14
}
void gtk_spin_button_set_snap_to_ticks() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @num(i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, int);
void print_volume(int dimension, double volume) {
  printf("\t%.6f,  /* dimension %3d */\n", volume, dimension);
}


x86 assembly (clang, -O0):
<print_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_volume>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\09%.6f, /* dimension %3d */\0A\00"
define void @print_volume(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), double %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"\09%.6f, /* dimension %3d */\0A\00"
define void @print_volume(i32 %0, double %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), double %1, i32 %0)
ret void
}
int multiply(int a, int b) { return a * b; }


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

x86 assembly (clang, -O2):
<multiply>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @multiply(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @multiply(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
int main() {
  char array[16 * 1024];
  register int loop;
  register int solution = 0;
  for (loop = 0; loop < 1000000; loop++) {
    solution *= array[0];
    solution *= array[8200];
  }
  return solution;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3fa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4018(%rbp)
movl   $0x0,-0x4014(%rbp)
cmpl   $0xf4240,-0x4014(%rbp)
jge    1172 <main+0x72>
movsbl -0x4010(%rbp),%eax
imul   -0x4018(%rbp),%eax
mov    %eax,-0x4018(%rbp)
movsbl -0x2008(%rbp),%eax
imul   -0x4018(%rbp),%eax
mov    %eax,-0x4018(%rbp)
mov    -0x4014(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4014(%rbp)
jmp    1126 <main+0x26>
mov    -0x4018(%rbp),%eax
add    $0x3fa0,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_socket_send_pkt_na_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_socket@%p::send_pkt_na (rtpp_socket_send_pkt_na) is "
          "invoked after destruction\x0a",
          pub);
  abort();
}


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

x86 assembly (clang, -O2):
<rtpp_socket_send_pkt_na_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [91 x i8] c"Method rtpp_socket@%p::send_pkt_na (rtpp_socket_send_pkt_na) is invoked after destruction\0A\00"
define void @rtpp_socket_send_pkt_na_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [91 x i8] c"Method rtpp_socket@%p::send_pkt_na (rtpp_socket_send_pkt_na) is invoked after destruction\0A\00"
define void @rtpp_socket_send_pkt_na_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
void port_word_out(unsigned short port, unsigned short data) {
  __asm__("out %%al, %%dx" : : "a"(data), "d"(port));
}


x86 assembly (clang, -O0):
<port_word_out>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_word_out>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @port_word_out(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @port_word_out(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "out %al, %dx", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %1, i16 %0)
ret void
}
int qsort_strcmp(s1, s2)
char **s1, **s2;
{ return (strcoll(*s1, *s2)); }


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

x86 assembly (clang, -O2):
<qsort_strcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
xor    %eax,%eax
jmp    1030 <strcoll@plt>

LLVM IR (-O0):
define i32 @qsort_strcmp(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** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @strcoll to i32 (i8*, i8*, ...)*)(i8* %6, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @qsort_strcmp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @strcoll to i32 (i8*, i8*, ...)*)(i8* %3, i8* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ slab_heapinfo_deinit();
int /*<<< orphan*/ slab_slabclass_deinit();
void slab_deinit(void) {
  slab_heapinfo_deinit();
  slab_slabclass_deinit();
}


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

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

LLVM IR (-O0):
define void @slab_deinit() {
%1 = call i32 (...) @slab_heapinfo_deinit()
%2 = call i32 (...) @slab_slabclass_deinit()
ret void
}

LLVM IR (-O2):
define void @slab_deinit() {
%1 = tail call i32 (...) @slab_heapinfo_deinit()
%2 = tail call i32 (...) @slab_slabclass_deinit()
ret void
}
void outsl(int port, const void *addr, int cnt) {
  __asm__ __volatile__("cld; rep outsl"
                       : "=S"(addr), "=c"(cnt)
                       : "d"(port), "0"(addr), "1"(cnt)
                       : "cc");
}


x86 assembly (clang, -O0):
<outsl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
cld
rep outsl %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsl>:
mov    %edx,%ecx
mov    %edi,%edx
cld
rep outsl %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsl(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call { i8*, i32 } asm sideeffect "cld; rep outsl", "={si},={cx},{dx},0,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %7, i8* %8, i32 %9)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %5
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @outsl(i32 %0, i8* %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "cld; rep outsl", "={si},={cx},{dx},0,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i32 %2)
ret void
}
void cam_glint_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @cam_glint_enable() {
ret void
}
void(CONSUME11)() {}


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

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

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

LLVM IR (-O2):
define void @CONSUME11() {
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
scalar_t__ svc_getcaller(int /*<<< orphan*/ *);
struct sockaddr_in *nfs_getrpccaller_in(SVCXPRT *xprt) {
  return (struct sockaddr_in *)(char *)svc_getcaller(xprt);
}


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

x86 assembly (clang, -O2):
<nfs_getrpccaller_in>:
jmp    1030 <svc_getcaller@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
define %struct.sockaddr_in* @nfs_getrpccaller_in(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @svc_getcaller(i32* %3)
%5 = inttoptr i64 %4 to i8*
%6 = bitcast i8* %5 to %struct.sockaddr_in*
ret %struct.sockaddr_in* %6
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
define %struct.sockaddr_in* @nfs_getrpccaller_in(i32* %0) {
%2 = tail call i64 @svc_getcaller(i32* %0)
%3 = inttoptr i64 %2 to %struct.sockaddr_in*
ret %struct.sockaddr_in* %3
}
void XQueryBestStipple() {}


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

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

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

LLVM IR (-O2):
define void @XQueryBestStipple() {
ret void
}
/* Type definitions */
struct b6_tref {
  int dummy;
};
struct b6_tree {
  int dummy;
};

/* Variables and functions */
struct b6_tref *b6_tree_child(struct b6_tref *, int);
int /*<<< orphan*/ b6_tree_top(struct b6_tree const *, struct b6_tref **,
                               int *);
struct b6_tref *b6_tree_root(const struct b6_tree *tree) {
  struct b6_tref *top;
  int dir;
  b6_tree_top(tree, &top, &dir);
  return b6_tree_child(top, dir);
}


x86 assembly (clang, -O0):
<b6_tree_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <b6_tree_top@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <b6_tree_child@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b6_tree_root>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <b6_tree_top@plt>
mov    0x10(%rsp),%rdi
mov    0xc(%rsp),%esi
call   1040 <b6_tree_child@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.b6_tref = type { i32 }
%struct.b6_tree = type { i32 }
define %struct.b6_tref* @b6_tree_root(%struct.b6_tree* %0) {
%2 = alloca %struct.b6_tree*
%3 = alloca %struct.b6_tref*
%4 = alloca i32
store %struct.b6_tree* %0, %struct.b6_tree** %2
%5 = load %struct.b6_tree*, %struct.b6_tree** %2
%6 = call i32 @b6_tree_top(%struct.b6_tree* %5, %struct.b6_tref** %3, i32* %4)
%7 = load %struct.b6_tref*, %struct.b6_tref** %3
%8 = load i32, i32* %4
%9 = call %struct.b6_tref* @b6_tree_child(%struct.b6_tref* %7, i32 %8)
ret %struct.b6_tref* %9
}

LLVM IR (-O2):
%struct.b6_tref = type { i32 }
%struct.b6_tree = type { i32 }
define %struct.b6_tref* @b6_tree_root(%struct.b6_tree* %0) {
%2 = alloca %struct.b6_tref*
%3 = alloca i32
%4 = bitcast %struct.b6_tref** %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @b6_tree_top(%struct.b6_tree* %0, %struct.b6_tref** %2, i32* %3)
%7 = load %struct.b6_tref*, %struct.b6_tref** %2
%8 = load i32, i32* %3
%9 = call %struct.b6_tref* @b6_tree_child(%struct.b6_tref* %7, i32 %8)
ret %struct.b6_tref* %9
}
int test_imm_7Bint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x7B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Bint64_midword_mem>:
testb  $0x7b,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Bint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8060928
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
unsigned short htons(unsigned short);
unsigned short ntohs(unsigned short x) { return htons(x); }


x86 assembly (clang, -O0):
<ntohs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <htons@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohs>:
jmp    1030 <htons@plt>

LLVM IR (-O0):
define zeroext i16 @ntohs(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @htons(i16 zeroext %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @ntohs(i16 zeroext %0) {
%2 = tail call zeroext i16 @htons(i16 zeroext %0)
ret i16 %2
}
int fun482() { return 482; }


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

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

LLVM IR (-O0):
define i32 @fun482() {
ret i32 482
}

LLVM IR (-O2):
define i32 @fun482() {
ret i32 482
}
unsigned short ReadShort(const unsigned char **p) {
  unsigned short s = *(const unsigned short *)(*p);
  (*p) += 2;
  return s;
}


x86 assembly (clang, -O0):
<ReadShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadShort>:
mov    (%rdi),%rcx
movzwl (%rcx),%eax
add    $0x2,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define zeroext i16 @ReadShort(i8** %0) {
%2 = alloca i8**
%3 = alloca i16
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i16*
%7 = load i16, i16* %6
store i16 %7, i16* %3
%8 = load i8**, i8*** %2
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8* %10, i8** %8
%11 = load i16, i16* %3
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @ReadShort(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = bitcast i8* %2 to i16*
%4 = load i16, i16* %3
%5 = getelementptr inbounds i8, i8* %2, i64 2
store i8* %5, i8** %0
ret i16 %4
}
/* Variables and functions */
long strtol(char *, char **, int);
int hex2i(char *s) {
  char *ptr;
  long l = strtol(s, &ptr, 16);
  if (*ptr)
    return -1;
  return (int)l;
}


x86 assembly (clang, -O0):
<hex2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <hex2i+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <hex2i+0x42>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2i>:
push   %rax
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    (%rsp),%rcx
xor    %edx,%edx
cmp    (%rcx),%dl
sbb    %ecx,%ecx
or     %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @hex2i(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtol(i8* %0, i8** %2, i32 16)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = trunc i64 %4 to i32
%9 = select i1 %7, i32 %8, i32 -1
ret i32 %9
}
void foo_2_1_1_1_2_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_2_1_2_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hello world !\n");
  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)
lea    0xed3(%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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"hello world !\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 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"hello world !\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank5High(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ vrc2_4_SetChrROMBank5();
void vrc2_4_setParamsDXX3(uint16_t addr, uint8_t val) {
  __setCHRBank5High(addr, val);
  vrc2_4_SetChrROMBank5();
}


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

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

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

LLVM IR (-O2):
define void @vrc2_4_setParamsDXX3(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank5High(i32 %0, i32 %1)
%4 = tail call i32 (...) @vrc2_4_SetChrROMBank5()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void trs_print_str(char *str) { fprintf(stdout, "%s", str); }


x86 assembly (clang, -O0):
<trs_print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trs_print_str>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @trs_print_str(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pivot();
int /*<<< orphan*/ revelation();
int main() {
  revelation();
  pivot();
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @revelation()
%2 = call i32 (...) @pivot()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @revelation()
%2 = tail call i32 (...) @pivot()
ret i32 0
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ scanf(char *, int *);
int /*<<< orphan*/ subarray_sum(int);
int main(int argc, char *argv[]) {
  int dest;
  while (scanf("%d", &dest) != EOF) {
    subarray_sum(dest);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
je     1163 <main+0x43>
mov    -0x14(%rbp),%edi
call   1030 <subarray_sum@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea7(%rip),%r15
cmp    (%r15),%rax
je     1179 <main+0x59>
lea    0xeb3(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xc(%rsp),%edi
call   1030 <subarray_sum@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r15),%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %14, label %8
8: ; preds = %2, %8
%9 = load i32, i32* %3
%10 = call i32 @subarray_sum(i32 %9)
%11 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %8
14: ; preds = %8, %2
ret i32 0
}
void mdp4_overlay_dtv_start(void) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_overlay_dtv_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
void fillRect(int x1, int x2, int x3, int x4) {
  printf("FR %i %i %i %i\n", x1, x2, x3, x4);
}


x86 assembly (clang, -O0):
<fillRect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillRect>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"FR %i %i %i %i\0A\00"
define void @fillRect(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"FR %i %i %i %i\0A\00"
define void @fillRect(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char *, struct stat *);
int is_dir(char *path) {
  struct stat buf;
  stat(path, &buf);
  return S_ISDIR(buf.st_mode);
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @S_ISDIR(i32 %6)
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long long quot;
  long long rem;
};
typedef TYPE_1__ lldiv_t;

/* Variables and functions */
lldiv_t lldiv(long long int numer, long long int denom) {
  lldiv_t result;
  result.quot = numer / denom;
  result.rem = numer % denom;
}


x86 assembly (clang, -O0):
<lldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @lldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
%6 = alloca %struct.TYPE_3__
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = sdiv i64 %7, %8
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
store i64 %9, i64* %10
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = srem i64 %11, %12
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 1
store i64 %13, i64* %14
%15 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%16 = load { i64, i64 }, { i64, i64 }* %15
ret { i64, i64 } %16
}

LLVM IR (-O2):
define { i64, i64 } @lldiv(i64 %0, i64 %1) {
ret { i64, i64 } undef
}
int eVogal(char letra) {
  switch (letra) {
  case 'a':
  case 'A':
  case 'e':
  case 'E':
  case 'i':
  case 'I':
  case 'o':
  case 'O':
  case 'u':
  case 'U':
    return 1;
    break;
  default:
    return 0;
    break;
  }
}


x86 assembly (clang, -O0):
<eVogal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x41,%eax
je     11b8 <eVogal+0xb8>
jmp    111f <eVogal+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x45,%eax
je     11b8 <eVogal+0xb8>
jmp    1130 <eVogal+0x30>
mov    -0xc(%rbp),%eax
sub    $0x49,%eax
je     11b8 <eVogal+0xb8>
jmp    1141 <eVogal+0x41>
mov    -0xc(%rbp),%eax
sub    $0x4f,%eax
je     11b8 <eVogal+0xb8>
jmp    1152 <eVogal+0x52>
mov    -0xc(%rbp),%eax
sub    $0x55,%eax
je     11b8 <eVogal+0xb8>
jmp    1163 <eVogal+0x63>
mov    -0xc(%rbp),%eax
sub    $0x61,%eax
je     11b8 <eVogal+0xb8>
jmp    1174 <eVogal+0x74>
mov    -0xc(%rbp),%eax
sub    $0x65,%eax
je     11b8 <eVogal+0xb8>
jmp    1185 <eVogal+0x85>
mov    -0xc(%rbp),%eax
sub    $0x69,%eax
je     11b8 <eVogal+0xb8>
jmp    1196 <eVogal+0x96>
mov    -0xc(%rbp),%eax
sub    $0x6f,%eax
je     11b8 <eVogal+0xb8>
jmp    11a7 <eVogal+0xa7>
mov    -0xc(%rbp),%eax
sub    $0x75,%eax
jne    11c4 <eVogal+0xc4>
jmp    11b8 <eVogal+0xb8>
movl   $0x1,-0x4(%rbp)
jmp    11cb <eVogal+0xcb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eVogal>:
add    $0xffffffbf,%edi
cmp    $0x34,%edi
ja     111e <eVogal+0x1e>
mov    $0x1,%eax
movabs $0x10411100104111,%rcx
bt     %rdi,%rcx
jae    111e <eVogal+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @eVogal(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 97, label %6
i32 65, label %6
i32 101, label %6
i32 69, label %6
i32 105, label %6
i32 73, label %6
i32 111, label %6
i32 79, label %6
i32 117, label %6
i32 85, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @eVogal(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 97, label %4
i32 65, label %4
i32 101, label %4
i32 69, label %4
i32 105, label %4
i32 73, label %4
i32 111, label %4
i32 79, label %4
i32 117, label %4
i32 85, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void carp_print_version() { printf("carp %1.1f\n", 0.3); }


x86 assembly (clang, -O0):
<carp_print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
movsd  0xedd(%rip),%xmm0
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<carp_print_version>:
lea    0xef1(%rip),%rdi
movsd  0xee1(%rip),%xmm0
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"carp %1.1f\0A\00"
define void @carp_print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double 3.000000e-01)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"carp %1.1f\0A\00"
define void @carp_print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double 3.000000e-01)
ret void
}
void gdb_add_symbol_file(void *addr, const char *file) { return; }


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

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

LLVM IR (-O0):
define void @gdb_add_symbol_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @gdb_add_symbol_file(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void __attribute__((weak)) tim9_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<tim9_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tim9_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.tim9_isr = [9 x i8] c"tim9_isr\00"
define weak void @tim9_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.tim9_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.tim9_isr = [9 x i8] c"tim9_isr\00"
define weak void @tim9_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.tim9_isr, i64 0, i64 0))
ret void
}
int hello3(int a, int b, int c) { return a + b + c; }


x86 assembly (clang, -O0):
<hello3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello3>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hello3(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* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @hello3(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
int imax(int a, int b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <imax+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <imax+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void parse_msg_me_ctcp(const char *origin, const char *nick,
                       const char *hostname, const char *param1,
                       const char *param2, int cmdindex, int *pass) {}


x86 assembly (clang, -O0):
<parse_msg_me_ctcp>:
push   %rbp
mov    %rsp,%rbp
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    %r9d,-0x2c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @parse_msg_me_ctcp(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32 %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i32* %6, i32** %14
ret void
}

LLVM IR (-O2):
define void @parse_msg_me_ctcp(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3, i8* nocapture %4, i32 %5, i32* nocapture %6) {
ret void
}
/* Variables and functions */
double endian_read_double(void *, int /*<<< orphan*/);
double be_read_double(void *ptr) { return endian_read_double(ptr, 0); }


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

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

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

LLVM IR (-O2):
define double @be_read_double(i8* %0) {
%2 = tail call double @endian_read_double(i8* %0, i32 0)
ret double %2
}
double floating_point_message1_signal1_decode(double value) {
  return ((double)value);
}


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

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

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

LLVM IR (-O2):
define double @floating_point_message1_signal1_decode(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ pwm_read(char *, char *, char *, int);
int /*<<< orphan*/ sscanf(char *, char *, unsigned long *);
int pwm_get_period(char *pwm_key, unsigned long *period) {
  if (pwm_key == NULL)
    return -1;
  char value[64];
  pwm_read(pwm_key, "period", value, 64);
  sscanf(value, "%lu", period);
  return 0;
}


x86 assembly (clang, -O0):
<pwm_get_period>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1147 <pwm_get_period+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <pwm_get_period+0x5b>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    0xeaa(%rip),%rsi
mov    $0x40,%ecx
call   1040 <pwm_read@plt>
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <sscanf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwm_get_period>:
test   %rdi,%rdi
je     1162 <pwm_get_period+0x42>
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
lea    0xeca(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdx
mov    $0x40,%ecx
call   1040 <pwm_read@plt>
lea    0xeba(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1030 <sscanf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"period\00"
@.str.1 = [4 x i8] c"%lu\00"
define i32 @pwm_get_period(i8* %0, i64* %1) {
%3 = alloca [64 x i8]
%4 = icmp eq i8* %0, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%7 = call i32 @pwm_read(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6, i32 64)
%8 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %10
}
int foo(int r1, int r2, int r3, int *r4, int *r5, int r6, int *stack1,
        int stack2, int *stack3, int stack4) {
  return r1 + r2 + r3 + *r4 + *r5 + r6 + *stack1 + stack2 + *stack3 + stack4;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
mov    -0x20(%rbp),%rcx
add    (%rcx),%eax
add    -0x24(%rbp),%eax
mov    0x10(%rbp),%rcx
add    (%rcx),%eax
add    0x18(%rbp),%eax
mov    0x20(%rbp),%rcx
add    (%rcx),%eax
add    0x28(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    0x18(%rsp),%r10
mov    0x8(%rsp),%r11
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %r9d,%eax
add    0x10(%rsp),%eax
add    0x20(%rsp),%eax
add    (%rcx),%eax
add    (%r8),%eax
add    (%r11),%eax
add    (%r10),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, i32 %5, i32* %6, i32 %7, i32* %8, i32 %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32
%17 = alloca i32*
%18 = alloca i32
%19 = alloca i32*
%20 = alloca i32
store i32 %0, i32* %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store i32* %3, i32** %14
store i32* %4, i32** %15
store i32 %5, i32* %16
store i32* %6, i32** %17
store i32 %7, i32* %18
store i32* %8, i32** %19
store i32 %9, i32* %20
%21 = load i32, i32* %11
%22 = load i32, i32* %12
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %13
%25 = add nsw i32 %23, %24
%26 = load i32*, i32** %14
%27 = load i32, i32* %26
%28 = add nsw i32 %25, %27
%29 = load i32*, i32** %15
%30 = load i32, i32* %29
%31 = add nsw i32 %28, %30
%32 = load i32, i32* %16
%33 = add nsw i32 %31, %32
%34 = load i32*, i32** %17
%35 = load i32, i32* %34
%36 = add nsw i32 %33, %35
%37 = load i32, i32* %18
%38 = add nsw i32 %36, %37
%39 = load i32*, i32** %19
%40 = load i32, i32* %39
%41 = add nsw i32 %38, %40
%42 = load i32, i32* %20
%43 = add nsw i32 %41, %42
ret i32 %43
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32* nocapture %3, i32* nocapture %4, i32 %5, i32* nocapture %6, i32 %7, i32* nocapture %8, i32 %9) {
%11 = add nsw i32 %1, %0
%12 = add nsw i32 %11, %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %6
%16 = load i32, i32* %8
%17 = add i32 %12, %5
%18 = add i32 %17, %7
%19 = add i32 %18, %9
%20 = add i32 %19, %13
%21 = add i32 %20, %14
%22 = add i32 %21, %15
%23 = add i32 %22, %16
ret i32 %23
}