xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _qspaint(int *, int, int, int *);
void qsortint(int *a, int b, int e) {
  int p;
  if (b < e) {
    _qspaint(a, b, e, &p);
    qsortint(a, b, p - 1);
    qsortint(a, p + 1, e);
  }
}


x86 assembly (clang, -O0):
<qsortint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1175 <qsortint+0x55>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x14(%rbp),%rcx
call   1030 <_qspaint@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <qsortint@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <qsortint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsortint>:
cmp    %edx,%esi
jge    1167 <qsortint+0x47>
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xc(%rsp),%rcx
call   1030 <_qspaint@plt>
mov    0xc(%rsp),%edx
add    $0xffffffff,%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <qsortint@plt>
mov    0xc(%rsp),%esi
add    $0x1,%esi
mov    %r14,%rdi
mov    %ebx,%edx
call   1040 <qsortint@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @qsortint(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* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @_qspaint(i32* %12, i32 %13, i32 %14, i32* %7)
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @qsortint(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = icmp slt i32 %1, %2
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = call i32 @_qspaint(i32* %0, i32 %1, i32 %2, i32* %4)
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
br label %13
13: ; preds = %7, %3
ret void
}
long C_taggedmpointer(long **ptr, long tag, void *mp) {
  long *p = *ptr, *p0 = p;
  *(p++) = ((0x0b00000000000000L | 0x2000000000000000L) | (3 - 1));
  *((void **)p) = mp;
  *(++p) = tag;
  *ptr = p + 1;
  return (long)p0;
}


x86 assembly (clang, -O0):
<C_taggedmpointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
movabs $0x2b00000000000002,%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rcx
add    $0x8,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_taggedmpointer>:
mov    (%rdi),%rax
movabs $0x2b00000000000002,%rcx
mov    %rcx,(%rax)
mov    %rdx,0x8(%rax)
mov    %rsi,0x10(%rax)
lea    0x18(%rax),%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i64 @C_taggedmpointer(i64** nocapture %0, i64 %1, i8* %2) {
%4 = load i64*, i64** %0
%5 = getelementptr inbounds i64, i64* %4, i64 1
store i64 3098476543630901250, i64* %4
%6 = bitcast i64* %5 to i8**
store i8* %2, i8** %6
%7 = getelementptr inbounds i64, i64* %4, i64 2
store i64 %1, i64* %7
%8 = getelementptr inbounds i64, i64* %4, i64 3
store i64* %8, i64** %0
%9 = ptrtoint i64* %4 to i64
ret i64 %9
}
double cog_math_min(double x, double y) {
  if (x < y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<cog_math_min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <cog_math_min+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <cog_math_min+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cog_math_min>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cog_math_min(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @cog_math_min(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int test_imm_F9int64_lowword_mem(long long *val) {
  return ((*val) & (0xF9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F9int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 249
%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_F9int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 249
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo259(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo259(i32 %0) {
ret void
}
void foo317(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo317(i32 %0) {
ret void
}
long long __max_impl_longlong(long long a, long long b) {
  return (a > b) ? a : b;
}


x86 assembly (clang, -O0):
<__max_impl_longlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <__max_impl_longlong+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <__max_impl_longlong+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__max_impl_longlong>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @__max_impl_longlong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @__max_impl_longlong(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void handle_interrupt(int sig) {
  puts("\nFuck you!!!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<handle_interrupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_interrupt>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\0AFuck you!!!\0A\00"
define void @handle_interrupt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0AFuck you!!!\0A\00"
define void @handle_interrupt(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct itstree_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_count(struct itstree_node const *, size_t *, size_t *,
                            size_t *, int /*<<< orphan*/);
void itstree_count_real(const struct itstree_node *itst, size_t *n30,
                        size_t *n50, size_t *n70) {
  do_count(itst, n30, n50, n70, 0);
}


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

x86 assembly (clang, -O2):
<itstree_count_real>:
xor    %r8d,%r8d
jmp    1030 <do_count@plt>

LLVM IR (-O0):
%struct.itstree_node = type { i32 }
define void @itstree_count_real(%struct.itstree_node* %0, i64* %1, i64* %2, i64* %3) {
%5 = alloca %struct.itstree_node*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64*
store %struct.itstree_node* %0, %struct.itstree_node** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load %struct.itstree_node*, %struct.itstree_node** %5
%10 = load i64*, i64** %6
%11 = load i64*, i64** %7
%12 = load i64*, i64** %8
%13 = call i32 @do_count(%struct.itstree_node* %9, i64* %10, i64* %11, i64* %12, i32 0)
ret void
}

LLVM IR (-O2):
%struct.itstree_node = type { i32 }
define void @itstree_count_real(%struct.itstree_node* %0, i64* %1, i64* %2, i64* %3) {
%5 = tail call i32 @do_count(%struct.itstree_node* %0, i64* %1, i64* %2, i64* %3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void array_show(int *arr, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%d ", arr[i]);
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<array_show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <array_show+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <array_show+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @array_show(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
bool_t clntraw_control(CLIENT *x, int x1, char *x2) {
  (void)x;
  (void)x1;
  (void)x2;
  return (FALSE);
}


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

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

LLVM IR (-O0):
@FALSE = global i32 0
define i32 @clntraw_control(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = load i32, i32* @FALSE
ret i32 %10
}

LLVM IR (-O2):
@FALSE = global i32 0
define i32 @clntraw_control(i32* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @FALSE
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mkstemp(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *getTmpName(char *fname) {
  char name[259 + 1];
  int n;
  strcpy(fname, "enXXXXXX");
  mkstemp(fname);
  return fname;
}


x86 assembly (clang, -O0):
<getTmpName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1040 <mkstemp@plt>
mov    -0x8(%rbp),%rax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTmpName>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <mkstemp@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"enXXXXXX\00"
define i8* @getTmpName(i8* %0) {
%2 = alloca i8*
%3 = alloca [260 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 @mkstemp(i8* %7)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"enXXXXXX\00"
define i8* @getTmpName(i8* returned %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @mkstemp(i8* %0)
ret i8* %0
}
int adjustment() { return 33; }


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

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

LLVM IR (-O0):
define i32 @adjustment() {
ret i32 33
}

LLVM IR (-O2):
define i32 @adjustment() {
ret i32 33
}
void RasterByteSwapDisable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x40)))) &= ~(0x00000008u);
}


x86 assembly (clang, -O0):
<RasterByteSwapDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterByteSwapDisable>:
add    $0x40,%edi
andl   $0xfffffff7,(%rdi)
ret

LLVM IR (-O0):
define void @RasterByteSwapDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 64
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -9
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @RasterByteSwapDisable(i32 %0) {
%2 = add i32 %0, 64
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -9
store volatile i32 %6, i32* %4
ret void
}
int main(int argc, const char *argv[]) {
  struct my_struct {
    int a;
    double b;
  };
  struct my_struct array[2] = {{1, 1.35}, {2, 2.35}};
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xee4(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.my_struct = type { i32, double }
@__const.main.array = [2 x %struct.my_struct] [%struct.my_struct { i32 1, double 1.350000e+00 }, %struct.my_struct { i32 2, double 2.350000e+00 }]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x %struct.my_struct]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [2 x %struct.my_struct]* %6 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
void cow_exit(void) {
  system("/usr/games/cowsay \'bye~\'");
  exit(0);
}


x86 assembly (clang, -O0):
<cow_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cow_exit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"/usr/games/cowsay 'bye~'\00"
define void @cow_exit() {
%1 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"/usr/games/cowsay 'bye~'\00"
define void @cow_exit() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void bnxt_vf_reps_open(struct bnxt *bp) {}


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

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

LLVM IR (-O0):
%struct.bnxt = type opaque
define void @bnxt_vf_reps_open(%struct.bnxt* %0) {
%2 = alloca %struct.bnxt*
store %struct.bnxt* %0, %struct.bnxt** %2
ret void
}

LLVM IR (-O2):
%struct.bnxt = type opaque
define void @bnxt_vf_reps_open(%struct.bnxt* nocapture %0) {
ret void
}
unsigned long long tod_to_ns(unsigned long long todval) {
  unsigned long long ns;
  ns = ((todval >> 32) << 23) * 125;
  ns += ((todval & 0xffffffff) * 125) >> 9;
  return ns;
}


x86 assembly (clang, -O0):
<tod_to_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
shl    $0x17,%rax
imul   $0x7d,%rax,%rax
mov    %rax,-0x10(%rbp)
movabs $0xffffffff,%rax
and    -0x8(%rbp),%rax
imul   $0x7d,%rax,%rax
shr    $0x9,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tod_to_ns>:
mov    %edi,%eax
shr    $0x9,%rdi
and    $0xffffffffff800000,%rdi
imul   $0x7d,%rdi,%rcx
imul   $0x7d,%rax,%rax
shr    $0x9,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @tod_to_ns(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 32
%6 = shl i64 %5, 23
%7 = mul i64 %6, 125
store i64 %7, i64* %3
%8 = load i64, i64* %2
%9 = and i64 %8, 4294967295
%10 = mul i64 %9, 125
%11 = lshr i64 %10, 9
%12 = load i64, i64* %3
%13 = add i64 %12, %11
store i64 %13, i64* %3
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @tod_to_ns(i64 %0) {
%2 = lshr i64 %0, 9
%3 = and i64 %2, 36028797010575360
%4 = mul nuw nsw i64 %3, 125
%5 = and i64 %0, 4294967295
%6 = mul nuw nsw i64 %5, 125
%7 = lshr i64 %6, 9
%8 = add nuw nsw i64 %4, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("I'm a subproject bar.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"I'm a subproject bar.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"I'm a subproject bar.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
g() { return (char)-5; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 -5
}

LLVM IR (-O2):
define i32 @g() {
ret i32 -5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int _mm_cvtss_si32(int /*<<< orphan*/);
int test_mm_cvtss_si32(__m128 A) { return _mm_cvtss_si32(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvtss_si32>:
jmp    1030 <_mm_cvtss_si32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvtss_si32(i32 %0) {
%2 = tail call i32 @_mm_cvtss_si32(i32 %0)
ret i32 %2
}
int intcallable2(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @intcallable2() {
ret i32 4
}

LLVM IR (-O2):
define i32 @intcallable2() {
ret i32 4
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/port.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/port.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/port.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
char *p_ngettext(char const *, char const *, unsigned long);
int /*<<< orphan*/ setup();
char *g_libintl_ngettext(const char *msgid1, const char *msgid2,
                         unsigned long int n) {
  setup();
  return p_ngettext(msgid1, msgid2, n);
}


x86 assembly (clang, -O0):
<g_libintl_ngettext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <setup@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <p_ngettext@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_libintl_ngettext>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <setup@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <p_ngettext@plt>

LLVM IR (-O0):
define i8* @g_libintl_ngettext(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = call i32 (...) @setup()
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @p_ngettext(i8* %8, i8* %9, i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @g_libintl_ngettext(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 (...) @setup()
%5 = tail call i8* @p_ngettext(i8* %0, i8* %1, i64 %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void fc_closesocket(int sock) { close(sock); }


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

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

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

LLVM IR (-O2):
define void @fc_closesocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void fd201(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];
  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;
      goto a;
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
a:;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


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

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

LLVM IR (-O0):
define void @fd201(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: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
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: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd201(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void plat_step_volume(int is_up) {}


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

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

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

LLVM IR (-O2):
define void @plat_step_volume(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_string(char *);
void isr() { print_string("This is an interrupt :D"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"This is an interrupt :D\00"
define void @isr() {
%1 = call i32 @print_string(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"This is an interrupt :D\00"
define void @isr() {
%1 = tail call i32 @print_string(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
void test3_PrintTest_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test3_PrintTest_targetInit__I() {
ret void
}
char *m2s(char *s) {
  char *tmp = (char *)s;
  while ((*tmp)-- > 1) {
    while (*(char *)++s)
      ;
    (*(char *)s) = ',';
  }
  return (tmp + 1);
}


x86 assembly (clang, -O0):
<m2s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%al
mov    %al,%dl
add    $0xff,%dl
mov    %dl,(%rcx)
movsbl %al,%eax
cmp    $0x1,%eax
jle    1158 <m2s+0x58>
jmp    112e <m2s+0x2e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,0x1(%rax)
je     114c <m2s+0x4c>
jmp    112e <m2s+0x2e>
mov    -0x8(%rbp),%rax
movb   $0x2c,(%rax)
jmp    1110 <m2s+0x10>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m2s>:
mov    %rdi,%rax
mov    (%rdi),%cl
lea    -0x1(%rcx),%edx
mov    %dl,(%rdi)
cmp    $0x2,%cl
jl     113a <m2s+0x3a>
lea    0x1(%rax),%rcx
jmp    1124 <m2s+0x24>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rcx
cmpb   $0x0,(%rcx)
jne    1120 <m2s+0x20>
movb   $0x2c,(%rcx)
movzbl (%rax),%edx
lea    -0x1(%rdx),%esi
mov    %sil,(%rax)
cmp    $0x1,%dl
jg     1120 <m2s+0x20>
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i8* @m2s(i8* %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -1
store i8 %3, i8* %0
%4 = icmp sgt i8 %2, 1
br i1 %4, label %5, label %15
5: ; preds = %1, %10
%6 = phi i8* [ %7, %10 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %5, %11
br label %5
11: ; preds = %5
store i8 44, i8* %7
%12 = load i8, i8* %0
%13 = add i8 %12, -1
store i8 %13, i8* %0
%14 = icmp sgt i8 %12, 1
br i1 %14, label %10, label %15
15: ; preds = %11, %1
%16 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %16
}
void dummy() { __asm__("jmpq *%r8"); }


x86 assembly (clang, -O0):
<dummy>:
push   %rbp
mov    %rsp,%rbp
jmp    *%r8
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy>:
jmp    *%r8
ret

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

LLVM IR (-O2):
define void @dummy() {
tail call void asm sideeffect "jmpq *%r8", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int ipv6_netfilter_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ipv6_netfilter_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_B16(char *mem) {
  printf("test_B16\n");
  char ch;
  int i;
  for (i = 0; i < 16; ++i) {
    mem[i] = 'a';
  }
}


x86 assembly (clang, -O0):
<test_B16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    1153 <test_B16+0x43>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x61,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112f <test_B16+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_B16>:
push   %rbx
mov    %rdi,%rbx
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
movaps 0xed9(%rip),%xmm0
movups %xmm0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [9 x i8] c"test_B16\00"
define void @test_B16(i8* nocapture writeonly %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *__memcpy_compat(void *, void const *, size_t);
void *__wrap_memcpy(void *dest, const void *src, size_t n) {
  return __memcpy_compat(dest, src, n);
}


x86 assembly (clang, -O0):
<__wrap_memcpy>:
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
mov    -0x18(%rbp),%rdx
call   1030 <__memcpy_compat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_memcpy>:
jmp    1030 <__memcpy_compat@plt>

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

LLVM IR (-O2):
define i8* @__wrap_memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @__memcpy_compat(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
int cam_init(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @cam_init() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void SetCOMScan(char x) {
  unsigned char d[] = {0xC0};
  if (x)
    d[0] = 0xC8;
  oled_SendCommand(d, sizeof(d));
}


x86 assembly (clang, -O0):
<SetCOMScan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0xedc(%rip),%al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1135 <SetCOMScan+0x25>
movb   $0xc8,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x1,%esi
call   1030 <oled_SendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetCOMScan>:
push   %rax
test   %dil,%dil
setne  %al
shl    $0x3,%al
or     $0xc0,%al
mov    %al,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.SetCOMScan.d = [1 x i8] c"\C0"
define void @SetCOMScan(i8 signext %0) {
%2 = alloca i8
%3 = alloca [1 x i8]
store i8 %0, i8* %2
%4 = bitcast [1 x i8]* %3 to i8*
%5 = load i8, i8* %2
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 -56, i8* %8
br label %9
9: ; preds = %7, %1
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%11 = call i32 @oled_SendCommand(i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
define void @SetCOMScan(i8 signext %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%4 = icmp eq i8 %0, 0
%5 = select i1 %4, i8 -64, i8 -56
store i8 %5, i8* %3
%6 = call i32 @oled_SendCommand(i8* %3, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __sgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ flockfile(int /*<<< orphan*/ *);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/ *);
int getc(FILE *fp) {
  int c;
  flockfile(fp);
  c = __sgetc(fp);
  funlockfile(fp);
  return (c);
}


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <flockfile@plt>
mov    -0x8(%rbp),%rdi
call   1050 <__sgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <funlockfile@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <flockfile@plt>
mov    %rbx,%rdi
call   1050 <__sgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <funlockfile@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getc(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @flockfile(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @__sgetc(i32* %6)
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = call i32 @funlockfile(i32* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @getc(i32* %0) {
%2 = tail call i32 @flockfile(i32* %0)
%3 = tail call i32 @__sgetc(i32* %0)
%4 = tail call i32 @funlockfile(i32* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *strSetMemAtIndex(char *pt, char *s) {
  strcpy(pt, s);
  pt = (char *)pt + strlen(s);
  return pt;
}


x86 assembly (clang, -O0):
<strSetMemAtIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strSetMemAtIndex>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strSetMemAtIndex(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8* %12, i8** %3
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @strSetMemAtIndex(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
%4 = tail call i32 @strlen(i8* %1)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void badfile(const char *filename) {
  printf("file %s could not be opend or created", filename);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<badfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badfile>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"file %s could not be opend or created\00"
@EXIT_FAILURE = global i32 0
define void @badfile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"file %s could not be opend or created\00"
@EXIT_FAILURE = global i32 0
define void @badfile(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int isalphanum(unsigned char c) {
  return ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') ||
          (c >= 'a' && c <= 'z') || (c == '_'));
}


x86 assembly (clang, -O0):
<isalphanum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <isalphanum+0x29>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1174 <isalphanum+0x74>
movzbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <isalphanum+0x48>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1174 <isalphanum+0x74>
movzbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1167 <isalphanum+0x67>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1174 <isalphanum+0x74>
movzbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalphanum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
mov    %edi,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
cmp    $0x1a,%cl
setb   %cl
cmp    $0x5f,%dil
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @isalphanum(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %30, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %30, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = zext i8 %19 to i32
%21 = icmp sge i32 %20, 97
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = icmp sle i32 %24, 122
br i1 %25, label %30, label %26
26: ; preds = %22, %18
%27 = load i8, i8* %2
%28 = zext i8 %27 to i32
%29 = icmp eq i32 %28, 95
br label %30
30: ; preds = %26, %22, %14, %6
%31 = phi i1 [ true, %22 ], [ true, %14 ], [ true, %6 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @isalphanum(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
%7 = or i1 %3, %6
%8 = icmp eq i8 %0, 95
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}