xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t strlen(const char *s) {
  size_t size = 0;
  while (s[size] != '\0')
    size++;
  return size;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ xfree(char *);
void free_mtnstatus_members(char *buff) { xfree(buff); }


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

x86 assembly (clang, -O2):
<free_mtnstatus_members>:
jmp    1030 <xfree@plt>

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

LLVM IR (-O2):
define void @free_mtnstatus_members(i8* %0) {
%2 = tail call i32 @xfree(i8* %0)
ret void
}
char inList(int element, int *arr, int len) {
  int i;
  for (i = 0; i < len; i++)
    if (arr[i] == element)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<inList>:
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    1151 <inList+0x51>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    113e <inList+0x3e>
movb   $0x1,-0x1(%rbp)
jmp    1155 <inList+0x55>
jmp    1143 <inList+0x43>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <inList+0x15>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inList>:
test   %edx,%edx
jle    111e <inList+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rcx,4)
je     1121 <inList+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <inList+0x10>
xor    %eax,%eax
ret
mov    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @inList(i32 %0, i32* %1, i32 %2) {
%4 = alloca i8
%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 = %23, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %26
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 %22
21: ; preds = %13
store i8 1, i8* %4
br label %27
22: ; preds = %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %9
26: ; preds = %9
store i8 0, i8* %4
br label %27
27: ; preds = %26, %21
%28 = load i8, i8* %4
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @inList(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i8 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i8 %16
}
/* Variables and functions */
int /*<<< orphan*/ ei();
int /*<<< orphan*/ rl78_run_ctor();
int /*<<< orphan*/ rl78_run_fini_array();
int /*<<< orphan*/ rl78_run_init_array();
int /*<<< orphan*/ rl78_run_preinit_array();
void init() {
  rl78_run_ctor();
  rl78_run_preinit_array();
  rl78_run_init_array();
  rl78_run_fini_array();
  ei();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <rl78_run_ctor@plt>
mov    $0x0,%al
call   1050 <rl78_run_preinit_array@plt>
mov    $0x0,%al
call   1030 <rl78_run_init_array@plt>
mov    $0x0,%al
call   1040 <rl78_run_fini_array@plt>
mov    $0x0,%al
call   1070 <ei@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1060 <rl78_run_ctor@plt>
xor    %eax,%eax
call   1050 <rl78_run_preinit_array@plt>
xor    %eax,%eax
call   1030 <rl78_run_init_array@plt>
xor    %eax,%eax
call   1040 <rl78_run_fini_array@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <ei@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @rl78_run_ctor()
%2 = call i32 (...) @rl78_run_preinit_array()
%3 = call i32 (...) @rl78_run_init_array()
%4 = call i32 (...) @rl78_run_fini_array()
%5 = call i32 (...) @ei()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @rl78_run_ctor()
%2 = tail call i32 (...) @rl78_run_preinit_array()
%3 = tail call i32 (...) @rl78_run_init_array()
%4 = tail call i32 (...) @rl78_run_fini_array()
%5 = tail call i32 (...) @ei()
ret void
}
void zylonite_pxa300_init(void) {
  if (cpu_is_pxa300() || cpu_is_pxa310())
    panic("%s: PXA300/PXA310 not supported\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <cpu_is_pxa300@plt>
cmp    $0x0,%eax
jne    1154 <zylonite_pxa300_init+0x24>
mov    $0x0,%al
call   1040 <cpu_is_pxa310@plt>
cmp    $0x0,%eax
je     1169 <zylonite_pxa300_init+0x39>
lea    0xea5(%rip),%rdi
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1030 <panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %eax,%eax
call   1050 <cpu_is_pxa300@plt>
test   %eax,%eax
jne    1147 <zylonite_pxa300_init+0x17>
xor    %eax,%eax
call   1040 <cpu_is_pxa310@plt>
test   %eax,%eax
je     115d <zylonite_pxa300_init+0x2d>
lea    0xeb2(%rip),%rdi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <panic@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"%s: PXA300/PXA310 not supported\0A\00"
@__FUNCTION__.zylonite_pxa300_init = [21 x i8] c"zylonite_pxa300_init\00"
define void @zylonite_pxa300_init() {
%1 = call i32 (...) @cpu_is_pxa300()
%2 = icmp ne i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i32 (...) @cpu_is_pxa310()
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3, %0
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @panic to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.zylonite_pxa300_init, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"%s: PXA300/PXA310 not supported\0A\00"
@__FUNCTION__.zylonite_pxa300_init = [21 x i8] c"zylonite_pxa300_init\00"
define void @zylonite_pxa300_init() {
%1 = tail call i32 (...) @cpu_is_pxa300()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @cpu_is_pxa310()
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @panic to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.zylonite_pxa300_init, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
struct u {
  float f;
  int i;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, int);
void testUnion() {
  union u;
  union u {
    float f;
    int i;
  } u;
  u.f = 1.0f;
  printf("testUnion: %g == 0x%08x\n", u.f, u.i);
}


x86 assembly (clang, -O0):
<testUnion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testUnion>:
lea    0xeed(%rip),%rdi
movss  0xee1(%rip),%xmm0
mov    $0x3f800000,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%union.u = type { float }
@.str = [25 x i8] c"testUnion: %g == 0x%08x\0A\00"
define void @testUnion() {
%1 = alloca %union.u
%2 = bitcast %union.u* %1 to float*
store float 1.000000e+00, float* %2
%3 = bitcast %union.u* %1 to float*
%4 = load float, float* %3
%5 = bitcast %union.u* %1 to i32*
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %4, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"testUnion: %g == 0x%08x\0A\00"
define void @testUnion() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float 1.000000e+00, i32 1065353216)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
struct pane {
  int dummy;
};
struct mark {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __doc_step(struct pane *, struct mark *, int /*<<< orphan*/,
                              int);
wint_t doc_prev(struct pane *p, struct mark *m) {
  return __doc_step(p, m, 0, 1);
}


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

x86 assembly (clang, -O2):
<doc_prev>:
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <__doc_step@plt>

LLVM IR (-O0):
%struct.pane = type { i32 }
%struct.mark = type { i32 }
define i32 @doc_prev(%struct.pane* %0, %struct.mark* %1) {
%3 = alloca %struct.pane*
%4 = alloca %struct.mark*
store %struct.pane* %0, %struct.pane** %3
store %struct.mark* %1, %struct.mark** %4
%5 = load %struct.pane*, %struct.pane** %3
%6 = load %struct.mark*, %struct.mark** %4
%7 = call i32 @__doc_step(%struct.pane* %5, %struct.mark* %6, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.pane = type { i32 }
%struct.mark = type { i32 }
define i32 @doc_prev(%struct.pane* %0, %struct.mark* %1) {
%3 = tail call i32 @__doc_step(%struct.pane* %0, %struct.mark* %1, i32 0, i32 1)
ret i32 %3
}
void exynos_drm_iommu_deactivate(void *in_vmm, struct device *dev) { return; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define void @exynos_drm_iommu_deactivate(i8* %0, %struct.device* %1) {
%3 = alloca i8*
%4 = alloca %struct.device*
store i8* %0, i8** %3
store %struct.device* %1, %struct.device** %4
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
define void @exynos_drm_iommu_deactivate(i8* nocapture %0, %struct.device* nocapture %1) {
ret void
}
unsigned long get_ulong_i(const unsigned char *buf_ptr) {
  return ((unsigned long)buf_ptr[0]) + ((unsigned long)buf_ptr[1] << 8) +
         ((unsigned long)buf_ptr[2] << 16) + ((unsigned long)buf_ptr[3] << 24);
}


x86 assembly (clang, -O0):
<get_ulong_i>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ulong_i>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i64 @get_ulong_i(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %13, %17
ret i64 %18
}
/* Variables and functions */
bool chars_equals(char c1, char c2) { return c1 == c2; }


x86 assembly (clang, -O0):
<chars_equals>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_equals>:
xor    %eax,%eax
cmp    %sil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @chars_equals(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @chars_equals(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int newline(char c) { return ('\n' == c || '\r' == c) ? 1 : 0; }


x86 assembly (clang, -O0):
<newline>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
mov    $0x1,%al
mov    $0xa,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     1131 <newline+0x31>
movsbl -0x1(%rbp),%ecx
mov    $0xd,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<newline>:
cmp    $0xa,%dil
sete   %al
cmp    $0xd,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @newline(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = icmp eq i8 %0, 13
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned float_twice(unsigned uf) {
  unsigned f = uf;
  if ((f & 0x7F800000) == 0) {
    f = ((f & 0x007FFFFF) << 1) | (0x80000000 & f);
  } else if ((f & 0x7F800000) != 0x7F800000) {
    f = f + 0x00800000;
  }
  return f;
}


x86 assembly (clang, -O0):
<float_twice>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7f800000,%eax
cmp    $0x0,%eax
jne    113c <float_twice+0x3c>
mov    -0x8(%rbp),%eax
and    $0x7fffff,%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%ecx
and    $0x80000000,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    115f <float_twice+0x5f>
mov    -0x8(%rbp),%eax
and    $0x7f800000,%eax
cmp    $0x7f800000,%eax
je     115a <float_twice+0x5a>
mov    -0x8(%rbp),%eax
add    $0x800000,%eax
mov    %eax,-0x8(%rbp)
jmp    115f <float_twice+0x5f>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_twice>:
mov    %edi,%eax
mov    %edi,%ecx
and    $0x7f800000,%ecx
cmp    $0x7f800000,%ecx
je     112c <float_twice+0x2c>
test   %ecx,%ecx
jne    1127 <float_twice+0x27>
mov    %eax,%ecx
and    $0x7fffff,%ecx
and    $0x80000000,%eax
lea    (%rax,%rcx,2),%eax
ret
add    $0x800000,%eax
ret

LLVM IR (-O0):
define i32 @float_twice(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 2139095040
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, 8388607
%11 = shl i32 %10, 1
%12 = load i32, i32* %3
%13 = and i32 -2147483648, %12
%14 = or i32 %11, %13
store i32 %14, i32* %3
br label %23
15: ; preds = %1
%16 = load i32, i32* %3
%17 = and i32 %16, 2139095040
%18 = icmp ne i32 %17, 2139095040
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* %3
%21 = add i32 %20, 8388608
store i32 %21, i32* %3
br label %22
22: ; preds = %19, %15
br label %23
23: ; preds = %22, %8
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @float_twice(i32 %0) {
%2 = and i32 %0, 2139095040
switch i32 %2, label %8 [
i32 0, label %3
i32 2139095040, label %10
]
3: ; preds = %1
%4 = shl i32 %0, 1
%5 = and i32 %4, 16777214
%6 = and i32 %0, -2147483648
%7 = or i32 %5, %6
br label %10
8: ; preds = %1
%9 = add i32 %0, 8388608
br label %10
10: ; preds = %1, %8, %3
%11 = phi i32 [ %7, %3 ], [ %9, %8 ], [ %0, %1 ]
ret i32 %11
}
/* Variables and functions */
size_t min(size_t v1, size_t v2) { return v1 < v2 ? v1 : v2; }


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

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

LLVM IR (-O0):
define i64 @min(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 ult 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 @min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void indent(const int level, const char *indent_string) {
  int i;
  for (i = 0; i < level; i++)
    printf("%s", indent_string);
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <indent+0x40>
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <indent+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <indent+0x30>
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <indent+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @indent(i32 %0, i8* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
long inccheck(long len, long adr) {
  unsigned long *p = (unsigned long *)adr;
  while (len > 0) {
    if (*p != (long)p)
      return (long)p;
    p++;
    len -= sizeof(long);
  }
  return -1;
}


x86 assembly (clang, -O0):
<inccheck>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    115d <inccheck+0x5d>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    %rcx,%rax
je     1140 <inccheck+0x40>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <inccheck+0x65>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <inccheck+0x14>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inccheck>:
mov    $0xffffffffffffffff,%rax
test   %rdi,%rdi
jle    1137 <inccheck+0x37>
add    $0x8,%rdi
mov    %rsi,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    (%rcx),%rsi
jne    1138 <inccheck+0x38>
add    $0x8,%rcx
add    $0x8,%rsi
add    $0xfffffffffffffff8,%rdi
cmp    $0x8,%rdi
jg     1120 <inccheck+0x20>
ret
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @inccheck(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = inttoptr i64 %7 to i64*
store i64* %8, i64** %6
br label %9
9: ; preds = %21, %2
%10 = load i64, i64* %4
%11 = icmp sgt i64 %10, 0
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = load i64*, i64** %6
%16 = ptrtoint i64* %15 to i64
%17 = icmp ne i64 %14, %16
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load i64*, i64** %6
%20 = ptrtoint i64* %19 to i64
store i64 %20, i64* %3
br label %27
21: ; preds = %12
%22 = load i64*, i64** %6
%23 = getelementptr inbounds i64, i64* %22, i32 1
store i64* %23, i64** %6
%24 = load i64, i64* %4
%25 = sub i64 %24, 8
store i64 %25, i64* %4
br label %9
26: ; preds = %9
store i64 -1, i64* %3
br label %27
27: ; preds = %26, %18
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @inccheck(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = inttoptr i64 %1 to i64*
br label %6
6: ; preds = %4, %12
%7 = phi i64* [ %13, %12 ], [ %5, %4 ]
%8 = phi i64 [ %14, %12 ], [ %0, %4 ]
%9 = load i64, i64* %7
%10 = ptrtoint i64* %7 to i64
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %6
%13 = getelementptr inbounds i64, i64* %7, i64 1
%14 = add nsw i64 %8, -8
%15 = icmp sgt i64 %8, 8
br i1 %15, label %6, label %18
16: ; preds = %6
%17 = ptrtoint i64* %7 to i64
br label %18
18: ; preds = %12, %16, %2
%19 = phi i64 [ -1, %2 ], [ %17, %16 ], [ -1, %12 ]
ret i64 %19
}
void ARGBToRGB24() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB24() {
ret void
}
int main(void) {
  volatile int j = 0x7fffffff;
  volatile int i = 2;
  volatile int k = j * i;
  k = i * j;
  volatile long int m = 0x7fffffffffffffffL;
  volatile long int n = 2;
  volatile long int o = m * n;
  o = n * m;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x18(%rbp)
movq   $0x2,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x7fffffff,-0x20(%rsp)
7f
movl   $0x2,-0x24(%rsp)
mov    -0x20(%rsp),%eax
imul   -0x24(%rsp),%eax
mov    %eax,-0x1c(%rsp)
mov    -0x24(%rsp),%eax
imul   -0x20(%rsp),%eax
mov    %eax,-0x1c(%rsp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x10(%rsp)
movq   $0x2,-0x18(%rsp)
mov    -0x10(%rsp),%rax
imul   -0x18(%rsp),%rax
mov    %rax,-0x8(%rsp)
mov    -0x18(%rsp),%rax
imul   -0x10(%rsp),%rax
mov    %rax,-0x8(%rsp)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = bitcast i32* %1 to i8*
store volatile i32 2147483647, i32* %1
%8 = bitcast i32* %2 to i8*
store volatile i32 2, i32* %2
%9 = bitcast i32* %3 to i8*
%10 = load volatile i32, i32* %1
%11 = load volatile i32, i32* %2
%12 = mul nsw i32 %11, %10
store volatile i32 %12, i32* %3
%13 = load volatile i32, i32* %2
%14 = load volatile i32, i32* %1
%15 = mul nsw i32 %14, %13
store volatile i32 %15, i32* %3
%16 = bitcast i64* %4 to i8*
store volatile i64 9223372036854775807, i64* %4
%17 = bitcast i64* %5 to i8*
store volatile i64 2, i64* %5
%18 = bitcast i64* %6 to i8*
%19 = load volatile i64, i64* %4
%20 = load volatile i64, i64* %5
%21 = mul nsw i64 %20, %19
store volatile i64 %21, i64* %6
%22 = load volatile i64, i64* %5
%23 = load volatile i64, i64* %4
%24 = mul nsw i64 %23, %22
store volatile i64 %24, i64* %6
ret i32 0
}
void test_common_f1(void) {}


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

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

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

LLVM IR (-O2):
define void @test_common_f1() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(char *, char *, int);
void ponerCaracterEnVentana(char caracter, char *ventana, FILE *archivo) {
  memcpy(ventana, ventana + 1, 8192 - 1);
  memcpy(ventana + 8192 - 1, &caracter, 1);
  fwrite(&caracter, 1, 1, archivo);
}


x86 assembly (clang, -O0):
<ponerCaracterEnVentana>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    $0x1fff,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rdi
add    $0x2000,%rdi
add    $0xffffffffffffffff,%rdi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rcx
lea    -0x1(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ponerCaracterEnVentana>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %dil,0x7(%rsp)
add    $0x1,%rsi
mov    %rbx,%rdi
mov    $0x1fff,%edx
call   1040 <memcpy@plt>
add    $0x1fff,%rbx
lea    0x7(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <memcpy@plt>
movsbl 0x7(%rsp),%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ponerCaracterEnVentana(i8 signext %0, i8* %1, i32* %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32*
store i8 %0, i8* %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = call i32 @memcpy(i8* %7, i8* %9, i32 8191)
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 8192
%13 = getelementptr inbounds i8, i8* %12, i64 -1
%14 = call i32 @memcpy(i8* %13, i8* %4, i32 1)
%15 = load i32*, i32** %6
%16 = call i32 @fwrite(i8* %4, i32 1, i32 1, i32* %15)
ret void
}

LLVM IR (-O2):
define void @ponerCaracterEnVentana(i8 signext %0, i8* %1, i32* nocapture %2) {
%4 = alloca i8
store i8 %0, i8* %4
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = tail call i32 @memcpy(i8* %1, i8* %5, i32 8191)
%7 = getelementptr inbounds i8, i8* %1, i64 8191
%8 = call i32 @memcpy(i8* %7, i8* %4, i32 1)
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = call i32 @fputc(i32 %10, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello Balam!\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 = [14 x i8] c"Hello Balam!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello Balam!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  int timeout = 10;
  if (argc > 1)
    timeout = atoi(argv[1]);
  sleep(timeout);
  printf("%d exit\n", getpid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1177 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    $0xa,%edi
cmp    $0x2,%eax
jl     1158 <main+0x18>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d exit\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 10, %2 ]
%10 = tail call i32 @sleep(i32 %9)
%11 = tail call i32 (...) @getpid()
%12 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Variables and functions */
size_t decoded_output_length(size_t input_length) {
  if (input_length % 4 != 0)
    return 0;
  return input_length / 4 * 3;
}


x86 assembly (clang, -O0):
<decoded_output_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
je     1127 <decoded_output_length+0x27>
movq   $0x0,-0x8(%rbp)
jmp    1137 <decoded_output_length+0x37>
mov    -0x10(%rbp),%rax
shr    $0x2,%rax
imul   $0x3,%rax,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decoded_output_length>:
mov    %rdi,%rcx
shr    $0x2,%rcx
xor    %eax,%eax
test   $0x3,%dil
lea    (%rcx,%rcx,2),%rcx
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @decoded_output_length(i64 %0) {
%2 = and i64 %0, 3
%3 = icmp eq i64 %2, 0
%4 = lshr i64 %0, 2
%5 = mul nuw i64 %4, 3
%6 = select i1 %3, i64 %5, i64 0
ret i64 %6
}
char *__c2p(const char *p) {
  union {
    char *p;
    const char *c;
  } res = {.c = p};
  return res.p;
}


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

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

LLVM IR (-O0):
%union.anon = type { i8* }
define i8* @__c2p(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.anon
store i8* %0, i8** %2
%4 = bitcast %union.anon* %3 to i8**
%5 = load i8*, i8** %2
store i8* %5, i8** %4
%6 = bitcast %union.anon* %3 to i8**
%7 = load i8*, i8** %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @__c2p(i8* readnone returned %0) {
ret i8* %0
}
void memory_nmi_change(void) {}


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

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

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

LLVM IR (-O2):
define void @memory_nmi_change() {
ret void
}
/* Variables and functions */
int stringTerminatorCheck(char *, int, char *, int, int);
int crlfCheck(char *buffer, int dataLength, int newDataStartIndex) {
  return stringTerminatorCheck("\r\n", 2, buffer, dataLength,
                               newDataStartIndex);
}


x86 assembly (clang, -O0):
<crlfCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xecc(%rip),%rdi
mov    $0x2,%esi
call   1030 <stringTerminatorCheck@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crlfCheck>:
mov    %edx,%r8d
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xee1(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <stringTerminatorCheck@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @crlfCheck(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @stringTerminatorCheck(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @crlfCheck(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @stringTerminatorCheck(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ins(int);
void op_compins() { ins(1); }


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

x86 assembly (clang, -O2):
<op_compins>:
mov    $0x1,%edi
jmp    1030 <ins@plt>

LLVM IR (-O0):
define void @op_compins() {
%1 = call i32 @ins(i32 1)
ret void
}

LLVM IR (-O2):
define void @op_compins() {
%1 = tail call i32 @ins(i32 1)
ret void
}
void foo789(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo789(i32 %0) {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap3(int *, int *);
int main(int argc, char **argv) {
  int u;
  int t;
  u = 17;
  t = -96;
  printf("before swap3: u = %d , t = %d \n", u, t);
  swap3(&u, &t);
  printf("after  swap3: u = %d , t = %d \n", u, t);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x11,-0x14(%rbp)
movl   $0xffffffa0,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <swap3@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x11,0x4(%rsp)
movl   $0xffffffa0,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0x11,%esi
mov    $0xffffffa0,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap3@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"before swap3: u = %d , t = %d \0A\00"
@.str.1 = [32 x i8] c"after swap3: u = %d , t = %d \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 17, i32* %6
store i32 -96, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = call i32 @swap3(i32* %6, i32* %7)
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13)
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}

LLVM IR (-O2):
@.str = [32 x i8] c"before swap3: u = %d , t = %d \0A\00"
@.str.1 = [32 x i8] c"after swap3: u = %d , t = %d \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
store i32 17, i32* %3
store i32 -96, i32* %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 17, i32 -96)
%8 = call i32 @swap3(i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
short fp_weaponImageDuration(int64_t enchant) { return 3; }


x86 assembly (clang, -O0):
<fp_weaponImageDuration>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x3,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_weaponImageDuration>:
mov    $0x3,%ax
ret

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

LLVM IR (-O2):
define signext i16 @fp_weaponImageDuration(i32 %0) {
ret i16 3
}
/* Variables and functions */
char const *strong_n1();
const char *sibcall_strong_n1(void) { return strong_n1(); }


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

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

LLVM IR (-O0):
define i8* @sibcall_strong_n1() {
%1 = call i8* (...) @strong_n1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @sibcall_strong_n1() {
%1 = tail call i8* (...) @strong_n1()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ cdrom_sysctl_register();
int __attribute__((__section__(".init.text"))) __attribute__((__cold__))
__attribute__((no_instrument_function)) cdrom_init(void) {
  cdrom_sysctl_register();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @cdrom_init() section ".init.text" {
%1 = call i32 (...) @cdrom_sysctl_register()
ret i32 0
}

LLVM IR (-O2):
define i32 @cdrom_init() section ".init.text" {
%1 = tail call i32 (...) @cdrom_sysctl_register()
ret i32 0
}
/* Type definitions */
struct chevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct chevent *);
void chevent_delete(struct chevent *event) { free(event); }


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

x86 assembly (clang, -O2):
<chevent_delete>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.chevent = type { i32 }
define void @chevent_delete(%struct.chevent* %0) {
%2 = alloca %struct.chevent*
store %struct.chevent* %0, %struct.chevent** %2
%3 = load %struct.chevent*, %struct.chevent** %2
%4 = call i32 @free(%struct.chevent* %3)
ret void
}

LLVM IR (-O2):
%struct.chevent = type { i32 }
define void @chevent_delete(%struct.chevent* nocapture %0) {
%2 = tail call i32 @free(%struct.chevent* %0)
ret void
}
int xxx(void) { return 23; }


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

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

LLVM IR (-O0):
define i32 @xxx() {
ret i32 23
}

LLVM IR (-O2):
define i32 @xxx() {
ret i32 23
}
int test_imm_55int8_mem(signed char *val) {
  return ((*val) & (-0x55 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_55int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -85
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int pinctrl_init_done(struct device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @pinctrl_init_done(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *calloc(int, size_t);
void *bit_array_create(size_t size) {
  size_t bsize = ((size + 7) >> 3) + sizeof(size_t);
  void *ret = calloc(1, bsize);
  if (ret)
    *(size_t *)ret = size;
  return ret;
}


x86 assembly (clang, -O0):
<bit_array_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x7,%rax
shr    $0x3,%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1158 <bit_array_create+0x48>
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_array_create>:
push   %rbx
mov    %rdi,%rbx
lea    0x7(%rdi),%rsi
shr    $0x3,%rsi
add    $0x8,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
test   %rax,%rax
je     1132 <bit_array_create+0x22>
mov    %rbx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @bit_array_create(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = add i64 %5, 7
%7 = lshr i64 %6, 3
%8 = add i64 %7, 8
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @calloc(i32 1, i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %1
%14 = load i64, i64* %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i64*
store i64 %14, i64* %16
br label %17
17: ; preds = %13, %1
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
define i8* @bit_array_create(i64 %0) {
%2 = add i64 %0, 7
%3 = lshr i64 %2, 3
%4 = add nuw nsw i64 %3, 8
%5 = tail call i8* @calloc(i32 1, i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = bitcast i8* %5 to i64*
store i64 %0, i64* %8
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void closeScreen(void) { endwin(); }


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

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

LLVM IR (-O0):
define void @closeScreen() {
%1 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @closeScreen() {
%1 = tail call i32 (...) @endwin()
ret void
}
void TRACE_ALLOC_ERR_FMT(const char *const format, ...) {}


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

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

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

LLVM IR (-O2):
define void @TRACE_ALLOC_ERR_FMT(i8* nocapture %0, ...) {
ret void
}