xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert_in_range_2(int, int);
int /*<<< orphan*/ assert_in_wide_range(int);
int /*<<< orphan*/ clang_analyzer_eval(int);
void greater(int m, int n) {
  assert_in_range_2(m, n);
  if (m >= n)
    return;
  assert_in_wide_range(m - n);
  clang_analyzer_eval(n > m);
}


x86 assembly (clang, -O0):
<greater>:
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   1030 <assert_in_range_2@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     115a <greater+0x2a>
jmp    1178 <greater+0x48>
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1040 <assert_in_wide_range@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greater>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <assert_in_range_2@plt>
sub    %ebp,%ebx
jge    1157 <greater+0x27>
mov    %ebx,%edi
call   1040 <assert_in_wide_range@plt>
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <clang_analyzer_eval@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @greater(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 @assert_in_range_2(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
br label %22
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
%16 = call i32 @assert_in_wide_range(i32 %15)
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = icmp sgt i32 %17, %18
%20 = zext i1 %19 to i32
%21 = call i32 @clang_analyzer_eval(i32 %20)
br label %22
22: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @greater(i32 %0, i32 %1) {
%3 = tail call i32 @assert_in_range_2(i32 %0, i32 %1)
%4 = icmp slt i32 %0, %1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = sub nsw i32 %0, %1
%7 = tail call i32 @assert_in_wide_range(i32 %6)
%8 = tail call i32 @clang_analyzer_eval(i32 1)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
char const *gui_nick_find_color_name(char const *);
const char *plugin_api_info_nick_color_name_cb(const void *pointer, void *data,
                                               const char *info_name,
                                               const char *arguments) {
  (void)pointer;
  (void)data;
  (void)info_name;
  return gui_nick_find_color_name(arguments);
}


x86 assembly (clang, -O0):
<plugin_api_info_nick_color_name_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <gui_nick_find_color_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_info_nick_color_name_cb>:
mov    %rcx,%rdi
jmp    1030 <gui_nick_find_color_name@plt>

LLVM IR (-O0):
define i8* @plugin_api_info_nick_color_name_cb(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i8* @gui_nick_find_color_name(i8* %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @plugin_api_info_nick_color_name_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i8* @gui_nick_find_color_name(i8* %3)
ret i8* %5
}
float __glsl_reflect_f(float I, float N) { return I - 2 * (N * I) * N; }


x86 assembly (clang, -O0):
<__glsl_reflect_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
mulss  -0x4(%rbp),%xmm2
movss  0xedb(%rip),%xmm0
mulss  %xmm2,%xmm0
movss  -0x8(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glsl_reflect_f>:
movaps %xmm0,%xmm2
mulss  %xmm1,%xmm2
mulss  0xef1(%rip),%xmm2
mulss  %xmm1,%xmm2
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @__glsl_reflect_f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = fmul float 2.000000e+00, %8
%10 = load float, float* %4
%11 = fneg float %9
%12 = call float @llvm.fmuladd.f32(float %11, float %10, float %5)
ret float %12
}

LLVM IR (-O2):
define float @__glsl_reflect_f(float %0, float %1) {
%3 = fmul float %0, %1
%4 = fmul float %3, -2.000000e+00
%5 = tail call float @llvm.fmuladd.f32(float %4, float %1, float %0)
ret float %5
}
/* Variables and functions */
scalar_t__ detect_mem_chunks(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void dfi_devmem_exit(void) {
  if (detect_mem_chunks(1))
    do {
      fprintf(stderr, "Warning: memory map has changed\n");
      fflush(stderr);
    } while (0);
}


x86 assembly (clang, -O0):
<dfi_devmem_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <detect_mem_chunks@plt>
cmp    $0x0,%rax
je     1175 <dfi_devmem_exit+0x45>
jmp    114d <dfi_devmem_exit+0x1d>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    1175 <dfi_devmem_exit+0x45>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfi_devmem_exit>:
push   %rbx
mov    $0x1,%edi
call   1030 <detect_mem_chunks@plt>
test   %rax,%rax
je     115d <dfi_devmem_exit+0x2d>
mov    0x2e99(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1050 <fflush@plt>
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Warning: memory map has changed\0A\00"
define void @dfi_devmem_exit() {
%1 = call i64 @detect_mem_chunks(i32 1)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
br label %4
4: ; preds = %3
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 @fflush(i32 %7)
br label %9
9: ; preds = %4
br label %10
10: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Warning: memory map has changed\0A\00"
define void @dfi_devmem_exit() {
%1 = tail call i64 @detect_mem_chunks(i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
br label %8
8: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ combination(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
void main() {
  int n, r;
  printf("Enter N then R from nCr\n");
  scanf("%d%d", &n, &r);
  printf("Value of %dC%d is %ld", n, r, combination(n, r));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <combination@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaa(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    (%rsp),%ebp
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <combination@plt>
lea    0xe8b(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter N then R from nCr\0A\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [22 x i8] c"Value of %dC%d is %ld\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @combination(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6, i32 %9)
ret void
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [22 x i8] c"Value of %dC%d is %ld\00"
@str = [24 x i8] c"Enter N then R from nCr\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @combination(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}
void ssh_glue_write(struct WindRec *tw, unsigned char *st, short cnt) {}


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

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

LLVM IR (-O0):
%struct.WindRec = type opaque
define void @ssh_glue_write(%struct.WindRec* %0, i8* %1, i16 signext %2) {
%4 = alloca %struct.WindRec*
%5 = alloca i8*
%6 = alloca i16
store %struct.WindRec* %0, %struct.WindRec** %4
store i8* %1, i8** %5
store i16 %2, i16* %6
ret void
}

LLVM IR (-O2):
%struct.WindRec = type opaque
define void @ssh_glue_write(%struct.WindRec* nocapture %0, i8* nocapture %1, i16 signext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void warn_user(const char message[]) {
  fprintf(stderr, "WARNING: %s\n", message);
}


x86 assembly (clang, -O0):
<warn_user>:
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):
<warn_user>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"WARNING: %s\0A\00"
define void @warn_user(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 ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"WARNING: %s\0A\00"
define void @warn_user(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ font;
};
typedef TYPE_1__ XTextItem;

/* Variables and functions */
unsigned long get_XTextItem_font(void *_p) {
  return (unsigned long)((XTextItem *)_p)->font;
}


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

x86 assembly (clang, -O2):
<get_XTextItem_font>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @get_XTextItem_font(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void gtk_icon_info_get_builtin_pixbuf() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_info_get_builtin_pixbuf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ se_read_register(int, char *);
int se_read_status(void) {
  char kok[4];
  se_read_register(0x1B4, kok);
  return (0x1234);
}


x86 assembly (clang, -O0):
<se_read_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rsi
mov    $0x1b4,%edi
call   1030 <se_read_register@plt>
mov    $0x1234,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<se_read_status>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x1b4,%edi
call   1030 <se_read_register@plt>
mov    $0x1234,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @se_read_status() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 @se_read_register(i32 436, i8* %2)
ret i32 4660
}

LLVM IR (-O2):
define i32 @se_read_status() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 @se_read_register(i32 436, i8* %2)
ret i32 4660
}
char *cdio_get_default_device_bincue(void) {
  char **drives = cdio_get_devices_nrg();
  char *drive = (drives[0] == ((void *)0)) ? ((void *)0) : strdup(drives[0]);
  cdio_free_device_list(drives);
  return drive;
}


x86 assembly (clang, -O0):
<cdio_get_default_device_bincue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <cdio_get_devices_nrg@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    115e <cdio_get_default_device_bincue+0x2e>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    116e <cdio_get_default_device_bincue+0x3e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <cdio_free_device_list@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdio_get_default_device_bincue>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <cdio_get_devices_nrg@plt>
movslq %eax,%rbx
mov    (%rbx),%rdi
test   %rdi,%rdi
je     1151 <cdio_get_default_device_bincue+0x21>
call   1050 <strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <cdio_free_device_list@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @cdio_get_default_device_bincue() {
%1 = alloca i8**
%2 = alloca i8*
%3 = call i32 (...) @cdio_get_devices_nrg()
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8**
store i8** %5, i8*** %1
%6 = load i8**, i8*** %1
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %0
br label %16
11: ; preds = %0
%12 = load i8**, i8*** %1
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i8* @strdup(i8* %14)
br label %16
16: ; preds = %11, %10
%17 = phi i8* [ null, %10 ], [ %15, %11 ]
store i8* %17, i8** %2
%18 = load i8**, i8*** %1
%19 = call i32 (i8**, ...) bitcast (i32 (...)* @cdio_free_device_list to i32 (i8**, ...)*)(i8** %18)
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @cdio_get_default_device_bincue() {
%1 = tail call i32 (...) @cdio_get_devices_nrg()
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8**
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i8* @strdup(i8* %4)
br label %8
8: ; preds = %0, %6
%9 = phi i8* [ %7, %6 ], [ null, %0 ]
%10 = tail call i32 (i8**, ...) bitcast (i32 (...)* @cdio_free_device_list to i32 (i8**, ...)*)(i8** %3)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ runDriveMotors(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ wait1Msec(int);
void stopDriveMotors() {
  runDriveMotors(0, 0);
  wait1Msec(100);
}


x86 assembly (clang, -O0):
<stopDriveMotors>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1040 <runDriveMotors@plt>
mov    $0x64,%edi
call   1030 <wait1Msec@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopDriveMotors>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <runDriveMotors@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <wait1Msec@plt>

LLVM IR (-O0):
define void @stopDriveMotors() {
%1 = call i32 @runDriveMotors(i32 0, i32 0)
%2 = call i32 @wait1Msec(i32 100)
ret void
}

LLVM IR (-O2):
define void @stopDriveMotors() {
%1 = tail call i32 @runDriveMotors(i32 0, i32 0)
%2 = tail call i32 @wait1Msec(i32 100)
ret void
}
int read_config() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @read_config() {
ret i32 0
}
char *getpass(char *key) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @getpass(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int urandom_get(unsigned char *, size_t const);
int mcfd_random_get(unsigned char *outbuf, const size_t outbuf_size) {
  return urandom_get(outbuf, outbuf_size);
}


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

x86 assembly (clang, -O2):
<mcfd_random_get>:
jmp    1030 <urandom_get@plt>

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

LLVM IR (-O2):
define i32 @mcfd_random_get(i8* %0, i64 %1) {
%3 = tail call i32 @urandom_get(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
char *dirname(char *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void do_dirname(char *path, bool zero) {
  const char *name = dirname(path);
  fputs(name, stdout);
  fputc(zero ? '\0' : '\n', stdout);
}


x86 assembly (clang, -O0):
<do_dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <dirname@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
mov    -0xc(%rbp),%edx
mov    $0xa,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    0x2e6b(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1050 <fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_dirname>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <dirname@plt>
mov    0x2e9e(%rip),%r14
mov    (%r14),%esi
mov    %rax,%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
test   %ebx,%ebx
mov    (%r14),%esi
mov    $0xa,%edi
cmovne %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <fputc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @do_dirname(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i8* @dirname(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* @stdout
%10 = call i32 @fputs(i8* %8, i32 %9)
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 0, i32 10
%15 = trunc i32 %14 to i8
%16 = load i32, i32* @stdout
%17 = call i32 @fputc(i8 signext %15, i32 %16)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @do_dirname(i8* %0, i32 %1) {
%3 = tail call i8* @dirname(i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputs(i8* %3, i32 %4)
%6 = icmp eq i32 %1, 0
%7 = select i1 %6, i8 10, i8 0
%8 = load i32, i32* @stdout
%9 = tail call i32 @fputc(i8 signext %7, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ printf(char *);
int main() {
  NULL;
  f();
  printf("1. Query Information.\n");
  printf("2. Record Information.\n");
  printf("3. Delete Information.\n");
  printf("4. Exit.\n");
  NULL;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"1. Query Information.\0A\00"
@.str.1 = [24 x i8] c"2. Record Information.\0A\00"
@.str.2 = [24 x i8] c"3. Delete Information.\0A\00"
@.str.3 = [10 x i8] c"4. Exit.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"1. Query Information.\00"
@str.4 = [23 x i8] c"2. Record Information.\00"
@str.5 = [23 x i8] c"3. Delete Information.\00"
@str.6 = [9 x i8] c"4. Exit.\00"
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *control();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *mykey = control();
  printf("\nIs it a control key?: %s\n", mykey);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [27 x i8] c"\0AIs it a control key?: %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @control()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
void s_testFunc() { extern int s_i; }


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

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

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

LLVM IR (-O2):
define void @s_testFunc() {
ret void
}
int smc_inw(unsigned int addr) {
  register unsigned short w;
  w = *((volatile unsigned short *)addr);
  return (((w << 8) | (w >> 8)) & 0xffff);
}


x86 assembly (clang, -O0):
<smc_inw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    (%rax),%ax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
shl    $0x8,%eax
movzwl -0x6(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smc_inw>:
mov    %edi,%eax
movzwl (%rax),%eax
rol    $0x8,%ax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @smc_inw(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i16*
%7 = load volatile i16, i16* %6
store i16 %7, i16* %3
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = shl i32 %9, 8
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = or i32 %10, %13
%15 = and i32 %14, 65535
ret i32 %15
}

LLVM IR (-O2):
define i32 @smc_inw(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i16*
%4 = load volatile i16, i16* %3
%5 = tail call i16 @llvm.bswap.i16(i16 %4)
%6 = zext i16 %5 to i32
ret i32 %6
}
int vga_switcheroo_register_audio_client(
    struct pci_dev *pdev, const struct vga_switcheroo_client_ops *ops, int id) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
%struct.vga_switcheroo_client_ops = type opaque
define i32 @vga_switcheroo_register_audio_client(%struct.pci_dev* %0, %struct.vga_switcheroo_client_ops* %1, i32 %2) {
%4 = alloca %struct.pci_dev*
%5 = alloca %struct.vga_switcheroo_client_ops*
%6 = alloca i32
store %struct.pci_dev* %0, %struct.pci_dev** %4
store %struct.vga_switcheroo_client_ops* %1, %struct.vga_switcheroo_client_ops** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
%struct.vga_switcheroo_client_ops = type opaque
define i32 @vga_switcheroo_register_audio_client(%struct.pci_dev* nocapture readnone %0, %struct.vga_switcheroo_client_ops* nocapture readnone %1, i32 %2) {
ret i32 0
}
int test_imm_CCuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xCC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CCuint64_highword_reg>:
movabs $0xcc00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CCuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 876173328384
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void beginTest(void) {
  printf("---------------------------------------------------------------\n");
}


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

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

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

LLVM IR (-O2):
@str = [64 x i8] c"---------------------------------------------------------------\00"
define void @beginTest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double acos(double);
double tosReal_acos(double x) { return acos(x); }


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

x86 assembly (clang, -O2):
<tosReal_acos>:
jmp    1030 <acos@plt>

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

LLVM IR (-O2):
define double @tosReal_acos(double %0) {
%2 = tail call double @acos(double %0)
ret double %2
}
int get(int bit) {
  int i = 0;
  while (++i)
    if (bit & 1)
      return i;
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     113f <get+0x3f>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113a <get+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <get+0x3f>
jmp    110e <get+0xe>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%eax
test   $0x1,%dil
je     1110 <get+0x10>
ret

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

LLVM IR (-O2):
define i32 @get(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %6, %4 ]
%6 = add nuw nsw i32 %5, 1
br i1 %3, label %4, label %7
7: ; preds = %4
ret i32 %6
}
int test_imm_DEuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xDE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DEuint64_midword_reg>:
test   $0xde0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DEuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 14548992
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ busy_loop(void *);
void test3(void *userdata) { busy_loop(userdata); }


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

x86 assembly (clang, -O2):
<test3>:
jmp    1030 <busy_loop@plt>

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

LLVM IR (-O2):
define void @test3(i8* %0) {
%2 = tail call i32 @busy_loop(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void hint(char *prog) {
  printf("Try `%s' --help for more information.\n", prog);
}


x86 assembly (clang, -O0):
<hint>:
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):
<hint>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Try `%s' --help for more information.\0A\00"
define void @hint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Try `%s' --help for more information.\0A\00"
define void @hint(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fseek(int /*<<< orphan*/ *, long, int);
int _sys_fseek(FILE *file, long delta, int origin) {
  return (fseek(file, delta, origin));
}


x86 assembly (clang, -O0):
<_sys_fseek>:
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
call   1030 <fseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sys_fseek>:
jmp    1030 <fseek@plt>

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

LLVM IR (-O2):
define i32 @_sys_fseek(i32* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i32 @fseek(i32* %0, i64 %1, i32 %2)
ret i32 %4
}
int glmMaxIndex3f(float a, float b, float c, int i1, int i2, int i3) {
  if (a > b) {
    if (a > c)
      return i1;
    else
      return i3;
  } else {
    if (b > c)
      return i2;
    else
      return i3;
  }
}


x86 assembly (clang, -O0):
<glmMaxIndex3f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1150 <glmMaxIndex3f+0x50>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1145 <glmMaxIndex3f+0x45>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <glmMaxIndex3f+0x70>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <glmMaxIndex3f+0x70>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    116a <glmMaxIndex3f+0x6a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <glmMaxIndex3f+0x70>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMaxIndex3f>:
ucomiss %xmm2,%xmm0
cmovbe %edx,%edi
ucomiss %xmm2,%xmm1
mov    %esi,%eax
cmovbe %edx,%eax
ucomiss %xmm1,%xmm0
cmova  %edi,%eax
ret

LLVM IR (-O0):
define i32 @glmMaxIndex3f(float %0, float %1, float %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store float %0, float* %8
store float %1, float* %9
store float %2, float* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%14 = load float, float* %8
%15 = load float, float* %9
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %25
17: ; preds = %6
%18 = load float, float* %8
%19 = load float, float* %10
%20 = fcmp ogt float %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load i32, i32* %11
store i32 %22, i32* %7
br label %33
23: ; preds = %17
%24 = load i32, i32* %13
store i32 %24, i32* %7
br label %33
25: ; preds = %6
%26 = load float, float* %9
%27 = load float, float* %10
%28 = fcmp ogt float %26, %27
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = load i32, i32* %12
store i32 %30, i32* %7
br label %33
31: ; preds = %25
%32 = load i32, i32* %13
store i32 %32, i32* %7
br label %33
33: ; preds = %31, %29, %23, %21
%34 = load i32, i32* %7
ret i32 %34
}

LLVM IR (-O2):
define i32 @glmMaxIndex3f(float %0, float %1, float %2, i32 %3, i32 %4, i32 %5) {
%7 = fcmp ogt float %0, %1
%8 = fcmp ogt float %0, %2
%9 = select i1 %8, i32 %3, i32 %5
%10 = fcmp ogt float %1, %2
%11 = select i1 %10, i32 %4, i32 %5
%12 = select i1 %7, i32 %9, i32 %11
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ opt;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
int mill_tcptune(int s) {
  int opt = 1;
  (void)setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
  return 0;
}


x86 assembly (clang, -O0):
<mill_tcptune>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mill_tcptune>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @mill_tcptune(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret i32 0
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @mill_tcptune(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 0
}
double cos(x)
double x;
{
  if (x < 0)
    x = -x;
  return sinus(x, 1);
}


x86 assembly (clang, -O0):
<cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    114c <cos+0x3c>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
mov    $0x1,%al
call   1030 <sinus@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos>:
push   %rax
movapd 0xee7(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
mov    $0x1,%edi
mov    $0x1,%al
call   1030 <sinus@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
%10 = call i32 (double, i32, ...) bitcast (i32 (...)* @sinus to i32 (double, i32, ...)*)(double %9, i32 1)
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @cos(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = tail call i32 (double, i32, ...) bitcast (i32 (...)* @sinus to i32 (double, i32, ...)*)(double %4, i32 1)
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
size_t malloc_usable_size(void *);
int /*<<< orphan*/ memset(void *, int, size_t);
void init(void *ptr) {
  if (ptr) {
    size_t asz = malloc_usable_size(ptr);
    memset(ptr, 0xDD, asz);
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <init+0x36>
mov    -0x8(%rbp),%rdi
call   1040 <malloc_usable_size@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xdd,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
test   %rdi,%rdi
je     113f <init+0x1f>
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc_usable_size@plt>
mov    %rbx,%rdi
mov    $0xdd,%esi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <memset@plt>
ret

LLVM IR (-O0):
define void @init(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @malloc_usable_size(i8* %7)
store i64 %8, i64* %3
%9 = load i8*, i8** %2
%10 = load i64, i64* %3
%11 = call i32 @memset(i8* %9, i32 221, i64 %10)
br label %12
12: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @init(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @malloc_usable_size(i8* %0)
%5 = tail call i32 @memset(i8* %0, i32 221, i64 %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void sends(int sock, char *buf) { write(sock, buf, strlen(buf)); }


x86 assembly (clang, -O0):
<sends>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sends>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @sends(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @sends(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}
int test_imm_CBint32_reg(int val) { return ((val) & (0xCB << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_CBint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xcb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_CBint32_reg(i32 %0) {
%2 = and i32 %0, 203
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
bool nrf52_errata_198(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_198() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int nextch(FILE *in) {
  int ch = getc(in);
  ungetc(ch, in);
  return ch;
}


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

x86 assembly (clang, -O2):
<nextch>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <getc@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nextch(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @ungetc(i32 %6, i32* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @nextch(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @ungetc(i32 %2, i32* %0)
ret i32 %2
}
/* Variables and functions */
int create_dlink();
int create_dlink_queue() { return create_dlink(); }


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

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

LLVM IR (-O0):
define i32 @create_dlink_queue() {
%1 = call i32 (...) @create_dlink()
ret i32 %1
}

LLVM IR (-O2):
define i32 @create_dlink_queue() {
%1 = tail call i32 (...) @create_dlink()
ret i32 %1
}
long long fi5(long long j, int *b, int i) { return j + b[i]; }


x86 assembly (clang, -O0):
<fi5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi5>:
movslq %edx,%rax
movslq (%rsi,%rax,4),%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @fi5(i64 %0, i32* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32
store i64 %0, i64* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = add nsw i64 %7, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @fi5(i64 %0, i32* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = add nsw i64 %7, %0
ret i64 %8
}