xunge/DecIR huggingface dataset:
/* Type definitions */
struct flock {
  int l_type;
  scalar_t__ l_len;
  scalar_t__ l_start;
  int /*<<< orphan*/ l_whence;
};

/* Variables and functions */
int /*<<< orphan*/ F_SETLKW;
int /*<<< orphan*/ SEEK_SET;
int fcntl(int, int /*<<< orphan*/, struct flock *);
int dolock(int fd, int type) {
  int fres;
  struct flock flock;
  flock.l_whence = SEEK_SET;
  flock.l_start = 0;
  flock.l_len = 0;
  flock.l_type = type;
  fres = fcntl(fd, F_SETLKW, &flock);
  return fres;
}


x86 assembly (clang, -O0):
<dolock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dolock>:
sub    $0x28,%rsp
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x20(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rsp)
mov    %esi,0x8(%rsp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1030 <fcntl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i32, i64, i64, i32 }
@SEEK_SET = global i32 0
@F_SETLKW = global i32 0
define i32 @dolock(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.flock
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* @SEEK_SET
%8 = getelementptr inbounds %struct.flock, %struct.flock* %6, i32 0, i32 3
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.flock, %struct.flock* %6, i32 0, i32 2
store i64 0, i64* %9
%10 = getelementptr inbounds %struct.flock, %struct.flock* %6, i32 0, i32 1
store i64 0, i64* %10
%11 = load i32, i32* %4
%12 = getelementptr inbounds %struct.flock, %struct.flock* %6, i32 0, i32 0
store i32 %11, i32* %12
%13 = load i32, i32* %3
%14 = load i32, i32* @F_SETLKW
%15 = call i32 @fcntl(i32 %13, i32 %14, %struct.flock* %6)
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
%struct.flock = type { i32, i64, i64, i32 }
@SEEK_SET = global i32 0
@F_SETLKW = global i32 0
define i32 @dolock(i32 %0, i32 %1) {
%3 = alloca %struct.flock
%4 = bitcast %struct.flock* %3 to i8*
%5 = load i32, i32* @SEEK_SET
%6 = getelementptr inbounds %struct.flock, %struct.flock* %3, i64 0, i32 3
store i32 %5, i32* %6
%7 = getelementptr inbounds %struct.flock, %struct.flock* %3, i64 0, i32 1
%8 = getelementptr inbounds %struct.flock, %struct.flock* %3, i64 0, i32 0
%9 = bitcast i64* %7 to i8*
store i32 %1, i32* %8
%10 = load i32, i32* @F_SETLKW
%11 = call i32 @fcntl(i32 %0, i32 %10, %struct.flock* %3)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double round(float);
int /*<<< orphan*/ scanf(char *, float *);
void main() {
  float f;
  scanf("%f", &f);
  printf("%f", round(f));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
call   1050 <round@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
call   1050 <round@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @main() {
%1 = alloca float
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%3 = load float, float* %1
%4 = call double @round(float %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %4)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call double @round(float %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void g(int x) {
  int(T);
  T = x;
  f(T);
}


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @g(i32 %0) {
%2 = tail call i32 @f(i32 %0)
ret void
}
/* Variables and functions */
int TCPsend(int, char *, unsigned int);
int htonl(unsigned int);
int PROTOsend(int fd, char *message, unsigned len) {
  int len_aux = htonl(len);
  return TCPsend(fd, (char *)&len_aux, 4) + TCPsend(fd, message, len);
}


x86 assembly (clang, -O0):
<PROTOsend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1040 <TCPsend@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <TCPsend@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PROTOsend>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %edx,%edi
call   1030 <htonl@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
mov    $0x4,%edx
call   1040 <TCPsend@plt>
mov    %eax,%r15d
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <TCPsend@plt>
add    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @PROTOsend(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @htonl(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = bitcast i32* %7 to i8*
%12 = call i32 @TCPsend(i32 %10, i8* %11, i32 4)
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @TCPsend(i32 %13, i8* %14, i32 %15)
%17 = add nsw i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @PROTOsend(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @htonl(i32 %2)
store i32 %6, i32* %4
%7 = call i32 @TCPsend(i32 %0, i8* %5, i32 4)
%8 = call i32 @TCPsend(i32 %0, i8* %1, i32 %2)
%9 = add nsw i32 %8, %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ socket_config_read2(char *);
void socket_config_read(void) {
  socket_config_read2("conf/socket.conf");
  return;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"conf/socket.conf\00"
define void @socket_config_read() {
%1 = call i32 @socket_config_read2(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"conf/socket.conf\00"
define void @socket_config_read() {
%1 = tail call i32 @socket_config_read2(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
void gtk_window_get_default_icon_list() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_get_default_icon_list() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char **argv) {
  printf("Hola mundo\n");
  system("pause");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"pause\00"
@str = [11 x i8] c"Hola mundo\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int main() {
  unsigned short arg = 0x1234;
  unsigned short out = 0;
  __asm__("bsrw %%ax, %%cx" : "=c"(out) : "a"(arg));
  return (out == 12);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movw   $0x1234,-0x6(%rbp)
movw   $0x0,-0x8(%rbp)
mov    -0x6(%rbp),%ax
bsr    %ax,%cx
mov    %cx,-0x8(%rbp)
movzwl -0x8(%rbp),%eax
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1234,%ax
bsr    %ax,%cx
xor    %eax,%eax
cmp    $0xc,%cx
sete   %al
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
store i32 0, i32* %1
store i16 4660, i16* %2
store i16 0, i16* %3
%4 = load i16, i16* %2
%5 = call i16 asm "bsrw %ax, %cx", "={cx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = icmp eq i32 %7, 12
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i16 asm "bsrw %ax, %cx", "={cx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 4660)
%2 = icmp eq i16 %1, 12
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void print_arr(int *arr, size_t len) {
  size_t i = 0;
  for (i = 0; i < len; i++)
    printf("%d ", *(arr + i));
  putchar('\n');
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1176 <print_arr+0x56>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1140 <print_arr+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1155 <print_arr+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_arr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @print_arr(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_arr(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void pushfd() { db(0x9C); }


x86 assembly (clang, -O0):
<pushfd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9c,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushfd>:
mov    $0x9c,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @pushfd() {
%1 = call i32 @db(i32 156)
ret void
}

LLVM IR (-O2):
define void @pushfd() {
%1 = tail call i32 @db(i32 156)
ret void
}
double rq_rate_simple_to_discount(double r, double days, double days_in_year) {
  return 1.0 / (1.0 + r * days / days_in_year);
}


x86 assembly (clang, -O0):
<rq_rate_simple_to_discount>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_rate_simple_to_discount>:
mulsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
movsd  0xef0(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @rq_rate_simple_to_discount(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fmul double %7, %8
%10 = load double, double* %6
%11 = fdiv double %9, %10
%12 = fadd double 1.000000e+00, %11
%13 = fdiv double 1.000000e+00, %12
ret double %13
}

LLVM IR (-O2):
define double @rq_rate_simple_to_discount(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = fdiv double %4, %2
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double 1.000000e+00, %6
ret double %7
}
int test_imm_E1uint8_reg(unsigned char val) {
  return ((val) & (-0xE1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E1uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff1f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_E1uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -225
%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_E1uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 31
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_nearbyint();
scalar_t__ nearbyint(double);
void test_nearbyint(double d) {
  if (nearbyint(d) != nearbyint(d))
    link_failure_nearbyint();
}


x86 assembly (clang, -O0):
<test_nearbyint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <nearbyint@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <nearbyint@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_nearbyint+0x3c>
mov    $0x0,%al
call   1030 <link_failure_nearbyint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nearbyint>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <nearbyint@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <nearbyint@plt>
cmp    %rax,%rbx
jne    1149 <test_nearbyint+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_nearbyint@plt>

LLVM IR (-O0):
define void @test_nearbyint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @nearbyint(double %3)
%5 = load double, double* %2
%6 = call i64 @nearbyint(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_nearbyint()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_nearbyint(double %0) {
%2 = tail call i64 @nearbyint(double %0)
%3 = tail call i64 @nearbyint(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_nearbyint()
br label %7
7: ; preds = %5, %1
ret void
}
char *toCharPtr(void *addr) { return (char *)(addr); }


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

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

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

LLVM IR (-O2):
define i8* @toCharPtr(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
char isinf(float);
char futhark_isinf32(float x) { return isinf(x); }


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

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

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

LLVM IR (-O2):
define signext i8 @futhark_isinf32(float %0) {
%2 = tail call signext i8 @isinf(float %0)
ret i8 %2
}
int gpio_init() { return 100; }


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

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

LLVM IR (-O0):
define i32 @gpio_init() {
ret i32 100
}

LLVM IR (-O2):
define i32 @gpio_init() {
ret i32 100
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long pthreads_thread_id(void) {
  unsigned long ret;
  ret = (unsigned long)pthread_self();
  return (ret);
}


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

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

LLVM IR (-O0):
define i64 @pthreads_thread_id() {
%1 = alloca i64
%2 = call i64 (...) @pthread_self()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @pthreads_thread_id() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() { printf("%p\n", getenv("shell")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [6 x i8] c"shell\00"
define i32 @main() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_subdirname(void) { printf("arm64"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"arm64\00"
define void @get_subdirname() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xor_string(unsigned char *, unsigned char const *,
                              unsigned char const *, int, int);
void encrypt(unsigned char *c, const unsigned char *m, const unsigned char *k,
             int m_len, int k_len) {
  xor_string(c, m, k, m_len, k_len);
}


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

x86 assembly (clang, -O2):
<encrypt>:
jmp    1030 <xor_string@plt>

LLVM IR (-O0):
define void @encrypt(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @xor_string(i8* %11, i8* %12, i8* %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @encrypt(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @xor_string(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4)
ret void
}
/* Type definitions */
struct sg_alloc_s {
  int dummy;
};

/* Variables and functions */
void *a_realloc(struct sg_alloc_s *a, void *ptr, size_t size) { return NULL; }


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

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

LLVM IR (-O0):
%struct.sg_alloc_s = type { i32 }
define i8* @a_realloc(%struct.sg_alloc_s* %0, i8* %1, i64 %2) {
%4 = alloca %struct.sg_alloc_s*
%5 = alloca i8*
%6 = alloca i64
store %struct.sg_alloc_s* %0, %struct.sg_alloc_s** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i8* null
}

LLVM IR (-O2):
%struct.sg_alloc_s = type { i32 }
define noalias i8* @a_realloc(%struct.sg_alloc_s* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ __NR_linkat;
int syscall(int /*<<< orphan*/, int, char const *, int, char const *, int);
__attribute__((always_)) int _syscall_linkat(int olddirfd, const char *oldpath,
                                             int newdirfd, const char *newpath,
                                             int flags) {
  return syscall(__NR_linkat, olddirfd, oldpath, newdirfd, newpath, flags);
}


x86 assembly (clang, -O0):
<_syscall_linkat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_linkat>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_linkat = global i32 0
define i32 @_syscall_linkat(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* @__NR_linkat
%12 = load i32, i32* %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = call i32 @syscall(i32 %11, i32 %12, i8* %13, i32 %14, i8* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@__NR_linkat = global i32 0
define i32 @_syscall_linkat(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = load i32, i32* @__NR_linkat
%7 = tail call i32 @syscall(i32 %6, i32 %0, i8* %1, i32 %2, i8* %3, i32 %4)
ret i32 %7
}
void printsbuf(buf) char *buf;
{}


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

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

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

LLVM IR (-O2):
define void @printsbuf(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_parsepacket();
int parsepacket_timer(int tid, unsigned int tick, int id, void *data) {
  do_parsepacket();
  return 0;
}


x86 assembly (clang, -O0):
<parsepacket_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <do_parsepacket@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @parsepacket_timer(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = call i32 (...) @do_parsepacket()
ret i32 0
}

LLVM IR (-O2):
define i32 @parsepacket_timer(i32 %0, i32 %1, i32 %2, i8* nocapture readnone %3) {
%5 = tail call i32 (...) @do_parsepacket()
ret i32 0
}
/* Variables and functions */
int M_PI;
double radps_of_rpm(double rpm) { return (rpm * (2 * M_PI) / 60); }


x86 assembly (clang, -O0):
<radps_of_rpm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radps_of_rpm>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
divsd  0xee5(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @radps_of_rpm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = mul nsw i32 2, %4
%6 = sitofp i32 %5 to double
%7 = fmul double %3, %6
%8 = fdiv double %7, 6.000000e+01
ret double %8
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @radps_of_rpm(double %0) {
%2 = load i32, i32* @M_PI
%3 = shl nsw i32 %2, 1
%4 = sitofp i32 %3 to double
%5 = fmul double %4, %0
%6 = fdiv double %5, 6.000000e+01
ret double %6
}
/* Variables and functions */
int getVector(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char vector[5] = {'V', 'e', 't', 'o', 'r'};
  printf("%c", getVector(vector, 0));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
call   1030 <getVector@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x72,0x4(%rsp)
movl   $0x6f746556,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <getVector@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.vector = [5 x i8] c"Vetor"
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = call i32 @getVector(i8* %3, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vector = [5 x i8] c"Vetor"
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @getVector(i8* %2, i32 0)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ training_days();
int main() {
  printf("Enter the dates you will be training in the dd:mm:yy format\n");
  training_days();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [61 x i8] c"Enter the dates you will be training in the dd:mm:yy format\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @training_days()
ret i32 0
}

LLVM IR (-O2):
@str = [60 x i8] c"Enter the dates you will be training in the dd:mm:yy format\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @training_days()
ret i32 0
}
int test_imm_4Fint8_reg(signed char val) {
  return ((val) & (0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x4f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_4Fint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 79
%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_4Fint8_reg(i8 signext %0) {
%2 = and i8 %0, 79
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct unaligned_u32 {
  int dummy;
};

/* Variables and functions */
struct unaligned_u32 *unaligned_u32(const uint32_t *p) {
  return (struct unaligned_u32 *)p;
}


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

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

LLVM IR (-O0):
%struct.unaligned_u32 = type { i32 }
define %struct.unaligned_u32* @unaligned_u32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to %struct.unaligned_u32*
ret %struct.unaligned_u32* %4
}

LLVM IR (-O2):
%struct.unaligned_u32 = type { i32 }
define %struct.unaligned_u32* @unaligned_u32(i32* readnone %0) {
%2 = bitcast i32* %0 to %struct.unaligned_u32*
ret %struct.unaligned_u32* %2
}
void iowait(void) {
  asm volatile("jmp 1f\n\t"
               "1:\n\t"
               "jmp 1f\n\t"
               "1:\n\t");
}


x86 assembly (clang, -O0):
<iowait>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <iowait+0x9>
jmp    110e <iowait+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<iowait>:
jmp    1102 <iowait+0x2>
jmp    1104 <iowait+0x4>
ret

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

LLVM IR (-O2):
define void @iowait() {
tail call void asm sideeffect "jmp 1f\0A\091:\0A\09jmp 1f\0A\091:\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int m_count_canna_mode(int mode) {
  int ret = 0;
  while (mode) {
    mode = mode >> 4;
    ret++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<m_count_canna_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <m_count_canna_mode+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <m_count_canna_mode+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_count_canna_mode>:
xor    %eax,%eax
test   %edi,%edi
je     111d <m_count_canna_mode+0x1d>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    $0x4,%ecx
add    $0x1,%eax
cmp    $0xf,%edi
mov    %ecx,%edi
ja     1110 <m_count_canna_mode+0x10>
ret

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

LLVM IR (-O2):
define i32 @m_count_canna_mode(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 4
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 16
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int stub1(int, int);
int process(int x, int y, int (*fun)(int, int)) {
  int result;
  result = (*fun)(x, y);
  printf("%d\n", result);
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   *%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %rax
call   *%rdx
lea    0xee6(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @process(i32 %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = tail call i32 %2(i32 %0, i32 %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int drv_SL_list(void) {
  printf("generic vt100");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"generic vt100\00"
define i32 @drv_SL_list() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned long long int gnu_dev_makedev(unsigned int __major,
                                       unsigned int __minor) {
  return (unsigned long int)(__minor & (unsigned int)255 |
                             (__major & (unsigned int)4095) << 8) |
         (unsigned long long int)(__minor & (unsigned int)~255) << 12 |
         (unsigned long long int)(__major & (unsigned int)~4095) << 32;
}


x86 assembly (clang, -O0):
<gnu_dev_makedev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
and    $0xfff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,%eax
mov    -0x8(%rbp),%ecx
and    $0xffffff00,%ecx
mov    %ecx,%ecx
shl    $0xc,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%ecx
and    $0xfffff000,%ecx
mov    %ecx,%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnu_dev_makedev>:
movzbl %sil,%ecx
mov    %edi,%eax
shl    $0x8,%eax
and    $0xfff00,%eax
or     %ecx,%eax
and    $0xffffff00,%esi
shl    $0xc,%rsi
or     %rsi,%rax
and    $0xfffff000,%edi
shl    $0x20,%rdi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @gnu_dev_makedev(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 = and i32 %5, 255
%7 = load i32, i32* %3
%8 = and i32 %7, 4095
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
%11 = zext i32 %10 to i64
%12 = load i32, i32* %4
%13 = and i32 %12, -256
%14 = zext i32 %13 to i64
%15 = shl i64 %14, 12
%16 = or i64 %11, %15
%17 = load i32, i32* %3
%18 = and i32 %17, -4096
%19 = zext i32 %18 to i64
%20 = shl i64 %19, 32
%21 = or i64 %16, %20
ret i64 %21
}

LLVM IR (-O2):
define i64 @gnu_dev_makedev(i32 %0, i32 %1) {
%3 = and i32 %1, 255
%4 = shl i32 %0, 8
%5 = and i32 %4, 1048320
%6 = or i32 %3, %5
%7 = zext i32 %6 to i64
%8 = and i32 %1, -256
%9 = zext i32 %8 to i64
%10 = shl nuw nsw i64 %9, 12
%11 = or i64 %10, %7
%12 = and i32 %0, -4096
%13 = zext i32 %12 to i64
%14 = shl nuw i64 %13, 32
%15 = or i64 %11, %14
ret i64 %15
}
void *test_anti_range_53(unsigned short n) {
  extern void *alloc_anti_range_53(unsigned short)
      __attribute__((alloc_size(1)));
  if ((0x7fff * 2U + 1) - 1 <= n && n <= (0x7fff * 2U + 1) - 1)
    n = (0x7fff * 2U + 1) - 1 - 1;
  return alloc_anti_range_53(n);
}


x86 assembly (clang, -O0):
<test_anti_range_53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
mov    $0xfffe,%eax
cmp    %ecx,%eax
ja     1145 <test_anti_range_53+0x35>
movzwl -0x2(%rbp),%eax
cmp    $0xfffe,%eax
ja     1145 <test_anti_range_53+0x35>
movw   $0xfffd,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_53@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_53>:
cmp    $0xfffe,%di
mov    $0xfffd,%eax
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_53@plt>

LLVM IR (-O0):
define i8* @test_anti_range_53(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp ule i32 65534, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = icmp ule i32 %8, 65534
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -3, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_53(i16 zeroext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_53(i16 zeroext %0) {
%2 = icmp eq i16 %0, -2
%3 = select i1 %2, i16 -3, i16 %0
%4 = tail call i8* @alloc_anti_range_53(i16 zeroext %3)
ret i8* %4
}
/* Variables and functions */
int f1(int);
int f2(int x, int y) { return f1(x) + y; }


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

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %esi,%ebx
call   1030 <f1@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = tail call i32 @f1(i32 %0)
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ lucet_runtime_test_hostcall_yield_resume(int);
uint64_t f() { return lucet_runtime_test_hostcall_yield_resume(5); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <lucet_runtime_test_hostcall_yield_resume@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0x5,%edi
jmp    1030 <lucet_runtime_test_hostcall_yield_resume@plt>

LLVM IR (-O0):
define i32 @f() {
%1 = call i32 @lucet_runtime_test_hostcall_yield_resume(i32 5)
ret i32 %1
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 @lucet_runtime_test_hostcall_yield_resume(i32 5)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ acc_device_t;

/* Variables and functions */
int acc_on_device(int /*<<< orphan*/);
int Foo(acc_device_t x) { return acc_on_device(x); }


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

x86 assembly (clang, -O2):
<Foo>:
jmp    1030 <acc_on_device@plt>

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

LLVM IR (-O2):
define i32 @Foo(i32 %0) {
%2 = tail call i32 @acc_on_device(i32 %0)
ret i32 %2
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR4B_get(void) { return U_WMRCORENONE_get("U_WMR4B"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR4B\00"
define i32 @U_WMR4B_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR4B\00"
define i32 @U_WMR4B_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ is_non_cpg(char *, char *, int);
int is_cpg_restricted(char *sp1, char *sp2, int pos) {
  return !is_non_cpg(sp1, sp2, pos);
}


x86 assembly (clang, -O0):
<is_cpg_restricted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <is_non_cpg@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_cpg_restricted>:
push   %rax
call   1030 <is_non_cpg@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_cpg_restricted(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @is_non_cpg(i8* %7, i8* %8, i32 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_cpg_restricted(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @is_non_cpg(i8* %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ wctype(char *);
void uninitvar_wctype(void) {
  char *property;
  (void)wctype(property);
}


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

x86 assembly (clang, -O2):
<uninitvar_wctype>:
jmp    1030 <wctype@plt>

LLVM IR (-O0):
define void @uninitvar_wctype() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @wctype(i8* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wctype() {
%1 = tail call i32 @wctype(i8* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int show_menu() {
  printf("****************MENU*****************\n 	1. Write one page with "
         "random characters\n 	2. Read pages\n 	3. Seek to page "
         "offset\n 	4. Initialization all pages \n 	5. Exit\nSelect an "
         "operation for the EEPROM: ");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [200 x i8] c"****************MENU*****************\0A \091. Write one page with random characters\0A \092. Read pages\0A \093. Seek to page offset\0A \094. Initialization all pages \0A \095. Exit\0ASelect an operation for the EEPROM: \00"
define i32 @show_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [200 x i8] c"****************MENU*****************\0A \091. Write one page with random characters\0A \092. Read pages\0A \093. Seek to page offset\0A \094. Initialization all pages \0A \095. Exit\0ASelect an operation for the EEPROM: \00"
define i32 @show_menu() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int print(char **, int *);
int _sprintf_cdnopuxX(char *out, const char *format, ...) {
  register int *varg = (int *)(&format);
  return print(&out, varg);
}


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

x86 assembly (clang, -O2):
<_sprintf_cdnopuxX>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <print@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @_sprintf_cdnopuxX(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = bitcast i8** %4 to i32*
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = call i32 @print(i8** %3, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @_sprintf_cdnopuxX(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = bitcast i8** %4 to i32*
%6 = call i32 @print(i8** %3, i32* %5)
ret i32 %6
}