xunge/DecIR huggingface dataset:
/* Variables and functions */
#define _SC_CLK_TCK 129
#define _SC_PAGESIZE 128
int /*<<< orphan*/ printf(char *);
long sysconf(int name) {
  switch (name) {
  case _SC_PAGESIZE:
    return 4096;
  case _SC_CLK_TCK:
    printf("i was called.\n");
    return 100;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sysconf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80,%eax
je     1144 <sysconf+0x34>
jmp    1131 <sysconf+0x21>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
je     1151 <sysconf+0x41>
jmp    116a <sysconf+0x5a>
movq   $0x1000,-0x8(%rbp)
jmp    1172 <sysconf+0x62>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
movq   $0x64,-0x8(%rbp)
jmp    1172 <sysconf+0x62>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysconf>:
cmp    $0x80,%edi
je     1137 <sysconf+0x27>
cmp    $0x81,%edi
jne    113d <sysconf+0x2d>
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%eax
add    $0x8,%rsp
ret
mov    $0x1000,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"i was called.\0A\00"
define i64 @sysconf(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 128, label %5
i32 129, label %6
]
5: ; preds = %1
store i64 4096, i64* %2
br label %9
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i64 100, i64* %2
br label %9
8: ; preds = %1
store i64 0, i64* %2
br label %9
9: ; preds = %8, %6, %5
%10 = load i64, i64* %2
ret i64 %10
}

LLVM IR (-O2):
@str = [14 x i8] c"i was called.\00"
define i64 @sysconf(i32 %0) {
switch i32 %0, label %4 [
i32 128, label %5
i32 129, label %2
]
2: ; preds = %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %2
%6 = phi i64 [ 0, %4 ], [ 100, %2 ], [ 4096, %1 ]
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_scanning(const char *filename) { printf("SUMMARY: %s\n", filename); }


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

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

LLVM IR (-O2):
@.str = [13 x i8] c"SUMMARY: %s\0A\00"
define void @print_scanning(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_OK;
int nolockLock(sqlite3_file *NotUsed, int NotUsed2) {
  (void)(NotUsed), (void)(NotUsed2);
  return SQLITE_OK;
}


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

x86 assembly (clang, -O2):
<nolockLock>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SQLITE_OK = global i32 0
define i32 @nolockLock(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 = load i32, i32* @SQLITE_OK
ret i32 %7
}

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @nolockLock(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @SQLITE_OK
ret i32 %3
}
void mx_strvec_free(char **strvec) {
  char **sv;
  if (!strvec)
    return;
  for (sv = strvec; *sv; sv++) {
    free(*sv);
  }
  free(strvec);
}


x86 assembly (clang, -O0):
<mx_strvec_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <mx_strvec_free+0x1c>
jmp    1168 <mx_strvec_free+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115f <mx_strvec_free+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <mx_strvec_free+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mx_strvec_free>:
test   %rdi,%rdi
je     1150 <mx_strvec_free+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <mx_strvec_free+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <mx_strvec_free+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @mx_strvec_free(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
tail call void @free(i8* %7)
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
br label %14
14: ; preds = %1, %12
ret void
}
void nonzeroPaddedUnionMemset() {
  union U {
    char c;
    int i;
  };
  union U arr[9] = {
      0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
  };
}


x86 assembly (clang, -O0):
<nonzeroPaddedUnionMemset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
mov    $0xf0,%esi
mov    $0x24,%edx
call   1030 <memset@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.U = type { i32 }
define void @nonzeroPaddedUnionMemset() {
%1 = alloca [9 x %union.U]
%2 = bitcast [9 x %union.U]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @nonzeroPaddedUnionMemset() {
ret void
}
/* Variables and functions */
char *gu_str_advance(char const *, int);
size_t strtoul(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
size_t gu_str_table_get_n_cols(const char *str) {
  str = gu_str_advance(str, 1);
  return strtoul(str, NULL, 0);
}


x86 assembly (clang, -O0):
<gu_str_table_get_n_cols>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <gu_str_advance@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gu_str_table_get_n_cols>:
push   %rax
mov    $0x1,%esi
call   1030 <gu_str_advance@plt>
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <strtoul@plt>

LLVM IR (-O0):
define i64 @gu_str_table_get_n_cols(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @gu_str_advance(i8* %3, i32 1)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strtoul(i8* %5, i32* null, i32 0)
ret i64 %6
}

LLVM IR (-O2):
define i64 @gu_str_table_get_n_cols(i8* %0) {
%2 = tail call i8* @gu_str_advance(i8* %0, i32 1)
%3 = tail call i64 @strtoul(i8* nocapture %2, i32* null, i32 0)
ret i64 %3
}
/* Variables and functions */
double convertKlnTemp(int);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  int n;
  for (n = 33; n < 175; n++)
    printf("\nKtemp %d = degC %3.0f", n, convertKlnTemp(n));
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x21,-0x4(%rbp)
cmpl   $0xaf,-0x4(%rbp)
jge    1169 <main+0x49>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <convertKlnTemp@plt>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <main+0xf>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x21,%ebx
lea    0xec0(%rip),%r14
mov    %ebx,%edi
call   1050 <convertKlnTemp@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0xaf,%ebx
jne    1140 <main+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\0AKtemp %d = degC %3.0f\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
store i32 33, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 175
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* %1
%8 = call double @convertKlnTemp(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6, double %8)
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AKtemp %d = degC %3.0f\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 33, %0 ], [ %5, %1 ]
%3 = tail call double @convertKlnTemp(i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2, double %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 175
br i1 %6, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int __rat_opt_pi_set_flag(int *flag, uint8_t *data, uint16_t len) {
  do {
  } while (0);
  if (len < sizeof(int))
    return -1;
  *flag = *((int *)data) ? 1 : 0;
  return 0;
}


x86 assembly (clang, -O0):
<__rat_opt_pi_set_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
jmp    1114 <__rat_opt_pi_set_flag+0x14>
movslq -0x1c(%rbp),%rax
cmp    $0x4,%rax
jae    112e <__rat_opt_pi_set_flag+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <__rat_opt_pi_set_flag+0x4e>
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%edx
cmovne %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rat_opt_pi_set_flag>:
mov    $0xffffffff,%eax
cmp    $0x4,%edx
jb     1116 <__rat_opt_pi_set_flag+0x16>
xor    %eax,%eax
cmpl   $0x0,(%rsi)
setne  %al
mov    %eax,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @__rat_opt_pi_set_flag(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = icmp ult i32 %2, 4
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %0
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ 0, %5 ], [ -1, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ EDOM;
int /*<<< orphan*/ errno;
double sqrtf(double);
double sqrt(double value) {
  if (value < 0.0) {
    errno = EDOM;
    return 0.0;
  }
  return sqrtf(value);
}


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114a <sqrt+0x3a>
mov    0x2eb6(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9d(%rip),%rax
mov    %ecx,(%rax)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1159 <sqrt+0x49>
movsd  -0x10(%rbp),%xmm0
call   1030 <sqrtf@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <sqrt+0x21>
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
mov    0x2eaa(%rip),%rcx
mov    %eax,(%rcx)
ret
ucomisd %xmm0,%xmm1
jb     113f <sqrt+0x2f>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
ret
movapd %xmm1,%xmm0
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
@EDOM = global i32 0
@errno = global i32 0
define double @sqrt(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @EDOM
store i32 %4, i32* @errno
br label %7
5: ; preds = %1
%6 = tail call double @sqrtf(double %0)
br label %7
7: ; preds = %5, %3
%8 = phi double [ 0.000000e+00, %3 ], [ %6, %5 ]
ret double %8
}
int test_imm_18uint16_reg(unsigned short val) {
  return ((val) & (0x18 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_18uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x18,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_18uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 24
%6 = icmp ne i32 %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_18uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 24
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int O_CREAT;
int O_RDONLY;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int open(char const *, int, int);
int File_openRead(const char *str) {
  int f = O_CREAT | O_RDONLY;
  mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
  return open(str, f, mode);
}


x86 assembly (clang, -O0):
<File_openRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
mov    0x2eb4(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
mov    0x2e97(%rip),%rcx
or     (%rcx),%eax
mov    0x2e7e(%rip),%rcx
or     (%rcx),%eax
mov    0x2e6d(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<File_openRead>:
mov    0x2ee1(%rip),%rax
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e8f(%rip),%rax
mov    0x2ea8(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2e8d(%rip),%rax
or     (%rax),%edx
mov    0x2e7c(%rip),%rax
or     (%rax),%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_RDONLY = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
define i32 @File_openRead(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i32, i32* @O_CREAT
%6 = load i32, i32* @O_RDONLY
%7 = or i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* @S_IRUSR
%9 = load i32, i32* @S_IWUSR
%10 = or i32 %8, %9
%11 = load i32, i32* @S_IRGRP
%12 = or i32 %10, %11
%13 = load i32, i32* @S_IROTH
%14 = or i32 %12, %13
store i32 %14, i32* %4
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i32 @open(i8* %15, i32 %16, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_RDONLY = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
define i32 @File_openRead(i8* nocapture %0) {
%2 = load i32, i32* @O_CREAT
%3 = load i32, i32* @O_RDONLY
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IRUSR
%6 = load i32, i32* @S_IWUSR
%7 = or i32 %6, %5
%8 = load i32, i32* @S_IRGRP
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IROTH
%11 = or i32 %9, %10
%12 = tail call i32 @open(i8* %0, i32 %4, i32 %11)
ret i32 %12
}
/* Variables and functions */
scalar_t__ RAND_MAX;
float rand();
bool biaised_random(float coef) {
  float val;
  val = rand() / (float)RAND_MAX * (1.f / coef);
  return val < 1.f;
}


x86 assembly (clang, -O0):
<biaised_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ebd(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  0xec4(%rip),%xmm1
divss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeae(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biaised_random>:
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec2(%rip),%rax
cvtsi2ssq (%rax),%xmm1
movaps 0xece(%rip),%xmm2
unpcklps %xmm0,%xmm2
movaps (%rsp),%xmm0
unpcklps %xmm1,%xmm0
divps  %xmm0,%xmm2
movaps %xmm2,%xmm0
shufps $0x55,%xmm2,%xmm0
mulss  %xmm2,%xmm0
movss  0xebe(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @biaised_random(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = call float (...) @rand()
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to float
%7 = fdiv float %4, %6
%8 = load float, float* %2
%9 = fdiv float 1.000000e+00, %8
%10 = fmul float %7, %9
store float %10, float* %3
%11 = load float, float* %3
%12 = fcmp olt float %11, 1.000000e+00
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @biaised_random(float %0) {
%2 = tail call float (...) @rand()
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = insertelement <2 x float> <float 1.000000e+00, float poison>, float %2, i64 1
%6 = insertelement <2 x float> poison, float %0, i64 0
%7 = insertelement <2 x float> %6, float %4, i64 1
%8 = fdiv <2 x float> %5, %7
%9 = shufflevector <2 x float> %8, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%10 = fmul <2 x float> %8, %9
%11 = extractelement <2 x float> %10, i64 0
%12 = fcmp olt float %11, 1.000000e+00
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ direction;
};
typedef TYPE_1__ XIMPreeditCaretCallbackStruct;

/* Variables and functions */
int get_XIMPreeditCaretCallbackStruct_direction(void *_p) {
  return (int)((XIMPreeditCaretCallbackStruct *)_p)->direction;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XIMPreeditCaretCallbackStruct_direction(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
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XIMPreeditCaretCallbackStruct_direction(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct grid_db {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int get_grid_info(char *name, struct grid_db *db) {
  printf("Warning: can't read McIDAS GRID files on this system.\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<get_grid_info>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.grid_db = type { i32 }
@.str = [55 x i8] c"Warning: can't read McIDAS GRID files on this system.\0A\00"
define i32 @get_grid_info(i8* %0, %struct.grid_db* %1) {
%3 = alloca i8*
%4 = alloca %struct.grid_db*
store i8* %0, i8** %3
store %struct.grid_db* %1, %struct.grid_db** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.grid_db = type { i32 }
@str = [54 x i8] c"Warning: can't read McIDAS GRID files on this system.\00"
define i32 @get_grid_info(i8* nocapture readnone %0, %struct.grid_db* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double tan(double);
double Tangente(double a) {
  printf(gettext("Enter a number: "));
  scanf("%lf", &a);
  return (tan(a));
}


x86 assembly (clang, -O0):
<Tangente>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1050 <tan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tangente>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xeb3(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <tan@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Tangente(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @tan(double %6)
ret double %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Tangente(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @tan(double %6)
ret double %7
}
double __attribute__((used)) __attribute__((optimize("O2,fast-math")))
foo(_Complex double x, int b) {
  if (b)
    x = 0;
  return cabs(x);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     113f <foo+0x2f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <cabs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
je     111a <foo+0xa>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
jmp    1030 <cabs@plt>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (double (double, double, i32)* @foo to i8*)], section "llvm.metadata"
define double @foo(double %0, double %1, i32 %2) {
%4 = alloca { double, double }
%5 = alloca i32
%6 = alloca { double, double }
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %8
store i32 %2, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
br label %14
14: ; preds = %11, %3
%15 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%16 = load double, double* %15
%17 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%18 = load double, double* %17
%19 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%20 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
store double %16, double* %19
store double %18, double* %20
%21 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%22 = load double, double* %21
%23 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
%24 = load double, double* %23
%25 = call double @cabs(double %22, double %24)
ret double %25
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (double (double, double, i32)* @foo to i8*)], section "llvm.metadata"
define double @foo(double %0, double %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, double %0, double 0.000000e+00
%6 = select i1 %4, double %1, double 0.000000e+00
%7 = tail call double @cabs(double %5, double %6)
ret double %7
}
unsigned long USBHostSpeedGet(unsigned long ulBase) {
  ;
  if ((*((volatile unsigned char *)(ulBase + 0x00000060))) & 0x00000040) {
    return (0x00000001);
  }
  if ((*((volatile unsigned char *)(ulBase + 0x00000060))) & 0x00000020) {
    return (0x00000000);
  }
  return (0x80000000);
}


x86 assembly (clang, -O0):
<USBHostSpeedGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x60(%rax),%al
movzbl %al,%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     112b <USBHostSpeedGet+0x2b>
movq   $0x1,-0x8(%rbp)
jmp    1157 <USBHostSpeedGet+0x57>
mov    -0x10(%rbp),%rax
mov    0x60(%rax),%al
movzbl %al,%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     114e <USBHostSpeedGet+0x4e>
movq   $0x0,-0x8(%rbp)
jmp    1157 <USBHostSpeedGet+0x57>
mov    $0x80000000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostSpeedGet>:
mov    $0x1,%eax
testb  $0x40,0x60(%rdi)
jne    111a <USBHostSpeedGet+0x1a>
movzbl 0x60(%rdi),%eax
and    $0x20,%eax
xor    $0x20,%rax
shl    $0x1a,%rax
ret

LLVM IR (-O0):
define i64 @USBHostSpeedGet(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = add i64 %4, 96
%6 = inttoptr i64 %5 to i8*
%7 = load volatile i8, i8* %6
%8 = zext i8 %7 to i32
%9 = and i32 %8, 64
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i64 1, i64* %2
br label %22
12: ; preds = %1
%13 = load i64, i64* %3
%14 = add i64 %13, 96
%15 = inttoptr i64 %14 to i8*
%16 = load volatile i8, i8* %15
%17 = zext i8 %16 to i32
%18 = and i32 %17, 32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %12
store i64 0, i64* %2
br label %22
21: ; preds = %12
store i64 2147483648, i64* %2
br label %22
22: ; preds = %21, %20, %11
%23 = load i64, i64* %2
ret i64 %23
}

LLVM IR (-O2):
define i64 @USBHostSpeedGet(i64 %0) {
%2 = add i64 %0, 96
%3 = inttoptr i64 %2 to i8*
%4 = load volatile i8, i8* %3
%5 = and i8 %4, 64
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load volatile i8, i8* %3
%9 = and i8 %8, 32
%10 = zext i8 %9 to i64
%11 = shl nuw nsw i64 %10, 26
%12 = xor i64 %11, 2147483648
br label %13
13: ; preds = %7, %1
%14 = phi i64 [ 1, %1 ], [ %12, %7 ]
ret i64 %14
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t sub_int32_t(int32_t a, int32_t b) { return a - b; }


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

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

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

LLVM IR (-O2):
define i64 @sub_int32_t(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ numdivis(scalar_t__);
int32_t max_tri_divis(int32_t max) {
  int32_t tri = 3;
  for (int32_t i = 3; numdivis(tri) <= max; tri += i++)
    ;
  return tri;
}


x86 assembly (clang, -O0):
<max_tri_divis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x3,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <numdivis@plt>
cmp    -0x8(%rbp),%rax
jg     1160 <max_tri_divis+0x50>
jmp    1144 <max_tri_divis+0x34>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112c <max_tri_divis+0x1c>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_tri_divis>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x3,%r15d
mov    $0x3,%edi
call   1030 <numdivis@plt>
cmp    %r14,%rax
jg     1154 <max_tri_divis+0x44>
mov    $0x3,%ebx
mov    $0x3,%r15d
nopl   0x0(%rax,%rax,1)
add    %rbx,%r15
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <numdivis@plt>
cmp    %r14,%rax
jle    1140 <max_tri_divis+0x30>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @max_tri_divis(i64 %0) {
%2 = tail call i64 @numdivis(i64 3)
%3 = icmp sgt i64 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i64 [ 3, %1 ], [ %10, %6 ]
ret i64 %5
6: ; preds = %1, %6
%7 = phi i64 [ %9, %6 ], [ 3, %1 ]
%8 = phi i64 [ %10, %6 ], [ 3, %1 ]
%9 = add nuw nsw i64 %7, 1
%10 = add nuw nsw i64 %7, %8
%11 = tail call i64 @numdivis(i64 %10)
%12 = icmp sgt i64 %11, %0
br i1 %12, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long long llabs(long long b) { abort(); }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<llabs>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
int mbo_init(char *device) { return (!1); }


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

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

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

LLVM IR (-O2):
define i32 @mbo_init(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int two();
__attribute__((no)) int baz() { return two(); }


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

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

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

LLVM IR (-O2):
define i32 @baz() {
%1 = tail call i32 (...) @two()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("sizeof int=%d\n", sizeof(int));
  printf("sizeof long int=%d\n", sizeof(long int));
  printf("sizeof ptr=%d\n", sizeof(int *));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"sizeof int=%d\0A\00"
@.str.1 = [20 x i8] c"sizeof long int=%d\0A\00"
@.str.2 = [15 x i8] c"sizeof ptr=%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 8)
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"sizeof int=%d\0A\00"
@.str.1 = [20 x i8] c"sizeof long int=%d\0A\00"
@.str.2 = [15 x i8] c"sizeof ptr=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
size_t buffer_length(struct buffer *);
int /*<<< orphan*/ buffer_removeslice(struct buffer *, int /*<<< orphan*/,
                                      size_t);
void buffer_empty(struct buffer *b) {
  size_t len;
  if (b == NULL || (len = buffer_length(b)) <= 1)
    return;
  buffer_removeslice(b, 0, len);
}


x86 assembly (clang, -O0):
<buffer_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114e <buffer_empty+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <buffer_length@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x1,%rax
ja     1153 <buffer_empty+0x33>
jmp    1162 <buffer_empty+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <buffer_removeslice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_empty>:
push   %rbx
test   %rdi,%rdi
je     1134 <buffer_empty+0x14>
mov    %rdi,%rbx
call   1030 <buffer_length@plt>
cmp    $0x2,%rax
jae    1136 <buffer_empty+0x16>
pop    %rbx
ret
mov    %rbx,%rdi
xor    %esi,%esi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <buffer_removeslice@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buffer_empty(%struct.buffer* %0) {
%2 = alloca %struct.buffer*
%3 = alloca i64
store %struct.buffer* %0, %struct.buffer** %2
%4 = load %struct.buffer*, %struct.buffer** %2
%5 = icmp eq %struct.buffer* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load %struct.buffer*, %struct.buffer** %2
%8 = call i64 @buffer_length(%struct.buffer* %7)
store i64 %8, i64* %3
%9 = icmp ule i64 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %6, %1
br label %15
11: ; preds = %6
%12 = load %struct.buffer*, %struct.buffer** %2
%13 = load i64, i64* %3
%14 = call i32 @buffer_removeslice(%struct.buffer* %12, i32 0, i64 %13)
br label %15
15: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_empty(%struct.buffer* %0) {
%2 = icmp eq %struct.buffer* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @buffer_length(%struct.buffer* %0)
%5 = icmp ult i64 %4, 2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @buffer_removeslice(%struct.buffer* %0, i32 0, i64 %4)
br label %8
8: ; preds = %1, %3, %6
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t murmurhash3_64bit(uint64_t i) {
  i ^= i >> 33;
  i *= 0xff51afd7ed558ccd;
  i ^= i >> 33;
  i *= 0xc4ceb9fe1a85ec53;
  i ^= i >> 33;
  return i;
}


x86 assembly (clang, -O0):
<murmurhash3_64bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x21,%ecx
sar    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xff51afd7ed558ccd,%rcx
af 51 ff
imul   %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x21,%ecx
sar    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xc4ceb9fe1a85ec53,%rcx
b9 ce c4
imul   %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x21,%ecx
sar    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @murmurhash3_64bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 33
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = mul i64 %8, -49064778989728563
%10 = trunc i64 %9 to i32
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 33
%13 = load i32, i32* %2
%14 = xor i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = mul i64 %16, -4265267296055464877
%18 = trunc i64 %17 to i32
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 33
%21 = load i32, i32* %2
%22 = xor i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @murmurhash3_64bit(i32 %0) {
ret i32 poison
}
int do_840() { return 840; }


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

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

LLVM IR (-O0):
define i32 @do_840() {
ret i32 840
}

LLVM IR (-O2):
define i32 @do_840() {
ret i32 840
}
/* Variables and functions */
int /*<<< orphan*/ popviewport();
popvie_() { popviewport(); }


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

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

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

LLVM IR (-O2):
define i32 @popvie_() {
%1 = tail call i32 (...) @popviewport()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ hello_world();
int main() {
  hello_world();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hello_world()
ret i32 0
}
void increment_fstein_dither(void) { return; }


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

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

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

LLVM IR (-O2):
define void @increment_fstein_dither() {
ret void
}
void acpi_video_unregister(void) { return; }


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

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

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

LLVM IR (-O2):
define void @acpi_video_unregister() {
ret void
}
OP(ed, cc) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char a;
  for (a = 1; a <= 127; a++) {
    printf("%2c", a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x7f,%eax
jg     114d <main+0x3d>
lea    0xec9(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1123 <main+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%bl
lea    0xee3(%rip),%r14
nopl   (%rax)
movsbl %bl,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%bl
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%2c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 1, i8* %2
br label %3
3: ; preds = %10, %0
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sle i32 %5, 127
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8, i8* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
br label %10
10: ; preds = %7
%11 = load i8, i8* %2
%12 = add i8 %11, 1
store i8 %12, i8* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%2c\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i8 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = add i8 %2, 1
br label %1
}
void null_debug_init(void) {}


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

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

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

LLVM IR (-O2):
define void @null_debug_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
uid_t getuid0(void) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @getuid0() {
ret i32 0
}
unsigned char nm_readb(unsigned char *ptr) { return *ptr; }


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

x86 assembly (clang, -O2):
<nm_readb>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define zeroext i8 @nm_readb(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printNewline() { printf("\n"); }


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

x86 assembly (clang, -O2):
<printNewline>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printNewline() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_server() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_server"
         "\n");
}


x86 assembly (clang, -O0):
<pa_context_get_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_context_get_server\0A\00"
define i32 @pa_context_get_server() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_context_get_server\00"
define i32 @pa_context_get_server() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int d_le_rr1(double a1, double a2) { return (((a1) <= (a2))); }


x86 assembly (clang, -O0):
<d_le_rr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_le_rr1>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @d_le_rr1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ole double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @d_le_rr1(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}