xunge/DecIR huggingface dataset:
void g_string_equal() {}


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

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

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

LLVM IR (-O2):
define void @g_string_equal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; ++i) {
    printf("argv[%d]:|%s|\n", i, argv[i]);
  }
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"argv[%d]:|%s|\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sort_r_swap(char *, char *, size_t);
int sort_r_cmpswap(char *__restrict a, char *__restrict b, size_t w,
                   int (*compar)(const void *_a, const void *_b, void *_arg),
                   void *arg) {
  if (compar(a, b, arg) > 0) {
    sort_r_swap(a, b, w);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sort_r_cmpswap>:
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    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   *%rax
cmp    $0x0,%eax
jle    1164 <sort_r_cmpswap+0x54>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <sort_r_swap@plt>
movl   $0x1,-0x4(%rbp)
jmp    116b <sort_r_cmpswap+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_r_cmpswap>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %r8,%rdx
call   *%rcx
test   %eax,%eax
jle    113c <sort_r_cmpswap+0x2c>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <sort_r_swap@plt>
mov    $0x1,%eax
jmp    113e <sort_r_cmpswap+0x2e>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @sort_r_cmpswap(i8* noalias %0, i8* noalias %1, i64 %2, i32 (i8*, i8*, i8*)* nocapture %3, i8* %4) {
%6 = tail call i32 %3(i8* %0, i8* %1, i8* %4)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @sort_r_swap(i8* %0, i8* %1, i64 %2)
br label %10
10: ; preds = %5, %8
%11 = phi i32 [ 1, %8 ], [ 0, %5 ]
ret i32 %11
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XClientMessageEvent;

/* Variables and functions */
void set_XClientMessageEvent_send_event(void *_p, int _v) {
  ((XClientMessageEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XClientMessageEvent_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XClientMessageEvent_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XClientMessageEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
float tanf(float);
float intr_wrap_078(float p1) { return tanf(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_078>:
jmp    1030 <tanf@plt>

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

LLVM IR (-O2):
define float @intr_wrap_078(float %0) {
%2 = tail call float @tanf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ SYS_chmod;
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int syscall(int /*<<< orphan*/, char *, int);
int main() {
  int rc;
  rc = syscall(SYS_chmod, "file.txt", 0444);
  if (rc == -1) {
    fprintf(stderr, "chmod failed, errno = %d\n", errno);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
mov    $0x124,%edx
call   1040 <syscall@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1174 <main+0x54>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    0x2e72(%rip),%rax
mov    (%rax),%edx
lea    0xe9a(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
mov    $0x124,%edx
call   1040 <syscall@plt>
cmp    $0xffffffff,%eax
jne    115e <main+0x3e>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SYS_chmod = global i32 0
@.str = [9 x i8] c"file.txt\00"
@stderr = global i32 0
@.str.1 = [26 x i8] c"chmod failed, errno = %d\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @SYS_chmod
%4 = call i32 @syscall(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 292)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* @stderr
%9 = load i32, i32* @errno
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@SYS_chmod = global i32 0
@.str = [9 x i8] c"file.txt\00"
@stderr = global i32 0
@.str.1 = [26 x i8] c"chmod failed, errno = %d\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = load i32, i32* @SYS_chmod
%2 = tail call i32 @syscall(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 292)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int dialog_msgbox(char const *, char *, int /*<<< orphan*/, int /*<<< orphan*/,
                  int /*<<< orphan*/);
int /*<<< orphan*/ numeric_arg(char **, int);
int call_infobox(const char *t, char *av[], int *offset_add) {
  *offset_add = 4;
  return dialog_msgbox(t, av[1], numeric_arg(av, 2), numeric_arg(av, 3), 0);
}


x86 assembly (clang, -O0):
<call_infobox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <numeric_arg@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1040 <numeric_arg@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <dialog_msgbox@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_infobox>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movl   $0x4,(%rdx)
mov    0x8(%rsi),%r15
mov    %rsi,%rdi
mov    $0x2,%esi
call   1040 <numeric_arg@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <numeric_arg@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <dialog_msgbox@plt>

LLVM IR (-O0):
define i32 @call_infobox(i8* %0, i8** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
store i32 4, i32* %7
%8 = load i8*, i8** %4
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = call i32 @numeric_arg(i8** %12, i32 2)
%14 = load i8**, i8*** %5
%15 = call i32 @numeric_arg(i8** %14, i32 3)
%16 = call i32 @dialog_msgbox(i8* %8, i8* %11, i32 %13, i32 %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
define i32 @call_infobox(i8* %0, i8** %1, i32* nocapture writeonly %2) {
store i32 4, i32* %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @numeric_arg(i8** %1, i32 2)
%7 = tail call i32 @numeric_arg(i8** %1, i32 3)
%8 = tail call i32 @dialog_msgbox(i8* %0, i8* %5, i32 %6, i32 %7, i32 0)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int stdout_write(int16_t **bf, int *nbf) {
  return fwrite(*bf, 1, *nbf, stdout);
}


x86 assembly (clang, -O0):
<stdout_write>:
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),%edx
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdout_write>:
mov    (%rdi),%rdi
mov    (%rsi),%edx
mov    0x2ec4(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @stdout_write(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** %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32, i32* @stdout
%10 = call i32 @fwrite(i32* %6, i32 1, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @stdout_write(i32** nocapture %0, i32* nocapture %1) {
%3 = load i32*, i32** %0
%4 = load i32, i32* %1
%5 = load i32, i32* @stdout
%6 = tail call i32 @fwrite(i32* %3, i32 1, i32 %4, i32 %5)
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int y;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmotion_y(void *_p, int _v) {
  ((XEvent *)_p)->xmotion.y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xmotion_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xmotion_y(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xmotion_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int main(int argc, char **argv) { return 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_any(char const *, int, char const *);
void log_fatal(const char *type, int code, const char *msg) {
  log_any(type, code, msg);
}


x86 assembly (clang, -O0):
<log_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <log_any@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_fatal>:
jmp    1030 <log_any@plt>

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

LLVM IR (-O2):
define void @log_fatal(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @log_any(i8* %0, i32 %1, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ LEN_SQUARED_3FV(int /*<<< orphan*/ const *);
int /*<<< orphan*/ sqrtf(int /*<<< orphan*/);
GLfloat LEN_3FV(const GLfloat v[3]) { return sqrtf(LEN_SQUARED_3FV(v)); }


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

x86 assembly (clang, -O2):
<LEN_3FV>:
push   %rax
call   1030 <LEN_SQUARED_3FV@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrtf@plt>

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

LLVM IR (-O2):
define i32 @LEN_3FV(i32* %0) {
%2 = tail call i32 @LEN_SQUARED_3FV(i32* %0)
%3 = tail call i32 @sqrtf(i32 %2)
ret i32 %3
}
int GetG(int i, int j) { return i / 3 * 3 + j / 3; }


x86 assembly (clang, -O0):
<GetG>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetG>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%ecx
movslq %esi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @GetG(i32 %0, i32 %1) {
%3 = srem i32 %0, 3
%4 = sub i32 %0, %3
%5 = sdiv i32 %1, 3
%6 = add nsw i32 %4, %5
ret i32 %6
}
int grantpt(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @grantpt(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ string_append(int, char *, char *);
void handle_ti(int which, int part, char *model_string) {
  switch (part) {
  case 0x915:
    string_append(which, "OMAP", model_string);
    break;
  default:
    string_append(which, "Unknown", model_string);
    break;
  }
}


x86 assembly (clang, -O0):
<handle_ti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x915,%eax
jne    114d <handle_ti+0x3d>
jmp    1135 <handle_ti+0x25>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <string_append@plt>
jmp    1160 <handle_ti+0x50>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xeaa(%rip),%rsi
call   1030 <string_append@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_ti>:
cmp    $0x915,%esi
lea    0xee3(%rip),%rax
lea    0xee1(%rip),%rsi
cmove  %rax,%rsi
jmp    1030 <string_append@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"OMAP\00"
@.str.1 = [8 x i8] c"Unknown\00"
define void @handle_ti(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 2325
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @string_append(i32 %0, i8* %5, i8* %2)
ret void
}
int test_imm_2Aint16_mem(short *val) {
  return ((*val) & (0x2A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Aint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x2a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_2Aint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 42
%7 = icmp ne i32 %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_2Aint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 42
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int isinf(double value) {
  return ({
    extern __typeof__(isinf) module_libc_isinf;
    &module_libc_isinf;
  })(value);
}


x86 assembly (clang, -O0):
<isinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ecc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf>:
jmp    1030 <module_libc_isinf@plt>

LLVM IR (-O0):
define i32 @isinf(double %0) {
%2 = alloca double
%3 = alloca i32 (double)*
store double %0, double* %2
store i32 (double)* @module_libc_isinf, i32 (double)** %3
%4 = load i32 (double)*, i32 (double)** %3
%5 = load double, double* %2
%6 = call i32 %4(double %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @isinf(double %0) {
%2 = tail call i32 @module_libc_isinf(double %0)
ret i32 %2
}
float LocalSdrTime(float lday, float lLNG, int lUT) {
  return 100.46 + 0.985647 * lday + lLNG + 15 * lUT;
}


x86 assembly (clang, -O0):
<LocalSdrTime>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
imul   $0xf,-0xc(%rbp),%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LocalSdrTime>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtss2sd %xmm1,%xmm1
lea    (%rdi,%rdi,4),%eax
lea    (%rax,%rax,2),%eax
cvtsi2sd %eax,%xmm2
addsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @LocalSdrTime(float %0, float %1, i32 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store float %0, float* %4
store float %1, float* %5
store i32 %2, i32* %6
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = call double @llvm.fmuladd.f64(double 9.856470e-01, double %8, double 1.004600e+02)
%10 = load float, float* %5
%11 = fpext float %10 to double
%12 = fadd double %9, %11
%13 = load i32, i32* %6
%14 = mul nsw i32 15, %13
%15 = sitofp i32 %14 to double
%16 = fadd double %12, %15
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
define float @LocalSdrTime(float %0, float %1, i32 %2) {
%4 = fpext float %0 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 9.856470e-01, double 1.004600e+02)
%6 = fpext float %1 to double
%7 = fadd double %5, %6
%8 = mul nsw i32 %2, 15
%9 = sitofp i32 %8 to double
%10 = fadd double %7, %9
%11 = fptrunc double %10 to float
ret float %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct tcphdr {
  int /*<<< orphan*/ dest;
};

/* Variables and functions */
uint16_t _tcphdr_dest(struct tcphdr *h) { return h->dest; }


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

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

LLVM IR (-O0):
%struct.tcphdr = type { i32 }
define i32 @_tcphdr_dest(%struct.tcphdr* %0) {
%2 = alloca %struct.tcphdr*
store %struct.tcphdr* %0, %struct.tcphdr** %2
%3 = load %struct.tcphdr*, %struct.tcphdr** %2
%4 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
define i32 @_tcphdr_dest(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int twice(int i) { return 2 * i; }


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

x86 assembly (clang, -O2):
<twice>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @twice(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void simulator_pthread_init(void) {}


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

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

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

LLVM IR (-O2):
define void @simulator_pthread_init() {
ret void
}
int comparefunc(const void *arg1, const void *arg2) {
  const int x = *(const int *)arg1;
  const int y = *(const int *)arg2;
  return x - y;
}


x86 assembly (clang, -O0):
<comparefunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @comparefunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @comparefunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void Debug(int val, char *a, ...) {}


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

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

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

LLVM IR (-O2):
define void @Debug(i32 %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void pass_str(char *str) { printf("got a string:%s\n", str); }


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"got a string:%s\0A\00"
define void @pass_str(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int iswgraph(wint_t wc) {
  return (wc >= 0 && wc < 128 ? wc >= '!' && wc <= '~' : 1);
}


x86 assembly (clang, -O0):
<iswgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1147 <iswgraph+0x47>
cmpl   $0x80,-0x4(%rbp)
jge    1147 <iswgraph+0x47>
xor    %eax,%eax
cmpl   $0x21,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1137 <iswgraph+0x37>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <iswgraph+0x54>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <iswgraph+0x54>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswgraph>:
cmp    $0x21,%edi
setge  %al
cmp    $0x7f,%edi
seta   %cl
setne  %dl
and    %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @iswgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %17
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 128
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 33
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 126
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
br label %18
17: ; preds = %5, %1
br label %18
18: ; preds = %17, %14
%19 = phi i32 [ %16, %14 ], [ 1, %17 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @iswgraph(i32 %0) {
%2 = icmp ugt i32 %0, 127
%3 = icmp sgt i32 %0, 32
%4 = icmp ne i32 %0, 127
%5 = and i1 %3, %4
%6 = or i1 %2, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ dma_enqueue_operation(void *, void *, unsigned int,
                                         int /*<<< orphan*/, int);
int /*<<< orphan*/ dma_execute_queue();
void dma_memcpy_32(void *src, void *dst, unsigned int size) {
  dma_enqueue_operation(src, dst, size, 0, (1 << 8) | (1 << 4));
  dma_execute_queue();
}


x86 assembly (clang, -O0):
<dma_memcpy_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
mov    $0x110,%r8d
call   1030 <dma_enqueue_operation@plt>
mov    $0x0,%al
call   1040 <dma_execute_queue@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dma_memcpy_32>:
push   %rax
xor    %ecx,%ecx
mov    $0x110,%r8d
call   1030 <dma_enqueue_operation@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <dma_execute_queue@plt>

LLVM IR (-O0):
define void @dma_memcpy_32(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @dma_enqueue_operation(i8* %7, i8* %8, i32 %9, i32 0, i32 272)
%11 = call i32 (...) @dma_execute_queue()
ret void
}

LLVM IR (-O2):
define void @dma_memcpy_32(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @dma_enqueue_operation(i8* %0, i8* %1, i32 %2, i32 0, i32 272)
%5 = tail call i32 (...) @dma_execute_queue()
ret void
}
int baz() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @baz() {
ret i32 0
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, struct timezone *);
double mysecond() {
  struct timeval tp;
  struct timezone tzp;
  int i;
  i = gettimeofday(&tp, &tzp);
  return ((double)tp.tv_sec + (double)tp.tv_usec * 1.e-6);
}


x86 assembly (clang, -O0):
<mysecond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    %eax,-0x1c(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysecond>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xec9(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @mysecond() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = alloca i32
%4 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
store i32 %4, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @mysecond() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %8)
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void version() {
  fprintf(stderr, "Compress utility, Berkeley 5.9 5/11/86\n");
  fprintf(stderr, "Options: ");
  fprintf(stderr, "BITS = %d\n", 16);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x10,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef1(%rip),%rsi
mov    $0x10,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Compress utility, Berkeley 5.9 5/11/86\0A\00"
@.str.1 = [10 x i8] c"Options: \00"
@.str.2 = [11 x i8] c"BITS = %d\0A\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 16)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Compress utility, Berkeley 5.9 5/11/86\0A\00"
@.str.1 = [10 x i8] c"Options: \00"
@.str.2 = [11 x i8] c"BITS = %d\0A\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prtstr(int, char *, char *, char *);
void main_start() {
  prtstr(3, "static void activate(GtkApplication *", "app",
         ", gpointer user_data)\n{\n");
}


x86 assembly (clang, -O0):
<main_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
lea    0xee0(%rip),%rsi
lea    0xeff(%rip),%rdx
lea    0xefc(%rip),%rcx
call   1030 <prtstr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_start>:
lea    0xee9(%rip),%rsi
lea    0xf08(%rip),%rdx
lea    0xf05(%rip),%rcx
mov    $0x3,%edi
jmp    1030 <prtstr@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"static void activate(GtkApplication *\00"
@.str.1 = [4 x i8] c"app\00"
@.str.2 = [25 x i8] c", gpointer user_data)\0A{\0A\00"
define void @main_start() {
%1 = call i32 @prtstr(i32 3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"static void activate(GtkApplication *\00"
@.str.1 = [4 x i8] c"app\00"
@.str.2 = [25 x i8] c", gpointer user_data)\0A{\0A\00"
define void @main_start() {
%1 = tail call i32 @prtstr(i32 3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(unsigned char, int /*<<< orphan*/ *);
void cas_write_block_header(FILE *out, int blocksize, unsigned short addr) {
  unsigned char a;
  fputc(0x3c, out);
  a = blocksize;
  fputc(blocksize, out);
  a = addr & 0xFF;
  fputc(a, out);
  a = addr >> 8;
  fputc(a, out);
}


x86 assembly (clang, -O0):
<cas_write_block_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x3c,%edi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%eax
mov    %al,-0xf(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rsi
movzbl %al,%edi
call   1030 <fputc@plt>
movzwl -0xe(%rbp),%eax
and    $0xff,%eax
mov    %al,-0xf(%rbp)
mov    -0xf(%rbp),%al
mov    -0x8(%rbp),%rsi
movzbl %al,%edi
call   1030 <fputc@plt>
movzwl -0xe(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0xf(%rbp)
mov    -0xf(%rbp),%al
mov    -0x8(%rbp),%rsi
movzbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cas_write_block_header>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    $0x3c,%edi
mov    %rbp,%rsi
call   1030 <fputc@plt>
movzbl %r14b,%edi
mov    %rbp,%rsi
call   1030 <fputc@plt>
movzbl %bl,%edi
mov    %rbp,%rsi
call   1030 <fputc@plt>
shr    $0x8,%ebx
mov    %ebx,%edi
mov    %rbp,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @cas_write_block_header(i32* %0, i32 %1, i16 zeroext %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i16
%7 = alloca i8
store i32* %0, i32** %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%8 = load i32*, i32** %4
%9 = call i32 @fputc(i8 zeroext 60, i32* %8)
%10 = load i32, i32* %5
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
%12 = load i32, i32* %5
%13 = trunc i32 %12 to i8
%14 = load i32*, i32** %4
%15 = call i32 @fputc(i8 zeroext %13, i32* %14)
%16 = load i16, i16* %6
%17 = zext i16 %16 to i32
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = load i32*, i32** %4
%22 = call i32 @fputc(i8 zeroext %20, i32* %21)
%23 = load i16, i16* %6
%24 = zext i16 %23 to i32
%25 = ashr i32 %24, 8
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i32*, i32** %4
%29 = call i32 @fputc(i8 zeroext %27, i32* %28)
ret void
}

LLVM IR (-O2):
define void @cas_write_block_header(i32* nocapture %0, i32 %1, i16 zeroext %2) {
%4 = tail call i32 @fputc(i8 zeroext 60, i32* %0)
%5 = trunc i32 %1 to i8
%6 = tail call i32 @fputc(i8 zeroext %5, i32* %0)
%7 = trunc i16 %2 to i8
%8 = tail call i32 @fputc(i8 zeroext %7, i32* %0)
%9 = lshr i16 %2, 8
%10 = trunc i16 %9 to i8
%11 = tail call i32 @fputc(i8 zeroext %10, i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isxdigit(int ch) {
  return (ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66) ||
         isdigit(ch);
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1134 <isxdigit+0x24>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    115f <isxdigit+0x4f>
cmpl   $0x61,-0x4(%rbp)
jl     114d <isxdigit+0x3d>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    115f <isxdigit+0x4f>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x41(%rdi),%ecx
cmp    $0x25,%ecx
ja     112e <isxdigit+0x1e>
mov    $0x1,%eax
movabs $0x3f0000003f,%rdx
bt     %rcx,%rdx
jae    112e <isxdigit+0x1e>
ret
push   %rax
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 70
br i1 %7, label %18, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 102
br i1 %13, label %18, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = call i64 @isdigit(i32 %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %14, %11, %5
%19 = phi i1 [ true, %11 ], [ true, %5 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
switch i32 %0, label %2 [
i32 102, label %6
i32 101, label %6
i32 100, label %6
i32 99, label %6
i32 98, label %6
i32 97, label %6
i32 70, label %6
i32 69, label %6
i32 68, label %6
i32 67, label %6
i32 66, label %6
i32 65, label %6
]
2: ; preds = %1
%3 = tail call i64 @isdigit(i32 %0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%7 = phi i32 [ %5, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %7
}
int fib(int n) {
  if (n <= 1) {
    return n;
  }
  return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1130 <fib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib+0x10>
mov    %ebx,%ecx
jmp    1144 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Type definitions */
struct demod_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ selcall_deinit(struct demod_state *);
void zvei3_deinit(struct demod_state *s) { selcall_deinit(s); }


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

x86 assembly (clang, -O2):
<zvei3_deinit>:
jmp    1030 <selcall_deinit@plt>

LLVM IR (-O0):
%struct.demod_state = type { i32 }
define void @zvei3_deinit(%struct.demod_state* %0) {
%2 = alloca %struct.demod_state*
store %struct.demod_state* %0, %struct.demod_state** %2
%3 = load %struct.demod_state*, %struct.demod_state** %2
%4 = call i32 @selcall_deinit(%struct.demod_state* %3)
ret void
}

LLVM IR (-O2):
%struct.demod_state = type { i32 }
define void @zvei3_deinit(%struct.demod_state* %0) {
%2 = tail call i32 @selcall_deinit(%struct.demod_state* %0)
ret void
}
/* Variables and functions */
int pow_int(int, int);
int digit(int digit_number, int num) {
  num /= pow_int(10, digit_number);
  num %= pow_int(10, 2);
  return num;
}


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xa,%edi
call   1030 <pow_int@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    $0xa,%edi
mov    $0x2,%esi
call   1030 <pow_int@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0xa,%edi
call   1030 <pow_int@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%ebx
mov    $0xa,%edi
mov    $0x2,%esi
call   1030 <pow_int@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @digit(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 = call i32 @pow_int(i32 10, i32 %5)
%7 = load i32, i32* %4
%8 = sdiv i32 %7, %6
store i32 %8, i32* %4
%9 = call i32 @pow_int(i32 10, i32 2)
%10 = load i32, i32* %4
%11 = srem i32 %10, %9
store i32 %11, i32* %4
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @digit(i32 %0, i32 %1) {
%3 = tail call i32 @pow_int(i32 10, i32 %0)
%4 = sdiv i32 %1, %3
%5 = tail call i32 @pow_int(i32 10, i32 2)
%6 = srem i32 %4, %5
ret i32 %6
}