xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ vcall(float *, int);
void v4i(long int *vec) {
  float v[4];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  v[3] = vec[3];
  vcall(v, 4);
}


x86 assembly (clang, -O0):
<v4i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq 0x8(%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq 0x10(%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq 0x18(%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4i>:
sub    $0x18,%rsp
movdqu 0x10(%rdi),%xmm0
movq   %xmm0,%rax
cvtsi2ss %rax,%xmm1
movdqu (%rdi),%xmm2
pshufd $0xee,%xmm0,%xmm0
movq   %xmm0,%rax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movq   %xmm2,%rax
cvtsi2ss %rax,%xmm3
pshufd $0xee,%xmm2,%xmm2
movq   %xmm2,%rax
xorps  %xmm2,%xmm2
cvtsi2ss %rax,%xmm2
unpcklps %xmm0,%xmm1
unpcklps %xmm2,%xmm3
movlhps %xmm1,%xmm3
movaps %xmm3,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @v4i(i64* nocapture %0) {
%2 = alloca <4 x float>
%3 = bitcast <4 x float>* %2 to i8*
%4 = getelementptr inbounds <4 x float>, <4 x float>* %2, i64 0, i64 0
%5 = bitcast i64* %0 to <4 x i64>*
%6 = load <4 x i64>, <4 x i64>* %5
%7 = sitofp <4 x i64> %6 to <4 x float>
store <4 x float> %7, <4 x float>* %2
%8 = call i32 @vcall(float* %4, i32 4)
ret void
}
/* Variables and functions */
void *debugmalloc_realloc_full(void *, size_t, char *, char *, char *,
                               int /*<<< orphan*/);
void *debugmalloc_realloc(void *oldmem, size_t meret) {
  return debugmalloc_realloc_full(oldmem, meret, "realloc", "ismeretlen",
                                  "(ismeretlen)", 0);
}


x86 assembly (clang, -O0):
<debugmalloc_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
lea    0xed2(%rip),%rcx
lea    0xed6(%rip),%r8
xor    %r9d,%r9d
call   1030 <debugmalloc_realloc_full@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debugmalloc_realloc>:
lea    0xee9(%rip),%rdx
lea    0xeea(%rip),%rcx
lea    0xeee(%rip),%r8
xor    %r9d,%r9d
jmp    1030 <debugmalloc_realloc_full@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"realloc\00"
@.str.1 = [11 x i8] c"ismeretlen\00"
@.str.2 = [13 x i8] c"(ismeretlen)\00"
define i8* @debugmalloc_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @debugmalloc_realloc_full(i8* %5, i64 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret i8* %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"realloc\00"
@.str.1 = [11 x i8] c"ismeretlen\00"
@.str.2 = [13 x i8] c"(ismeretlen)\00"
define i8* @debugmalloc_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @debugmalloc_realloc_full(i8* %0, i64 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret i8* %3
}
/* Variables and functions */
unsigned int SEGGER_RTT_ReadNoLock(unsigned int, void *, unsigned int);
unsigned SEGGER_RTT_Read(unsigned BufferIndex, void *pBuffer,
                         unsigned BufferSize) {
  unsigned NumBytesRead;
  volatile unsigned SavedState;
  (void)(SavedState);
  NumBytesRead = SEGGER_RTT_ReadNoLock(BufferIndex, pBuffer, BufferSize);
  (void)(SavedState);
  return NumBytesRead;
}


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

x86 assembly (clang, -O2):
<SEGGER_RTT_Read>:
push   %rax
mov    0x4(%rsp),%eax
call   1030 <SEGGER_RTT_ReadNoLock@plt>
mov    0x4(%rsp),%ecx
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @SEGGER_RTT_Read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load volatile i32, i32* %4
%7 = tail call i32 @SEGGER_RTT_ReadNoLock(i32 %0, i8* %1, i32 %2)
%8 = load volatile i32, i32* %4
ret i32 %7
}
int getIndexInList(int element, int *arr, int len) {
  int i;
  for (i = 0; i < len; i++)
    if (arr[i] == element)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<getIndexInList>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <getIndexInList+0x53>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1140 <getIndexInList+0x40>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <getIndexInList+0x5a>
jmp    1145 <getIndexInList+0x45>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <getIndexInList+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIndexInList>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111e <getIndexInList+0x1e>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edi,(%rsi,%rcx,4)
je     111f <getIndexInList+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <getIndexInList+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getIndexInList(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%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 0, i32* %8
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i32*, i32** %6
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %5
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = load i32, i32* %8
store i32 %22, i32* %4
br label %28
23: ; preds = %13
br label %24
24: ; preds = %23
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %9
27: ; preds = %9
store i32 -1, i32* %4
br label %28
28: ; preds = %27, %21
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @getIndexInList(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Type definitions */
struct quat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ quat_slerp(float *, float *, float *, float);
__attribute__((always_)) struct quat *
psquat_slerp(struct quat *result, struct quat *a, struct quat *b, float p) {
  quat_slerp((float *)result, (float *)a, (float *)b, p);
  return result;
}


x86 assembly (clang, -O0):
<psquat_slerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movss  -0x1c(%rbp),%xmm0
call   1030 <quat_slerp@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psquat_slerp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <quat_slerp@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.quat = type { i32 }
define %struct.quat* @psquat_slerp(%struct.quat* %0, %struct.quat* %1, %struct.quat* %2, float %3) {
%5 = alloca %struct.quat*
%6 = alloca %struct.quat*
%7 = alloca %struct.quat*
%8 = alloca float
store %struct.quat* %0, %struct.quat** %5
store %struct.quat* %1, %struct.quat** %6
store %struct.quat* %2, %struct.quat** %7
store float %3, float* %8
%9 = load %struct.quat*, %struct.quat** %5
%10 = bitcast %struct.quat* %9 to float*
%11 = load %struct.quat*, %struct.quat** %6
%12 = bitcast %struct.quat* %11 to float*
%13 = load %struct.quat*, %struct.quat** %7
%14 = bitcast %struct.quat* %13 to float*
%15 = load float, float* %8
%16 = call i32 @quat_slerp(float* %10, float* %12, float* %14, float %15)
%17 = load %struct.quat*, %struct.quat** %5
ret %struct.quat* %17
}

LLVM IR (-O2):
%struct.quat = type { i32 }
define %struct.quat* @psquat_slerp(%struct.quat* returned %0, %struct.quat* %1, %struct.quat* %2, float %3) {
%5 = bitcast %struct.quat* %0 to float*
%6 = bitcast %struct.quat* %1 to float*
%7 = bitcast %struct.quat* %2 to float*
%8 = tail call i32 @quat_slerp(float* %5, float* %6, float* %7, float %3)
ret %struct.quat* %0
}
/* Variables and functions */
int /*<<< orphan*/ popviewport();
popviewport_() { popviewport(); }


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

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

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

LLVM IR (-O2):
define i32 @popviewport_() {
%1 = tail call i32 (...) @popviewport()
ret i32 undef
}
int s5pc1xx_pm_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @s5pc1xx_pm_init() {
ret i32 0
}
long arithmeticRightShift8L(long x) {
  long r = (unsigned long)x >> 8U;
  if (x < 0)
    r |= ~(~(unsigned long)0U >> 8U);
  return r;
}


x86 assembly (clang, -O0):
<arithmeticRightShift8L>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1131 <arithmeticRightShift8L+0x31>
movabs $0xff00000000000000,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arithmeticRightShift8L>:
mov    %rdi,%rcx
shr    $0x8,%rcx
movabs $0xff00000000000000,%rax
or     %rcx,%rax
test   %rdi,%rdi
cmovns %rcx,%rax
ret

LLVM IR (-O0):
define i64 @arithmeticRightShift8L(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 8
store i64 %5, i64* %3
%6 = load i64, i64* %2
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %3
%10 = or i64 %9, -72057594037927936
store i64 %10, i64* %3
br label %11
11: ; preds = %8, %1
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
define i64 @arithmeticRightShift8L(i64 %0) {
%2 = lshr i64 %0, 8
%3 = icmp slt i64 %0, 0
%4 = or i64 %2, -72057594037927936
%5 = select i1 %3, i64 %4, i64 %2
ret i64 %5
}
/* Variables and functions */
long mod_func(long, long);
long mod_func_or(long a, long b, long c) { return mod_func(a, b) | c; }


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

x86 assembly (clang, -O2):
<mod_func_or>:
push   %rbx
mov    %rdx,%rbx
call   1030 <mod_func@plt>
or     %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @mod_func_or(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 @mod_func(i64 %0, i64 %1)
%5 = or i64 %4, %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ blanks();
char ch();
int endst(void) {
  blanks();
  return (ch() == ';' || ch() == 0);
}


x86 assembly (clang, -O0):
<endst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <blanks@plt>
mov    $0x0,%al
call   1030 <ch@plt>
movsbl %al,%ecx
mov    $0x1,%al
cmp    $0x3b,%ecx
mov    %al,-0x1(%rbp)
je     115a <endst+0x3a>
mov    $0x0,%al
call   1030 <ch@plt>
movsbl %al,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endst>:
push   %rax
xor    %eax,%eax
call   1040 <blanks@plt>
xor    %eax,%eax
call   1030 <ch@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x3b,%cl
je     114b <endst+0x2b>
xor    %eax,%eax
call   1030 <ch@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %cl,%cl
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @endst() {
%1 = call i32 (...) @blanks()
%2 = call signext i8 (...) @ch()
%3 = sext i8 %2 to i32
%4 = icmp eq i32 %3, 59
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = call signext i8 (...) @ch()
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br label %9
9: ; preds = %5, %0
%10 = phi i1 [ true, %0 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @endst() {
%1 = tail call i32 (...) @blanks()
%2 = tail call signext i8 (...) @ch()
%3 = icmp eq i8 %2, 59
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call signext i8 (...) @ch()
%6 = icmp eq i8 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %0
%9 = phi i32 [ 1, %0 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ g(int);
void main() {
  f(4) + f(5);
  f(f(3));
  if (f(1))
    f(1);
  else
    f(2);
  if (1)
    g(1);
  else
    g(2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <f@plt>
mov    $0x5,%edi
call   1030 <f@plt>
mov    $0x3,%edi
call   1030 <f@plt>
mov    %eax,%edi
call   1030 <f@plt>
mov    $0x1,%edi
call   1030 <f@plt>
cmp    $0x0,%eax
je     116b <main+0x4b>
mov    $0x1,%edi
call   1030 <f@plt>
jmp    1175 <main+0x55>
mov    $0x2,%edi
call   1030 <f@plt>
mov    $0x1,%edi
call   1040 <g@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1030 <f@plt>
mov    $0x5,%edi
call   1030 <f@plt>
mov    $0x3,%edi
call   1030 <f@plt>
mov    %eax,%edi
call   1030 <f@plt>
mov    $0x1,%ebx
mov    $0x1,%edi
call   1030 <f@plt>
cmp    $0x1,%eax
adc    $0x0,%ebx
mov    %ebx,%edi
call   1030 <f@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1040 <g@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @f(i32 4)
%2 = call i32 @f(i32 5)
%3 = add nsw i32 %1, %2
%4 = call i32 @f(i32 3)
%5 = call i32 @f(i32 %4)
%6 = call i32 @f(i32 1)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @f(i32 1)
br label %12
10: ; preds = %0
%11 = call i32 @f(i32 2)
br label %12
12: ; preds = %10, %8
%13 = call i32 @g(i32 1)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @f(i32 4)
%2 = tail call i32 @f(i32 5)
%3 = tail call i32 @f(i32 3)
%4 = tail call i32 @f(i32 %3)
%5 = tail call i32 @f(i32 1)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 2, i32 1
%8 = tail call i32 @f(i32 %7)
%9 = tail call i32 @g(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int /*<<< orphan*/, int);
int /*<<< orphan*/ sw_occluded_fill(int, int);
void sw_occluded_fill_test(void **state) {
  assert_int_equal(sw_occluded_fill(0x0080200800000000ul, 0x00FFFFFFFFFFFF00ul),
                   0x008060381C0E0700ul);
}


x86 assembly (clang, -O0):
<sw_occluded_fill_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0xffffff00,%esi
call   1030 <sw_occluded_fill@plt>
mov    %eax,%edi
mov    $0x1c0e0700,%esi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sw_occluded_fill_test>:
push   %rax
xor    %edi,%edi
mov    $0xffffff00,%esi
call   1030 <sw_occluded_fill@plt>
mov    %eax,%edi
mov    $0x1c0e0700,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @sw_occluded_fill_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @sw_occluded_fill(i32 0, i32 -256)
%4 = call i32 @assert_int_equal(i32 %3, i32 470681344)
ret void
}

LLVM IR (-O2):
define void @sw_occluded_fill_test(i8** nocapture readnone %0) {
%2 = tail call i32 @sw_occluded_fill(i32 0, i32 -256)
%3 = tail call i32 @assert_int_equal(i32 %2, i32 470681344)
ret void
}
void nrf_802154_notification_init(void) {}


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

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

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

LLVM IR (-O2):
define void @nrf_802154_notification_init() {
ret void
}
/* Variables and functions */
unsigned long gfx_get_display_video_downscale_delta();
unsigned long redcloud_get_video_downscale_delta(void) {
  return (gfx_get_display_video_downscale_delta());
}


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

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

LLVM IR (-O0):
define i64 @redcloud_get_video_downscale_delta() {
%1 = call i64 (...) @gfx_get_display_video_downscale_delta()
ret i64 %1
}

LLVM IR (-O2):
define i64 @redcloud_get_video_downscale_delta() {
%1 = tail call i64 (...) @gfx_get_display_video_downscale_delta()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int foo1(char *out_var, int out_var_len, char *arg_0, int arg_0_len) {
  fprintf(stderr, "FOO1 %s\n", arg_0);
  strcpy(out_var, "test");
  return 4;
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xeb6(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
mov    $0x4,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    $0x4,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"FOO1 %s\0A\00"
@.str.1 = [5 x i8] c"test\00"
define i32 @foo1(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %7
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %5
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 4
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"FOO1 %s\0A\00"
@.str.1 = [5 x i8] c"test\00"
define i32 @foo1(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 4
}
int RPCFrom__run(void) { return 0; }


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

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

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

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

/* Variables and functions */
int syscall(int, struct timeval const *, int /*<<< orphan*/);
int settimeofday(const struct timeval *tv, void *tz) {
  return syscall(79, tv, 0);
}


x86 assembly (clang, -O0):
<settimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x4f,%edi
xor    %edx,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<settimeofday>:
mov    %rdi,%rsi
mov    $0x4f,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @settimeofday(%struct.timeval* %0, i8* %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = call i32 @syscall(i32 79, %struct.timeval* %5, i32 0)
ret i32 %6
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @settimeofday(%struct.timeval* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @syscall(i32 79, %struct.timeval* %0, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void restore_ap() { system("cp /root/wireless.ap.bak /root/wireless.ap"); }


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"cp /root/wireless.ap.bak /root/wireless.ap\00"
define void @restore_ap() {
%1 = call i32 @system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"cp /root/wireless.ap.bak /root/wireless.ap\00"
define void @restore_ap() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, float, float);
void printblobinfo(int start, int end, int bytes, float wins, float ent) {
  printf(" %.8x - %.8x | %8i | %7.2f | %f \n", start, end, bytes, wins, ent);
}


x86 assembly (clang, -O0):
<printblobinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printblobinfo>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c" %.8x - %.8x | %8i | %7.2f | %f \0A\00"
define void @printblobinfo(i32 %0, i32 %1, i32 %2, float %3, float %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
%10 = alloca float
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store float %3, float* %9
store float %4, float* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load float, float* %9
%15 = load float, float* %10
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13, float %14, float %15)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c" %.8x - %.8x | %8i | %7.2f | %f \0A\00"
define void @printblobinfo(i32 %0, i32 %1, i32 %2, float %3, float %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, float %3, float %4)
ret void
}
/* Variables and functions */
int rand();
int randInt(int min, int max) { return rand() % (max - min + 1) + min; }


x86 assembly (clang, -O0):
<randInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randInt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @randInt(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
void PrintObjectGetVarJN1(void *theEnv, const char *logicalName,
                          void *theValue) {}


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

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

LLVM IR (-O0):
define void @PrintObjectGetVarJN1(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @PrintObjectGetVarJN1(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int main() {
  int i = 9;
  printf("%p\n", &i);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x9,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 9, i32* %1
%3 = 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*/ errno;
int /*<<< orphan*/ printf(char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
void my_perror(const char *str) { printf("%s: %s\n", str, strerror(errno)); }


x86 assembly (clang, -O0):
<my_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_perror>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @my_perror(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
ret void
}
void swap(int array[], int left, int right) {
  int tmp = array[right];
  array[right] = array[left];
  array[left] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %edx,%rax
mov    (%rdi,%rax,4),%ecx
movslq %esi,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void SysTickDisable(void) {
  (*((volatile unsigned long *)(0xE000E010))) &= ~(0x00000001);
}


x86 assembly (clang, -O0):
<SysTickDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e010,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0xe000e010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTickDisable>:
mov    $0xe000e010,%eax
andq   $0xfffffffffffffffe,(%rax)
ret

LLVM IR (-O0):
define void @SysTickDisable() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysTickDisable() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
ret void
}
void foo290() {}


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

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

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

LLVM IR (-O2):
define void @foo290() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int imprimir(int n) { printf("%d", n); }


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

x86 assembly (clang, -O2):
<imprimir>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @imprimir(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @imprimir(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
int SetSocketNagleAlgorithm(const int fd __attribute__((__unused__)),
                            const int onoff __attribute__((__unused__))) {
  ;
  ;
  return (-1);
}


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

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

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

LLVM IR (-O2):
define i32 @SetSocketNagleAlgorithm(i32 %0, i32 %1) {
ret i32 -1
}
int f11b() {
  int x = 4;
  return ((((++x))));
}


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

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

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

LLVM IR (-O2):
define i32 @f11b() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 20, y;
  if (x > 9)
    y = 100;
  else
    y = 200;
  printf("value of y: %d\n", y);
  y = x > 9 ? 100 : 200;
  printf("value of y: %d\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jle    113c <main+0x2c>
movl   $0x64,-0xc(%rbp)
jmp    1143 <main+0x33>
movl   $0xc8,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edx
mov    $0xc8,%eax
mov    $0x64,%ecx
cmp    $0x9,%edx
cmovg  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"value of y: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 9
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 100, i32* %3
br label %8
7: ; preds = %0
store i32 200, i32* %3
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 9
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 100, i32 200
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"value of y: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
void func3(register int par) {}


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

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

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

LLVM IR (-O2):
define void @func3(i32 %0) {
ret void
}
int test_imm_CAuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xCA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CAuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 13238272
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ delete_function(unsigned int);
void clean_plotter(void) {
  for (unsigned int i = 0; i < 16; i++) {
    delete_function(i);
  }
}


x86 assembly (clang, -O0):
<clean_plotter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jae    113f <clean_plotter+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <delete_function@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <clean_plotter+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_plotter>:
push   %rax
xor    %edi,%edi
call   1030 <delete_function@plt>
mov    $0x1,%edi
call   1030 <delete_function@plt>
mov    $0x2,%edi
call   1030 <delete_function@plt>
mov    $0x3,%edi
call   1030 <delete_function@plt>
mov    $0x4,%edi
call   1030 <delete_function@plt>
mov    $0x5,%edi
call   1030 <delete_function@plt>
mov    $0x6,%edi
call   1030 <delete_function@plt>
mov    $0x7,%edi
call   1030 <delete_function@plt>
mov    $0x8,%edi
call   1030 <delete_function@plt>
mov    $0x9,%edi
call   1030 <delete_function@plt>
mov    $0xa,%edi
call   1030 <delete_function@plt>
mov    $0xb,%edi
call   1030 <delete_function@plt>
mov    $0xc,%edi
call   1030 <delete_function@plt>
mov    $0xd,%edi
call   1030 <delete_function@plt>
mov    $0xe,%edi
call   1030 <delete_function@plt>
mov    $0xf,%edi
pop    %rax
jmp    1030 <delete_function@plt>

LLVM IR (-O0):
define void @clean_plotter() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp ult i32 %3, 16
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @delete_function(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @clean_plotter() {
%1 = tail call i32 @delete_function(i32 0)
%2 = tail call i32 @delete_function(i32 1)
%3 = tail call i32 @delete_function(i32 2)
%4 = tail call i32 @delete_function(i32 3)
%5 = tail call i32 @delete_function(i32 4)
%6 = tail call i32 @delete_function(i32 5)
%7 = tail call i32 @delete_function(i32 6)
%8 = tail call i32 @delete_function(i32 7)
%9 = tail call i32 @delete_function(i32 8)
%10 = tail call i32 @delete_function(i32 9)
%11 = tail call i32 @delete_function(i32 10)
%12 = tail call i32 @delete_function(i32 11)
%13 = tail call i32 @delete_function(i32 12)
%14 = tail call i32 @delete_function(i32 13)
%15 = tail call i32 @delete_function(i32 14)
%16 = tail call i32 @delete_function(i32 15)
ret void
}
/* Variables and functions */
scalar_t__ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                   int /*<<< orphan*/);
int fork() { return (int)syscall(120, 0, 0, 0); }


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
mov    $0x78,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
mov    $0x78,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @fork() {
%1 = call i64 @syscall(i32 120, i32 0, i32 0, i32 0)
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @fork() {
%1 = tail call i64 @syscall(i32 120, i32 0, i32 0, i32 0)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int atoi(char *);
char *strchr(char *, char);
int ParseNumber(char *text) {
  char *begin, *end;
  begin = (text + 1);
  end = strchr(begin, ']');
  *end = '\0';
  *text = '\0';
  return atoi(begin);
}


x86 assembly (clang, -O0):
<ParseNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseNumber>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x1(%rdi),%r14
mov    %r14,%rdi
mov    $0x5d,%esi
call   1030 <strchr@plt>
movb   $0x0,(%rax)
movb   $0x0,(%rbx)
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <atoi@plt>

LLVM IR (-O0):
define i32 @ParseNumber(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @strchr(i8* %7, i8 signext 93)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
store i8 0, i8* %9
%10 = load i8*, i8** %2
store i8 0, i8* %10
%11 = load i8*, i8** %3
%12 = call i32 @atoi(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @ParseNumber(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i8* @strchr(i8* %2, i8 signext 93)
store i8 0, i8* %3
store i8 0, i8* %0
%4 = tail call i32 @atoi(i8* %2)
ret i32 %4
}
void fd118(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  a:
    goto a;
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd118>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd118+0x7>

x86 assembly (clang, -O2):
<fd118>:
jmp    1100 <fd118>

LLVM IR (-O0):
define void @fd118(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; preds = %23
br label %23
24: ; No predecessors!
%25 = load i32, i32* %2
%26 = zext i32 %25 to i64
br label %27
27: ; preds = %27, %24
br label %27
28: ; No predecessors!
%29 = load i32, i32* %2
%30 = zext i32 %29 to i64
br label %31
31: ; preds = %31, %28
br label %31
32: ; preds = %32
br label %32
33: ; No predecessors!
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %36, %33
br label %36
37: ; preds = %37
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %41, %38
br label %41
42: ; preds = %42
br label %42
43: ; No predecessors!
%44 = load i32, i32* %2
%45 = zext i32 %44 to i64
br label %46
46: ; preds = %46, %43
br label %46
47: ; preds = %47
br label %47
}

LLVM IR (-O2):
define void @fd118(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ ReadUint64Be(void const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(double *, int /*<<< orphan*/ *, int);
int32_t ReadDoubleBe(const void *in, double *value) {
  uint64_t u64;
  int32_t length = ReadUint64Be(in, &u64);
  memcpy(value, &u64, sizeof(*value));
  return length;
}


x86 assembly (clang, -O0):
<ReadDoubleBe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <ReadUint64Be@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadDoubleBe>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%r14
mov    %r14,%rsi
call   1030 <ReadUint64Be@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ReadDoubleBe(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store double* %1, double** %4
%7 = load i8*, i8** %3
%8 = call i32 @ReadUint64Be(i8* %7, i32* %5)
store i32 %8, i32* %6
%9 = load double*, double** %4
%10 = call i32 @memcpy(double* %9, i32* %5, i32 8)
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
define i32 @ReadDoubleBe(i8* %0, double* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @ReadUint64Be(i8* %0, i32* %3)
%6 = call i32 @memcpy(double* %1, i32* %3, i32 8)
ret i32 %5
}