xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void read_flashram_statush() { printf("read_flashram_statush\n"); }


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"read_flashram_statush\00"
define void @read_flashram_statush() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __BITS_PER_LONG;
void set_bit(int nr, unsigned long *addr) {
  addr[nr / __BITS_PER_LONG] |= 1UL << (nr % __BITS_PER_LONG);
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed3(%rip),%rcx
cltd
idivl  (%rcx)
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eae(%rip),%rcx
cltd
idivl  (%rcx)
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
or     (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
cltd
idivl  (%rcx)
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
cltq
or     %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
@__BITS_PER_LONG = global i32 0
define void @set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @__BITS_PER_LONG
%7 = srem i32 %5, %6
%8 = zext i32 %7 to i64
%9 = shl i64 1, %8
%10 = load i64*, i64** %4
%11 = load i32, i32* %3
%12 = load i32, i32* @__BITS_PER_LONG
%13 = sdiv i32 %11, %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %10, i64 %14
%16 = load i64, i64* %15
%17 = or i64 %16, %9
store i64 %17, i64* %15
ret void
}

LLVM IR (-O2):
@__BITS_PER_LONG = global i32 0
define void @set_bit(i32 %0, i64* nocapture %1) {
%3 = load i32, i32* @__BITS_PER_LONG
%4 = srem i32 %0, %3
%5 = zext i32 %4 to i64
%6 = shl nuw i64 1, %5
%7 = sdiv i32 %0, %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %1, i64 %8
%10 = load i64, i64* %9
%11 = or i64 %10, %6
store i64 %11, i64* %9
ret void
}
char *findEndOfLine(char *p) {
  while (*p && *p != '\n' && *p != '\r')
    p++;
  return p;
}


x86 assembly (clang, -O0):
<findEndOfLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1142 <findEndOfLine+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     1142 <findEndOfLine+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <findEndOfLine+0x52>
jmp    1163 <findEndOfLine+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <findEndOfLine+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findEndOfLine>:
mov    %rdi,%rax
mov    $0x2401,%ecx
jmp    1114 <findEndOfLine+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0xd,%rdx
ja     1110 <findEndOfLine+0x10>
bt     %rdx,%rcx
jae    1110 <findEndOfLine+0x10>
ret

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

LLVM IR (-O2):
define i8* @findEndOfLine(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 10, label %7
i8 13, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2
ret i8* %3
}
void ScaleARGBCols_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBCols_C() {
ret void
}
void gtk_text_view_scroll_mark_onscreen() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_scroll_mark_onscreen() {
ret void
}
unsigned int hash_string(s) const char *s;
{
  register unsigned int i;
  for (i = 0; *s; s++) {
    i *= 16777619;
    i ^= *s;
  }
  return i;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1144 <hash_string+0x44>
imul   $0x1000193,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash_string+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <hash_string+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x1000193,%eax,%edx
movsbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 16777619
%9 = sext i8 %5 to i32
%10 = xor i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
void set_led_1(int mode) {
  if (mode == 0) {
    (*(volatile unsigned int *)(0x7F008824)) &= ~1;
  } else {
    (*(volatile unsigned int *)(0x7F008824)) |= 1;
  }
  return;
}


x86 assembly (clang, -O0):
<set_led_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1127 <set_led_1+0x27>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
jmp    1138 <set_led_1+0x38>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_led_1>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    0x7f008824,%ecx
and    $0xfffffffe,%ecx
or     %ecx,%eax
mov    %eax,0x7f008824
ret

LLVM IR (-O0):
define void @set_led_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%7 = and i32 %6, -2
store volatile i32 %7, i32* inttoptr (i64 2130741284 to i32*)
br label %11
8: ; preds = %1
%9 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%10 = or i32 %9, 1
store volatile i32 %10, i32* inttoptr (i64 2130741284 to i32*)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @set_led_1(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%4 = and i32 %3, -2
%5 = zext i1 %2 to i32
%6 = or i32 %4, %5
store volatile i32 %6, i32* inttoptr (i64 2130741284 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_UPTO(int);
int /*<<< orphan*/ setlogmask(int /*<<< orphan*/);
void initLogging() { setlogmask(LOG_UPTO(4)); }


x86 assembly (clang, -O0):
<initLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
call   1040 <setlogmask@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initLogging>:
push   %rax
mov    $0x4,%edi
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <setlogmask@plt>

LLVM IR (-O0):
define void @initLogging() {
%1 = call i32 @LOG_UPTO(i32 4)
%2 = call i32 @setlogmask(i32 %1)
ret void
}

LLVM IR (-O2):
define void @initLogging() {
%1 = tail call i32 @LOG_UPTO(i32 4)
%2 = tail call i32 @setlogmask(i32 %1)
ret void
}
/* Variables and functions */
char *Sys_GetClipboardData(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @Sys_GetClipboardData() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @Sys_GetClipboardData() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: od [-bcdhovx] [file] [ [+] offset [.] [b] ]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: od [-bcdhovx] [file] [ [+] offset [.] [b] ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: od [-bcdhovx] [file] [ [+] offset [.] [b] ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
double f4_cb_send_pre_int_int_int_int_float(double (*cb)(int, int, int, int,
                                                         float)) {
  float r = 55.0;
  return cb(8, 9, 10, 11, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int_int_int_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
call   *%rax
movsd  0xec0(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int_int_int_float>:
push   %rax
mov    %rdi,%rax
movss  0xef4(%rip),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
call   *%rax
addsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int_int_int_float(double (i32, i32, i32, i32, float)* %0) {
%2 = alloca double (i32, i32, i32, i32, float)*
%3 = alloca float
store double (i32, i32, i32, i32, float)* %0, double (i32, i32, i32, i32, float)** %2
store float 5.500000e+01, float* %3
%4 = load double (i32, i32, i32, i32, float)*, double (i32, i32, i32, i32, float)** %2
%5 = load float, float* %3
%6 = call double %4(i32 8, i32 9, i32 10, i32 11, float %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int_int_int_float(double (i32, i32, i32, i32, float)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 9, i32 10, i32 11, float 5.500000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int isDirectory(const char *path) {
  struct stat statbuf;
  if (stat(path, &statbuf) != 0) {
    return 0;
  }
  return S_ISDIR(statbuf.st_mode);
}


x86 assembly (clang, -O0):
<isDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     114f <isDirectory+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <isDirectory+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDirectory>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <isDirectory+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isDirectory(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISDIR(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isDirectory(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int floor(float);
float numeroArrotondatoADecimi(float x) { return floor(x * 10 + .5) / 10; }


x86 assembly (clang, -O0):
<numeroArrotondatoADecimi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeca(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <floor@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeroArrotondatoADecimi>:
push   %rax
mulss  0xee7(%rip),%xmm0
addss  0xee3(%rip),%xmm0
call   1030 <floor@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @numeroArrotondatoADecimi(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.000000e+01
%5 = fpext float %4 to double
%6 = fadd double %5, 5.000000e-01
%7 = fptrunc double %6 to float
%8 = call i32 @floor(float %7)
%9 = sdiv i32 %8, 10
%10 = sitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @numeroArrotondatoADecimi(float %0) {
%2 = fmul float %0, 1.000000e+01
%3 = fadd float %2, 5.000000e-01
%4 = tail call i32 @floor(float %3)
%5 = sdiv i32 %4, 10
%6 = sitofp i32 %5 to float
ret float %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t _wyr3(const uint8_t *p, size_t k) {
  return (((uint64_t)p[0]) << 16) | (((uint64_t)p[k >> 1]) << 8) | p[k - 1];
}


x86 assembly (clang, -O0):
<_wyr3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
shr    $0x1,%rdx
mov    (%rcx,%rdx,4),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
or     (%rcx,%rdx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wyr3>:
mov    (%rdi),%ecx
shl    $0x10,%ecx
mov    %rsi,%rax
and    $0xfffffffffffffffe,%rax
mov    (%rdi,%rax,2),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     -0x4(%rdi,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @_wyr3(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = load i32*, i32** %3
%10 = load i64, i64* %4
%11 = lshr i64 %10, 1
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = or i32 %8, %14
%16 = load i32*, i32** %3
%17 = load i64, i64* %4
%18 = sub i64 %17, 1
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = or i32 %15, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @_wyr3(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 16
%5 = lshr i64 %1, 1
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
%10 = add i64 %1, -1
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = or i32 %9, %12
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p224_opp(uintptr_t, uintptr_t);
void fiat_p224_opp(uint64_t out1[4], const uint64_t arg1[4]) {
  internal_fiat_p224_opp((uintptr_t)out1, (uintptr_t)arg1);
}


x86 assembly (clang, -O0):
<fiat_p224_opp>:
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 <internal_fiat_p224_opp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p224_opp>:
jmp    1030 <internal_fiat_p224_opp@plt>

LLVM IR (-O0):
define void @fiat_p224_opp(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p224_opp(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p224_opp(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p224_opp(i64 %3, i64 %4)
ret void
}
char *parse_hp(char *s) {
  char *p = s;
  while (*p != ':')
    p++;
  *p = '\0';
  return ++p;
}


x86 assembly (clang, -O0):
<parse_hp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     1131 <parse_hp+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <parse_hp+0x10>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_hp>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x3a,(%rax)
lea    0x1(%rax),%rax
jne    1110 <parse_hp+0x10>
movb   $0x0,-0x1(%rax)
ret

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

LLVM IR (-O2):
define i8* @parse_hp(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 58
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
store i8 0, i8* %3
ret i8* %6
}
/* Variables and functions */
char *ft_memalloc(size_t);
char *ft_strnew(size_t size) {
  char *s;
  size_t i;
  i = 0;
  if ((s = ft_memalloc(++size)) == NULL)
    return (NULL);
  while (i < size)
    s[i++] = '\0';
  return (s);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x10(%rbp)
call   1030 <ft_memalloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1150 <ft_strnew+0x40>
movq   $0x0,-0x8(%rbp)
jmp    1187 <ft_strnew+0x77>
jmp    1155 <ft_strnew+0x45>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    117f <ft_strnew+0x6f>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
movb   $0x0,(%rax,%rcx,1)
jmp    1155 <ft_strnew+0x45>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <ft_memalloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     114d <ft_strnew+0x2d>
test   %rbx,%rbx
je     114d <ft_strnew+0x2d>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strnew(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
store i64 %0, i64* %3
store i64 0, i64* %5
%6 = load i64, i64* %3
%7 = add i64 %6, 1
store i64 %7, i64* %3
%8 = call i8* @ft_memalloc(i64 %7)
store i8* %8, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %23
11: ; preds = %1
br label %12
12: ; preds = %16, %11
%13 = load i64, i64* %5
%14 = load i64, i64* %3
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8*, i8** %4
%18 = load i64, i64* %5
%19 = add i64 %18, 1
store i64 %19, i64* %5
%20 = getelementptr inbounds i8, i8* %17, i64 %18
store i8 0, i8* %20
br label %12
21: ; preds = %12
%22 = load i8*, i8** %4
store i8* %22, i8** %2
br label %23
23: ; preds = %21, %10
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define i8* @ft_strnew(i64 %0) {
%2 = add i64 %0, 1
%3 = tail call i8* @ft_memalloc(i64 %2)
%4 = icmp ne i8* %3, null
%5 = icmp ne i64 %2, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %1
ret i8* %3
}
/* Variables and functions */
int find_largest_square(int *);
int find_min_number_of_slices(int slice_dimension[2]) {
  int num_slices = 0;
  if (slice_dimension[0] == slice_dimension[1]) {
    num_slices = 1;
  } else {
    int area = slice_dimension[0] * slice_dimension[1];
    num_slices = area / find_largest_square(slice_dimension);
  }
  return num_slices;
}


x86 assembly (clang, -O0):
<find_min_number_of_slices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jne    1142 <find_min_number_of_slices+0x32>
movl   $0x1,-0xc(%rbp)
jmp    116d <find_min_number_of_slices+0x5d>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
imul   0x4(%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <find_largest_square@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_min_number_of_slices>:
push   %rbx
mov    (%rdi),%ecx
mov    0x4(%rdi),%ebx
mov    $0x1,%eax
cmp    %ebx,%ecx
je     112e <find_min_number_of_slices+0x1e>
imul   %ecx,%ebx
call   1030 <find_largest_square@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @find_min_number_of_slices(i32* %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = icmp eq i32 %2, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = mul nsw i32 %4, %2
%8 = tail call i32 @find_largest_square(i32* %0)
%9 = sdiv i32 %7, %8
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 1, %1 ]
ret i32 %11
}
void outsb(int port, const void *addr, int cnt) {
  asm volatile("cld\n\trepne\n\toutsb"
               : "=S"(addr), "=c"(cnt)
               : "d"(port), "0"(addr), "1"(cnt)
               : "cc");
}


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

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

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

LLVM IR (-O2):
define void @outsb(i32 %0, i8* %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "cld\0A\09repne\0A\09outsb", "={si},={cx},{dx},0,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i32 %2)
ret void
}
long long int intLSR(long long int x) {
  set_carry(0 != (x & 1));
  return mask_value((x >> 1) & ~topbit_mask());
}


x86 assembly (clang, -O0):
<intLSR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <set_carry@plt>
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <topbit_mask@plt>
mov    -0x10(%rbp),%rdi
xor    $0xffffffff,%eax
cltq
and    %rax,%rdi
mov    $0x0,%al
call   1040 <mask_value@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intLSR>:
push   %rbx
mov    %rdi,%rbx
and    $0x1,%edi
xor    %eax,%eax
call   1030 <set_carry@plt>
sar    %rbx
xor    %eax,%eax
call   1050 <topbit_mask@plt>
not    %eax
movslq %eax,%rdi
and    %rbx,%rdi
xor    %eax,%eax
call   1040 <mask_value@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
define i64 @intLSR(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1
%5 = icmp ne i64 0, %4
%6 = zext i1 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @set_carry to i32 (i32, ...)*)(i32 %6)
%8 = load i64, i64* %2
%9 = ashr i64 %8, 1
%10 = call i32 (...) @topbit_mask()
%11 = xor i32 %10, -1
%12 = sext i32 %11 to i64
%13 = and i64 %9, %12
%14 = call i32 (i64, ...) bitcast (i32 (...)* @mask_value to i32 (i64, ...)*)(i64 %13)
%15 = sext i32 %14 to i64
ret i64 %15
}

LLVM IR (-O2):
define i64 @intLSR(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @set_carry to i32 (i32, ...)*)(i32 %3)
%5 = ashr i64 %0, 1
%6 = tail call i32 (...) @topbit_mask()
%7 = xor i32 %6, -1
%8 = sext i32 %7 to i64
%9 = and i64 %5, %8
%10 = tail call i32 (i64, ...) bitcast (i32 (...)* @mask_value to i32 (i64, ...)*)(i64 %9)
%11 = sext i32 %10 to i64
ret i64 %11
}
void swap_bytes_4(unsigned char *buffer) {
  unsigned char temp;
  temp = buffer[0];
  buffer[0] = buffer[3];
  buffer[3] = temp;
  temp = buffer[1];
  buffer[1] = buffer[2];
  buffer[2] = temp;
}


x86 assembly (clang, -O0):
<swap_bytes_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_bytes_4>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

LLVM IR (-O0):
define void @swap_bytes_4(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 3
%9 = load i8, i8* %8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8, i8* %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 3
store i8 %12, i8* %14
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
store i8 %17, i8* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i8, i8* %3
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 2
store i8 %23, i8* %25
ret void
}

LLVM IR (-O2):
define void @swap_bytes_4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
int test_imm_1Eint16_mem(short *val) {
  return ((*val) & (0x1E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Eint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 30
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int basic_test();
int main(void) {
  int fail = basic_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @basic_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void alignment_check_fault(void) {
  panic("exception(fault): alignment check failed");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"exception(fault): alignment check failed\00"
define void @alignment_check_fault() {
%1 = call i32 @panic(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"exception(fault): alignment check failed\00"
define void @alignment_check_fault() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
void ignore_puts(char *st) {}


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

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

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

LLVM IR (-O2):
define void @ignore_puts(i8* nocapture %0) {
ret void
}
int init_scribe(struct task_struct *p, struct scribe_context *ctx) { return 0; }


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
%struct.scribe_context = type opaque
define i32 @init_scribe(%struct.task_struct* %0, %struct.scribe_context* %1) {
%3 = alloca %struct.task_struct*
%4 = alloca %struct.scribe_context*
store %struct.task_struct* %0, %struct.task_struct** %3
store %struct.scribe_context* %1, %struct.scribe_context** %4
ret i32 0
}

LLVM IR (-O2):
%struct.task_struct = type opaque
%struct.scribe_context = type opaque
define i32 @init_scribe(%struct.task_struct* nocapture readnone %0, %struct.scribe_context* nocapture readnone %1) {
ret i32 0
}
signed long long int
signedlonglongint_ignoring_unsignedlonglong(signed long long int x,
                                            unsigned long long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlonglongint_ignoring_unsignedlonglong(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglongint_ignoring_unsignedlonglong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_ftosizd(int s, int d) {
  assem_debug("ftosizd s%d,d%d\n", d, s);
  output_w32(0xeebd0bc0 | ((d & 14) << 11) | ((d & 1) << 22) | (s & 7));
}


x86 assembly (clang, -O0):
<emit_ftosizd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0xe,%edi
shl    $0xb,%edi
or     $0xeebd0bc0,%edi
mov    -0x8(%rbp),%eax
and    $0x1,%eax
shl    $0x16,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0x7,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_ftosizd>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
lea    0xed0(%rip),%rdi
mov    %r14d,%edx
call   1030 <assem_debug@plt>
mov    %ebx,%eax
and    $0xe,%eax
shl    $0xb,%eax
and    $0x1,%ebx
shl    $0x16,%ebx
and    $0x7,%r14d
or     %ebx,%r14d
lea    (%rax,%r14,1),%edi
add    $0xeebd0bc0,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ftosizd s%d,d%d\0A\00"
define void @emit_ftosizd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @assem_debug(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 14
%10 = shl i32 %9, 11
%11 = or i32 -289600576, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = shl i32 %13, 22
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 7
%18 = or i32 %15, %17
%19 = call i32 @output_w32(i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ftosizd s%d,d%d\0A\00"
define void @emit_ftosizd(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 11
%5 = and i32 %4, 28672
%6 = shl i32 %1, 22
%7 = and i32 %6, 4194304
%8 = and i32 %0, 7
%9 = or i32 %8, %7
%10 = or i32 %9, %5
%11 = or i32 %10, -289600576
%12 = tail call i32 @output_w32(i32 %11)
ret void
}
void add(int *c, int a, int b) {
  printf("a3=%x\n", &a);
  printf("b3=%x\n", &b);
  printf("c3=%x\n", c);
  *c = a + b;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,0xc(%rsp)
mov    %edx,0x8(%rsp)
lea    0xed9(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%eax
add    0xc(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"a3=%x\0A\00"
@.str.1 = [7 x i8] c"b3=%x\0A\00"
@.str.2 = [7 x i8] c"c3=%x\0A\00"
define void @add(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %1, i32* %4
store i32 %2, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %4)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32* %0)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = add nsw i32 %10, %9
store i32 %11, i32* %0
ret void
}
int index_3D_to_1D(int i, int ni, int j, int nj, int k, int nk) {
  return k + nk * (j + nj * i);
}


x86 assembly (clang, -O0):
<index_3D_to_1D>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%esi
imul   -0x4(%rbp),%esi
add    %esi,%edx
imul   %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_3D_to_1D>:
imul   %ecx,%edi
lea    (%rdi,%rdx,1),%eax
imul   %r9d,%eax
add    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @index_3D_to_1D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %11
%14 = load i32, i32* %12
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %7
%18 = mul nsw i32 %16, %17
%19 = add nsw i32 %15, %18
%20 = mul nsw i32 %14, %19
%21 = add nsw i32 %13, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @index_3D_to_1D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = mul nsw i32 %3, %0
%8 = add nsw i32 %7, %2
%9 = mul nsw i32 %8, %5
%10 = add nsw i32 %9, %4
ret i32 %10
}
void s5p_mixer_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @s5p_mixer_setname(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int close(int);
int carmen_serial_close(int dev_fd) { return close(dev_fd); }


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

x86 assembly (clang, -O2):
<carmen_serial_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @carmen_serial_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int grid_xrep_ispeer(int socktype) { return socktype == (3 * 16 + 0) ? 1 : 0; }


x86 assembly (clang, -O0):
<grid_xrep_ispeer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x30,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_xrep_ispeer>:
xor    %eax,%eax
cmp    $0x30,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @grid_xrep_ispeer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 48
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @grid_xrep_ispeer(i32 %0) {
%2 = icmp eq i32 %0, 48
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *fspath_get_extension(const char path[]) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @fspath_get_extension(i8* nocapture readnone %0) {
ret i8* null
}
int ld_bgt_rm1(long double a1, long double *a2) {
  return (__builtin_isgreater(a1, *a2));
}


x86 assembly (clang, -O0):
<ld_bgt_rm1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bgt_rm1>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

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

LLVM IR (-O2):
define i32 @ld_bgt_rm1(x86_fp80 %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %1
%4 = fcmp olt x86_fp80 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned long long max_memory() { return 128 * 1024 * 1024 * 1024; }


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

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

LLVM IR (-O0):
define i64 @max_memory() {
ret i64 0
}

LLVM IR (-O2):
define i64 @max_memory() {
ret i64 0
}
__attribute__((always_)) double brotli_max_double(double a, double b) {
  return a > b ? a : b;
}


x86 assembly (clang, -O0):
<brotli_max_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <brotli_max_double+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <brotli_max_double+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<brotli_max_double>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @brotli_max_double(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 ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @brotli_max_double(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void HostBegin() {}


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

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

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

LLVM IR (-O2):
define void @HostBegin() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t esp_bt_gap_get_cod_minor_dev(uint32_t cod) {
  return (cod & (0xfc)) >> (2);
}


x86 assembly (clang, -O0):
<esp_bt_gap_get_cod_minor_dev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfc,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<esp_bt_gap_get_cod_minor_dev>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0x3f,%eax
ret

LLVM IR (-O0):
define i32 @esp_bt_gap_get_cod_minor_dev(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 252
%5 = ashr i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @esp_bt_gap_get_cod_minor_dev(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 63
ret i32 %3
}