xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/ const);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void serial_int16(uint8_t **const ptr, const int16_t v) {
  int16_t vo = htons(v);
  memcpy(*ptr, &vo, sizeof vo);
  *ptr += sizeof vo;
}


x86 assembly (clang, -O0):
<serial_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_int16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
mov    (%rbx),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
addq   $0x10,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @serial_int16(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @htons(i32 %6)
store i32 %7, i32* %5
%8 = load i32**, i32*** %3
%9 = load i32*, i32** %8
%10 = call i32 @memcpy(i32* %9, i32* %5, i32 4)
%11 = load i32**, i32*** %3
%12 = load i32*, i32** %11
%13 = getelementptr inbounds i32, i32* %12, i64 4
store i32* %13, i32** %11
ret void
}

LLVM IR (-O2):
define void @serial_int16(i32** nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htons(i32 %1)
store i32 %5, i32* %3
%6 = load i32*, i32** %0
%7 = call i32 @memcpy(i32* %6, i32* %3, i32 4)
%8 = load i32*, i32** %0
%9 = getelementptr inbounds i32, i32* %8, i64 4
store i32* %9, i32** %0
ret void
}
/* Variables and functions */
double cos(double);
int /*<<< orphan*/ sin(double);
int /*<<< orphan*/ vcopy(double *, double *);
int /*<<< orphan*/ vnormal(double *);
int /*<<< orphan*/ vscale(double *, int /*<<< orphan*/);
void axis_to_quat(double a[3], double phi, double q[4]) {
  vnormal(a);
  vcopy(a, q);
  vscale(q, sin(phi / 2.0));
  q[3] = cos(phi / 2.0);
}


x86 assembly (clang, -O0):
<axis_to_quat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vnormal@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <vcopy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe70(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1060 <vscale@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe4f(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <cos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<axis_to_quat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
movsd  %xmm0,(%rsp)
mov    %rdi,%rbx
call   1030 <vnormal@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <vcopy@plt>
movsd  (%rsp),%xmm0
mulsd  0xe84(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   1040 <sin@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <vscale@plt>
movsd  (%rsp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,0x18(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @axis_to_quat(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 = call i32 @vnormal(double* %7)
%9 = load double*, double** %4
%10 = load double*, double** %6
%11 = call i32 @vcopy(double* %9, double* %10)
%12 = load double*, double** %6
%13 = load double, double* %5
%14 = fdiv double %13, 2.000000e+00
%15 = call i32 @sin(double %14)
%16 = call i32 @vscale(double* %12, i32 %15)
%17 = load double, double* %5
%18 = fdiv double %17, 2.000000e+00
%19 = call double @cos(double %18)
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 3
store double %19, double* %21
ret void
}

LLVM IR (-O2):
define void @axis_to_quat(double* %0, double %1, double* %2) {
%4 = tail call i32 @vnormal(double* %0)
%5 = tail call i32 @vcopy(double* %0, double* %2)
%6 = fmul double %1, 5.000000e-01
%7 = tail call i32 @sin(double %6)
%8 = tail call i32 @vscale(double* %2, i32 %7)
%9 = tail call double @cos(double %6)
%10 = getelementptr inbounds double, double* %2, i64 3
store double %9, double* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ultoa(int, char *, int /*<<< orphan*/);
char *itoa(int a, char *buffer, uint8_t radix) {
  if (a < 0) {
    *buffer = '-';
    a = -a;
  }
  ultoa(a, buffer + 1, radix);
  return buffer;
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113b <itoa+0x2b>
mov    -0x10(%rbp),%rax
movb   $0x2d,(%rax)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x14(%rbp),%edx
call   1030 <ultoa@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
mov    %rsi,%rbx
test   %edi,%edi
jns    111d <itoa+0xd>
movb   $0x2d,(%rbx)
neg    %edi
lea    0x1(%rbx),%rsi
call   1030 <ultoa@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @itoa(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 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %5
store i8 45, i8* %10
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
store i32 %12, i32* %4
br label %13
13: ; preds = %9, %3
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i32, i32* %6
%18 = call i32 @ultoa(i32 %14, i8* %16, i32 %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @itoa(i32 %0, i8* returned %1, i32 %2) {
%4 = icmp slt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
store i8 45, i8* %1
%6 = sub nsw i32 0, %0
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %6, %5 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %1, i64 1
%10 = tail call i32 @ultoa(i32 %8, i8* %9, i32 %2)
ret i8* %1
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ xcb_get_selection_owner_reply_t;
struct TYPE_3__ {
  int /*<<< orphan*/ sequence;
};
typedef TYPE_1__ xcb_get_selection_owner_cookie_t;
typedef int /*<<< orphan*/ xcb_generic_error_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
scalar_t__ __xcb_wait_for_event_timeo(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                      int /*<<< orphan*/ **, int);
xcb_get_selection_owner_reply_t *
xcb_get_selection_owner_reply_timeo(xcb_connection_t *c,
                                    xcb_get_selection_owner_cookie_t cookie,
                                    xcb_generic_error_t **e) {
  return (xcb_get_selection_owner_reply_t *)__xcb_wait_for_event_timeo(
      c, cookie.sequence, e, 50);
}


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

x86 assembly (clang, -O2):
<xcb_get_selection_owner_reply_timeo>:
mov    $0x32,%ecx
jmp    1030 <__xcb_wait_for_event_timeo@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32* @xcb_get_selection_owner_reply_timeo(i32* %0, i32 %1, i32** %2) {
%4 = alloca %struct.TYPE_3__
%5 = alloca i32*
%6 = alloca i32**
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 0
store i32 %1, i32* %7
store i32* %0, i32** %5
store i32** %2, i32*** %6
%8 = load i32*, i32** %5
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = load i32**, i32*** %6
%12 = call i64 @__xcb_wait_for_event_timeo(i32* %8, i32 %10, i32** %11, i32 50)
%13 = inttoptr i64 %12 to i32*
ret i32* %13
}

LLVM IR (-O2):
define i32* @xcb_get_selection_owner_reply_timeo(i32* %0, i32 %1, i32** %2) {
%4 = tail call i64 @__xcb_wait_for_event_timeo(i32* %0, i32 %1, i32** %2, i32 50)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long member_0;
  long member_1;
};
typedef TYPE_1__ ldiv_t;

/* Variables and functions */
ldiv_t ldiv(long a, long b) {
  ldiv_t ret = {a / b, a % b};
  return ret;
}


x86 assembly (clang, -O0):
<ldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <ldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = sdiv i64 %7, %8
store i64 %9, i64* %6
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = srem i64 %11, %12
store i64 %13, i64* %10
%14 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%15 = load { i64, i64 }, { i64, i64 }* %14
ret { i64, i64 } %15
}

LLVM IR (-O2):
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = srem i64 %0, %1
%5 = insertvalue { i64, i64 } poison, i64 %3, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
adr0adrx1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*((short *)10000000)) = (((short *)11111111)[x1]); }


x86 assembly (clang, -O0):
<adr0adrx1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,2),%cx
mov    $0x989680,%eax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adrx1_set>:
movslq %ecx,%rax
movzwl 0xa98ac7(%rax,%rax,1),%eax
mov    %ax,0x989680
ret

LLVM IR (-O0):
define i32 @adr0adrx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %17
%19 = load i16, i16* %18
store i16 %19, i16* inttoptr (i64 10000000 to i16*)
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @adr0adrx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %7
%9 = load i16, i16* %8
store i16 %9, i16* inttoptr (i64 10000000 to i16*)
ret i32 undef
}
int is_whitespace(char c) { return ((c == ' ') || (c == '\n') || (c == '\t')); }


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_whitespace+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_whitespace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
mov    $0x1,%eax
cmp    $0xa,%dil
je     1111 <is_whitespace+0x11>
cmp    $0x20,%dil
jne    1112 <is_whitespace+0x12>
ret
xor    %eax,%eax
cmp    $0x9,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 10
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 9
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ kernel_main(unsigned int, unsigned int, unsigned int);
void _cstartup(unsigned int r0, unsigned int r1, unsigned int r2) {
  kernel_main(r0, r1, r2);
}


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

x86 assembly (clang, -O2):
<_cstartup>:
jmp    1030 <kernel_main@plt>

LLVM IR (-O0):
define void @_cstartup(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 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @kernel_main(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @_cstartup(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @kernel_main(i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mob_read_randommonster();
int /*<<< orphan*/ mob_readdb();
int /*<<< orphan*/ mob_readdb_mobavail();
int /*<<< orphan*/ mob_readskilldb();
int /*<<< orphan*/ mob_readtalkdb();
void mob_reload(void) {
  mob_readdb();
  mob_readdb_mobavail();
  mob_read_randommonster();
  mob_readtalkdb();
  mob_readskilldb();
}


x86 assembly (clang, -O0):
<mob_reload>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <mob_readdb@plt>
mov    $0x0,%al
call   1050 <mob_readdb_mobavail@plt>
mov    $0x0,%al
call   1060 <mob_read_randommonster@plt>
mov    $0x0,%al
call   1070 <mob_readtalkdb@plt>
mov    $0x0,%al
call   1030 <mob_readskilldb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mob_reload>:
push   %rax
xor    %eax,%eax
call   1040 <mob_readdb@plt>
xor    %eax,%eax
call   1050 <mob_readdb_mobavail@plt>
xor    %eax,%eax
call   1060 <mob_read_randommonster@plt>
xor    %eax,%eax
call   1070 <mob_readtalkdb@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mob_readskilldb@plt>

LLVM IR (-O0):
define void @mob_reload() {
%1 = call i32 (...) @mob_readdb()
%2 = call i32 (...) @mob_readdb_mobavail()
%3 = call i32 (...) @mob_read_randommonster()
%4 = call i32 (...) @mob_readtalkdb()
%5 = call i32 (...) @mob_readskilldb()
ret void
}

LLVM IR (-O2):
define void @mob_reload() {
%1 = tail call i32 (...) @mob_readdb()
%2 = tail call i32 (...) @mob_readdb_mobavail()
%3 = tail call i32 (...) @mob_read_randommonster()
%4 = tail call i32 (...) @mob_readtalkdb()
%5 = tail call i32 (...) @mob_readskilldb()
ret void
}
/* Variables and functions */
double get_time_of_day_in_secs();
double get_elapsed_time_in_secs(double start_time) {
  double now_in_secs = get_time_of_day_in_secs();
  return (now_in_secs - start_time);
}


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

x86 assembly (clang, -O2):
<get_elapsed_time_in_secs>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <get_time_of_day_in_secs@plt>
subsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @get_elapsed_time_in_secs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call double (...) @get_time_of_day_in_secs()
store double %4, double* %3
%5 = load double, double* %3
%6 = load double, double* %2
%7 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @get_elapsed_time_in_secs(double %0) {
%2 = tail call double (...) @get_time_of_day_in_secs()
%3 = fsub double %2, %0
ret double %3
}
void rop3_15_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = ~T;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_15_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_15_0_1>:
not    %sil
and    %dl,%sil
not    %dl
and    (%rdi),%sil
or     %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_15_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = xor i32 %9, -1
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
%12 = load i8, i8* %7
%13 = zext i8 %12 to i32
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = and i32 %13, %15
%17 = load i8, i8* %7
%18 = zext i8 %17 to i32
%19 = load i8, i8* %6
%20 = zext i8 %19 to i32
%21 = xor i32 %20, -1
%22 = and i32 %18, %21
%23 = or i32 %16, %22
%24 = load i8, i8* %6
%25 = zext i8 %24 to i32
%26 = load i8, i8* %5
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = and i32 %25, %28
%30 = load i8*, i8** %4
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = and i32 %29, %32
%34 = or i32 %23, %33
%35 = trunc i32 %34 to i8
%36 = load i8*, i8** %4
store i8 %35, i8* %36
ret void
}

LLVM IR (-O2):
define void @rop3_15_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = xor i8 %1, -1
%6 = and i8 %5, %2
%7 = load i8, i8* %0
%8 = and i8 %6, %7
%9 = or i8 %8, %4
store i8 %9, i8* %0
ret void
}
void ConvertAll(void) {}


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

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

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

LLVM IR (-O2):
define void @ConvertAll() {
ret void
}
int swap_be32(int x) {
  return ((x >> 24) & 0x000000ff) | ((x << 24) & 0xff000000) |
         ((x >> 8) & 0x0000ff00) | ((x << 8) & 0x00ff0000);
}


x86 assembly (clang, -O0):
<swap_be32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_be32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @swap_be32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 24
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = shl i32 %6, 24
%8 = and i32 %7, -16777216
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = ashr i32 %10, 8
%12 = and i32 %11, 65280
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = shl i32 %14, 8
%16 = and i32 %15, 16711680
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @swap_be32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ *sem_open(char const *, int, int /*<<< orphan*/,
                             unsigned int);
extern sem_t *_swift_Glibc_sem_open4(const char *name, int oflag, mode_t mode,
                                     unsigned int value) {
  return sem_open(name, oflag, mode, value);
}


x86 assembly (clang, -O0):
<_swift_Glibc_sem_open4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <sem_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swift_Glibc_sem_open4>:
jmp    1030 <sem_open@plt>

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

LLVM IR (-O2):
define i32* @_swift_Glibc_sem_open4(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32* @sem_open(i8* %0, i32 %1, i32 %2, i32 %3)
ret i32* %5
}
/* Variables and functions */
int syscall(int);
int inotify_init(void) { return syscall(253); }


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

x86 assembly (clang, -O2):
<inotify_init>:
mov    $0xfd,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @inotify_init() {
%1 = call i32 @syscall(i32 253)
ret i32 %1
}

LLVM IR (-O2):
define i32 @inotify_init() {
%1 = tail call i32 @syscall(i32 253)
ret i32 %1
}
void init_sys_tick() {
  (*(volatile unsigned long *)0xe000e010) = 0;
  (*(volatile unsigned long *)0xe000e014) = 0x00ffffff;
  (*(volatile unsigned long *)0xe000e018) = 0;
  (*(volatile unsigned long *)0xe000ed20) =
      ((*(volatile unsigned long *)0xe000ed20) & 0x00FFFFFF) | 0x40000000;
  (*(volatile unsigned long *)0xe000e010) = 0x00000007;
}


x86 assembly (clang, -O0):
<init_sys_tick>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e010,%eax
movq   $0x0,(%rax)
mov    $0xe000e014,%eax
movq   $0xffffff,(%rax)
mov    $0xe000e018,%eax
movq   $0x0,(%rax)
mov    $0xe000ed20,%eax
mov    (%rax),%rcx
and    $0xffffff,%rcx
or     $0x40000000,%rcx
mov    $0xe000ed20,%eax
mov    %rcx,(%rax)
mov    $0xe000e010,%eax
movq   $0x7,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_sys_tick>:
mov    $0xe000e010,%eax
movq   $0x0,(%rax)
movq   $0xffffff,0x4(%rax)
movq   $0x0,0x8(%rax)
mov    0xd10(%rax),%rcx
and    $0xffffff,%ecx
or     $0x40000000,%rcx
mov    %rcx,0xd10(%rax)
movq   $0x7,(%rax)
ret

LLVM IR (-O0):
define void @init_sys_tick() {
store volatile i64 0, i64* inttoptr (i64 3758153744 to i64*)
store volatile i64 16777215, i64* inttoptr (i64 3758153748 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758153752 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 3758157088 to i64*)
%2 = and i64 %1, 16777215
%3 = or i64 %2, 1073741824
store volatile i64 %3, i64* inttoptr (i64 3758157088 to i64*)
store volatile i64 7, i64* inttoptr (i64 3758153744 to i64*)
ret void
}

LLVM IR (-O2):
define void @init_sys_tick() {
store volatile i64 0, i64* inttoptr (i64 3758153744 to i64*)
store volatile i64 16777215, i64* inttoptr (i64 3758153748 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758153752 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 3758157088 to i64*)
%2 = and i64 %1, 16777215
%3 = or i64 %2, 1073741824
store volatile i64 %3, i64* inttoptr (i64 3758157088 to i64*)
store volatile i64 7, i64* inttoptr (i64 3758153744 to i64*)
ret void
}
int not_picked1() { return 1; }


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

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

LLVM IR (-O0):
define i32 @not_picked1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @not_picked1() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ext_stream_restore_test() {
  printf("NOT IMPLEMENTED:"
         "pa_ext_stream_restore_test"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_ext_stream_restore_test\00"
define i32 @pa_ext_stream_restore_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int dal_reg_tbl_read(unsigned int, unsigned int, unsigned int *, unsigned int);
int ingress_reg_tbl_get(unsigned int dev_id, unsigned int reg_addr,
                        unsigned int *pvalue, unsigned int width) {
  return dal_reg_tbl_read(dev_id, reg_addr + 0x100000, pvalue, width);
}


x86 assembly (clang, -O0):
<ingress_reg_tbl_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x100000,%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <dal_reg_tbl_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ingress_reg_tbl_get>:
add    $0x100000,%esi
jmp    1030 <dal_reg_tbl_read@plt>

LLVM IR (-O0):
define i32 @ingress_reg_tbl_get(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add i32 %10, 1048576
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = call i32 @dal_reg_tbl_read(i32 %9, i32 %11, i32* %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @ingress_reg_tbl_get(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = add i32 %1, 1048576
%6 = tail call i32 @dal_reg_tbl_read(i32 %0, i32 %5, i32* %2, i32 %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_metadata_array_get_value() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_metadata_array_get_value>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_metadata_array_get_value() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_metadata_array_get_value() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char *indent(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, int const, int const, int const,
                          int const);
void mp4tree_box_frma_print(const uint8_t *p, size_t len, int depth) {
  printf("%s  Data Format: %c%c%c%c\n", indent(depth, 0), p[0], p[1], p[2],
         p[3]);
}


x86 assembly (clang, -O0):
<mp4tree_box_frma_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1040 <indent@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r9d
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp4tree_box_frma_print>:
push   %rbx
mov    %rdi,%rbx
mov    %edx,%edi
xor    %esi,%esi
call   1040 <indent@plt>
mov    (%rbx),%edx
mov    0x4(%rbx),%ecx
mov    0x8(%rbx),%r8d
mov    0xc(%rbx),%r9d
lea    0xebf(%rip),%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%s Data Format: %c%c%c%c\0A\00"
define void @mp4tree_box_frma_print(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = call i8* @indent(i32 %7, i32 0)
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %11, i32 %14, i32 %17, i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s Data Format: %c%c%c%c\0A\00"
define void @mp4tree_box_frma_print(i32* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i8* @indent(i32 %2, i32 0)
%5 = load i32, i32* %0
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %0, i64 3
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %5, i32 %7, i32 %9, i32 %11)
ret void
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
scalar_t__ strcat(scalar_t__, char *);
scalar_t__ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *extend_re(char *s) {
  char *s1;
  s1 = (char *)malloc((unsigned)strlen(s) + 4 + 1);
  return (char *)strcat(strcat(strcpy(s1, ".*("), s), ")");
}


x86 assembly (clang, -O0):
<extend_re>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
add    $0x4,%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1060 <strcat@plt>
mov    %rax,%rdi
lea    0xe78(%rip),%rsi
call   1060 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extend_re>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x5(%rax),%edi
call   1050 <malloc@plt>
lea    0xea8(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1060 <strcat@plt>
lea    0xe92(%rip),%rsi
mov    %rax,%rdi
pop    %rbx
jmp    1060 <strcat@plt>

LLVM IR (-O0):
@.str = [4 x i8] c".*(\00"
@.str.1 = [2 x i8] c")\00"
define i8* @extend_re(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = trunc i64 %5 to i32
%7 = add i32 %6, 4
%8 = add i32 %7, 1
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i64 @strcpy(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %2
%14 = call i64 @strcat(i64 %12, i8* %13)
%15 = call i64 @strcat(i64 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = inttoptr i64 %15 to i8*
ret i8* %16
}

LLVM IR (-O2):
@.str = [4 x i8] c".*(\00"
@.str.1 = [2 x i8] c")\00"
define i8* @extend_re(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 5
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @strcpy(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = tail call i64 @strcat(i64 %7, i8* %0)
%9 = tail call i64 @strcat(i64 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ fib(unsigned int *, int);
int /*<<< orphan*/ myprint(unsigned int *, int);
int main() {
  unsigned int buf[100];
  fib(buf, 100);
  myprint(buf, 100);
  return (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    $0x64,%esi
call   1040 <fib@plt>
lea    -0x1a0(%rbp),%rdi
mov    $0x64,%esi
call   1030 <myprint@plt>
mov    $0x1,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x190,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <fib@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <myprint@plt>
mov    $0x1,%eax
add    $0x190,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%4 = call i32 @fib(i32* %3, i32 100)
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%6 = call i32 @myprint(i32* %5, i32 100)
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%4 = call i32 @fib(i32* %3, i32 100)
%5 = call i32 @myprint(i32* %3, i32 100)
ret i32 1
}
char encoder_raw(char byte) { return (byte); }


x86 assembly (clang, -O0):
<encoder_raw>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encoder_raw>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @encoder_raw(i8 returned signext %0) {
ret i8 %0
}
double quadint_min(double *data, int len, int pos, int span) {
  double real_pos;
  real_pos = (double)pos;
  return (double)real_pos;
}


x86 assembly (clang, -O0):
<quadint_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadint_min>:
cvtsi2sd %edx,%xmm0
ret

LLVM IR (-O0):
define double @quadint_min(double* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
store double* %0, double** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = sitofp i32 %10 to double
store double %11, double* %9
%12 = load double, double* %9
ret double %12
}

LLVM IR (-O2):
define double @quadint_min(double* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = sitofp i32 %2 to double
ret double %5
}
/* Variables and functions */
int bar(char *, int);
int foo(int n) {
  if (n) {
    char A[10];
    return bar(A, 1);
  } else {
    char A[20];
    return bar(A, 2);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113b <foo+0x2b>
lea    -0x12(%rbp),%rdi
mov    $0x1,%esi
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
jmp    114c <foo+0x3c>
lea    -0x30(%rbp),%rdi
mov    $0x2,%esi
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x18,%rsp
test   %edi,%edi
je     1122 <foo+0x12>
mov    %rsp,%rdi
mov    $0x1,%esi
jmp    112a <foo+0x1a>
mov    %rsp,%rdi
mov    $0x2,%esi
call   1030 <bar@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i8]
%5 = alloca [20 x i8]
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%10 = call i32 @bar(i8* %9, i32 1)
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%13 = call i32 @bar(i8* %12, i32 2)
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = alloca [10 x i8]
%3 = alloca [20 x i8]
%4 = icmp eq i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @bar(i8* %6, i32 1)
br label %11
8: ; preds = %1
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%10 = call i32 @bar(i8* %9, i32 2)
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ %7, %5 ], [ %10, %8 ]
ret i32 %12
}
int sePuedeSwapArriba(int iPosicionConflicto) { return iPosicionConflicto - 1; }


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

x86 assembly (clang, -O2):
<sePuedeSwapArriba>:
lea    -0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @sePuedeSwapArriba(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ daxpy_(int *, double *, double *, int *, double *, int *);
void daxpy(int n, double alpha, double *x, int incx, double *y, int incy) {
  daxpy_(&n, &alpha, x, &incx, y, &incy);
}


x86 assembly (clang, -O0):
<daxpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%r8
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
lea    -0x2c(%rbp),%r9
call   1030 <daxpy_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daxpy>:
sub    $0x18,%rsp
mov    %rcx,%r10
mov    %rsi,%rax
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %edx,0x8(%rsp)
mov    %r8d,0x4(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r9
mov    %rax,%rdx
mov    %r10,%r8
call   1030 <daxpy_@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @daxpy(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %7
store double %1, double* %8
store i32 %3, i32* %9
store i32 %5, i32* %10
%11 = call i32 @daxpy_(i32* %7, double* %8, double* %2, i32* %9, double* %4, i32* %10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t __be32_to_cpu(uint32_t val) { return val; }


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

x86 assembly (clang, -O2):
<__be32_to_cpu>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @__be32_to_cpu(i32 returned %0) {
ret i32 %0
}
int test_imm_1Euint8_reg(unsigned char val) {
  return ((val) & (0x1E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Euint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%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_1Euint8_reg>:
test   $0x1e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Euint8_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, 30
%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_1Euint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 30
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void RTLogComPrintf(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogComPrintf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void speex_warning(const char *str) { fprintf(stderr, "warning: %s\n", str); }


x86 assembly (clang, -O0):
<speex_warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<speex_warning>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"warning: %s\0A\00"
define void @speex_warning(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void __cdbgui_setup(int sample_count) { (void)(sample_count); }


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

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

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

LLVM IR (-O2):
define void @__cdbgui_setup(i32 %0) {
ret void
}
int my_find_prime_sup(int nb) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @my_find_prime_sup(i32 %0) {
ret i32 0
}
/* Type definitions */
struct dnsresp {
  int dummy;
};

/* Variables and functions */
char *_resolv_v6_ghbn2(char *raddr, struct dnsresp *d_resp, char *extra) {
  return NULL;
}


x86 assembly (clang, -O0):
<_resolv_v6_ghbn2>:
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):
<_resolv_v6_ghbn2>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.dnsresp = type { i32 }
define noalias i8* @_resolv_v6_ghbn2(i8* nocapture readnone %0, %struct.dnsresp* nocapture readnone %1, i8* nocapture readnone %2) {
ret i8* null
}
int main(void) {
  int a;
  float b, y, f;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int foo(int k) {
  while (k < 100) {
    int i = 0;
    int j = k;
    while (i < j) {
      i = i + 1;
      j = j - 1;
    }
    k = k + 1;
  }
  return k;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    114f <foo+0x4f>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1141 <foo+0x41>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111e <foo+0x1e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <foo+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x65,%edi
mov    $0x64,%eax
cmovge %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %19, %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %22
8: ; preds = %5
store i32 0, i32* %3
%9 = load i32, i32* %2
store i32 %9, i32* %4
br label %10
10: ; preds = %14, %8
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %4
br label %10
19: ; preds = %10
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %5
22: ; preds = %5
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp sgt i32 %0, 100
%3 = select i1 %2, i32 %0, i32 100
ret i32 %3
}