xunge/DecIR huggingface dataset:
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_status(struct battle_char *, int /*<<< orphan*/);
scalar_t__ get_random(int /*<<< orphan*/, int);
scalar_t__ mod6(struct battle_char *, struct battle_char *, int);
void dont_move(struct battle_char *origin, struct battle_char *target) {
  if (get_random(0, 100) < mod6(origin, target, 190)) {
    add_status(target, 0);
  }
}


x86 assembly (clang, -O0):
<dont_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xbe,%edx
call   1040 <mod6@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    117d <dont_move+0x4d>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1050 <add_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dont_move>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0xbe,%edx
call   1040 <mod6@plt>
cmp    %rax,%rbx
jge    116e <dont_move+0x3e>
mov    %r14,%rdi
xor    %esi,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <add_status@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @dont_move(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = call i64 @get_random(i32 0, i32 100)
%6 = load %struct.battle_char*, %struct.battle_char** %3
%7 = load %struct.battle_char*, %struct.battle_char** %4
%8 = call i64 @mod6(%struct.battle_char* %6, %struct.battle_char* %7, i32 190)
%9 = icmp slt i64 %5, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load %struct.battle_char*, %struct.battle_char** %4
%12 = call i32 @add_status(%struct.battle_char* %11, i32 0)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @dont_move(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i64 @get_random(i32 0, i32 100)
%4 = tail call i64 @mod6(%struct.battle_char* %0, %struct.battle_char* %1, i32 190)
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @add_status(%struct.battle_char* %1, i32 0)
br label %8
8: ; preds = %6, %2
ret void
}
AR0RX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[10000000]) = (p1[x1]); }


x86 assembly (clang, -O0):
<AR0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x2625a00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0RX1>:
movslq %ecx,%rax
mov    (%r9,%rax,4),%eax
mov    %eax,0x2625a00(%r8)
ret

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

LLVM IR (-O2):
define i32 @AR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %4, i64 10000000
store i32 %9, i32* %10
ret i32 undef
}
/* Variables and functions */
double fmax(double, double);
double fmin(double, double);
double fopt(int min, double x, double y) {
  return min ? fmin(x, y) : fmax(x, y);
}


x86 assembly (clang, -O0):
<fopt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114d <fopt+0x4d>
movsd  -0x10(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
minsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    117a <fopt+0x7a>
movsd  -0x10(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopt>:
movapd %xmm0,%xmm2
cmpunordsd %xmm0,%xmm2
movapd %xmm2,%xmm3
andpd  %xmm1,%xmm3
test   %edi,%edi
je     111b <fopt+0x1b>
minsd  %xmm0,%xmm1
jmp    111f <fopt+0x1f>
maxsd  %xmm0,%xmm1
andnpd %xmm1,%xmm2
orpd   %xmm3,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @fopt(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call double @llvm.minnum.f64(double %10, double %11)
br label %17
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %6
%16 = call double @llvm.maxnum.f64(double %14, double %15)
br label %17
17: ; preds = %13, %9
%18 = phi double [ %12, %9 ], [ %16, %13 ]
ret double %18
}

LLVM IR (-O2):
define double @fopt(i32 %0, double %1, double %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call double @llvm.minnum.f64(double %1, double %2)
br label %9
7: ; preds = %3
%8 = tail call double @llvm.maxnum.f64(double %1, double %2)
br label %9
9: ; preds = %7, %5
%10 = phi double [ %6, %5 ], [ %8, %7 ]
ret double %10
}
long int factorial(int anInteger) {
  if (anInteger <= 1)
    return (1);
  else
    anInteger = anInteger * factorial(anInteger - 1);
  return (anInteger);
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     1132 <factorial+0x22>
movq   $0x1,-0x8(%rbp)
jmp    115b <factorial+0x4b>
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
cmp    $0x1,%edi
jle    112b <factorial+0x1b>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <factorial@plt>
imul   %ebx,%eax
cltq
pop    %rbx
ret

LLVM IR (-O0):
define i64 @factorial(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %18
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = call i64 @factorial(i32 %11)
%13 = mul nsw i64 %9, %12
%14 = trunc i64 %13 to i32
store i32 %14, i32* %3
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
store i64 %17, i64* %2
br label %18
18: ; preds = %15, %6
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
define i64 @factorial(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i64 [ %10, %5 ], [ 1, %1 ]
ret i64 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i64 @factorial(i32 %6)
%8 = trunc i64 %7 to i32
%9 = mul i32 %8, %0
%10 = sext i32 %9 to i64
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvAcquireFrame(char byBoardNum, void *pFrameBuf) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvAcquireFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvAcquireFrame(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvAcquireFrame(i8 signext %0, i8* nocapture readnone %1) {
%3 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int git_is_dir_sep(char const);
int git_offset_1st_component(const char *path) {
  return git_is_dir_sep(path[0]);
}


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

x86 assembly (clang, -O2):
<git_offset_1st_component>:
movsbl (%rdi),%edi
jmp    1030 <git_is_dir_sep@plt>

LLVM IR (-O0):
define i32 @git_offset_1st_component(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 = call i32 @git_is_dir_sep(i8 signext %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @git_offset_1st_component(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @git_is_dir_sep(i8 signext %2)
ret i32 %3
}
/* Variables and functions */
long long sdiv64(long long, long long);
long long __divdi3(long long n, long long d) { return sdiv64(n, d); }


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

x86 assembly (clang, -O2):
<__divdi3>:
jmp    1030 <sdiv64@plt>

LLVM IR (-O0):
define i64 @__divdi3(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 = call i64 @sdiv64(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @__divdi3(i64 %0, i64 %1) {
%3 = tail call i64 @sdiv64(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
void *ls_data_malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *ls_data_calloc(size_t nmemb, size_t size) {
  size_t block_size = nmemb * size;
  void *ret = ls_data_malloc(block_size);
  if (ret) {
    memset(ret, 0, block_size);
  }
  return ret;
}


x86 assembly (clang, -O0):
<ls_data_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ls_data_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1164 <ls_data_calloc+0x44>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_data_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1030 <ls_data_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <ls_data_calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ls_data_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @ls_data_malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
int never_sampler_next(struct htrace_sampler *sampler) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.htrace_sampler = type opaque
define i32 @never_sampler_next(%struct.htrace_sampler* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *OICCalloc(size_t num, size_t size) {
  if (0 == size || 0 == num) {
    return NULL;
  }
  return calloc(num, size);
}


x86 assembly (clang, -O0):
<OICCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
je     1138 <OICCalloc+0x28>
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1145 <OICCalloc+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1156 <OICCalloc+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OICCalloc>:
test   %rdi,%rdi
je     111f <OICCalloc+0xf>
test   %rsi,%rsi
je     111f <OICCalloc+0xf>
jmp    1030 <calloc@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @OICCalloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = icmp eq i64 %0, 0
%5 = or i1 %4, %3
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @calloc(i64 %0, i64 %1)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %9
}
int get_checkbits(int data_bits) {
  int check_bits = 3;
  int m = 4;
  while (m < data_bits) {
    check_bits += 1;
    m *= 2;
  }
  return check_bits;
}


x86 assembly (clang, -O0):
<get_checkbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <get_checkbits+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <get_checkbits+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_checkbits>:
mov    $0x3,%eax
cmp    $0x5,%edi
jl     1129 <get_checkbits+0x29>
mov    $0x3,%eax
mov    $0x4,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    %ecx,%ecx
cmp    %edi,%ecx
jl     1120 <get_checkbits+0x20>
ret

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

LLVM IR (-O2):
define i32 @get_checkbits(i32 %0) {
%2 = icmp sgt i32 %0, 4
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 4, %1 ]
%5 = phi i32 [ %6, %3 ], [ 3, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = shl nsw i32 %4, 1
%8 = icmp slt i32 %7, %0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 3, %1 ], [ %6, %3 ]
ret i32 %10
}
__attribute__((no, noclone)) signed __int128 t112_4sub(signed __int128 x) {
  signed __int128 y = (0);
  signed __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t112_4sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
seto   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t112_4sub+0x5e>
jmp    1175 <t112_4sub+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define { i64, i64 } @t112_4sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 0, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t112_4sub(i64 %0, i64 %1) {
%3 = insertvalue { i64, i64 } poison, i64 %0, 0
%4 = insertvalue { i64, i64 } %3, i64 %1, 1
ret { i64, i64 } %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
void *malloc(int);
int /*<<< orphan*/ stderr;
void *mymalloc(int size, char *what) {
  void *dummy = malloc(size);
  if (!dummy) {
    fprintf(stderr, "failed to allocate %d bytes for %s\n", size, what);
    exit(1);
  }
  return dummy;
}


x86 assembly (clang, -O0):
<mymalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117c <mymalloc+0x4c>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <malloc@plt>
test   %rax,%rax
je     1149 <mymalloc+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"failed to allocate %d bytes for %s\0A\00"
define i8* @mymalloc(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i32, i32* %3
%13 = load i8*, i8** %4
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"failed to allocate %d bytes for %s\0A\00"
define noalias i8* @mymalloc(i32 %0, i8* %1) {
%3 = tail call i8* @malloc(i32 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
void retardo(long n) {
  long i;
  for (i = 0; i <= n; i++)
    ;
  for (i = 0; i <= n; i++)
    ;
  for (i = 0; i <= n; i++)
    ;
  return;
}


x86 assembly (clang, -O0):
<retardo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     1134 <retardo+0x34>
jmp    1123 <retardo+0x23>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <retardo+0x10>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     1160 <retardo+0x60>
jmp    114f <retardo+0x4f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113c <retardo+0x3c>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     118c <retardo+0x8c>
jmp    117b <retardo+0x7b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1168 <retardo+0x68>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @retardo(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %9, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp sle i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load i64, i64* %3
%11 = add nsw i64 %10, 1
store i64 %11, i64* %3
br label %4
12: ; preds = %4
store i64 0, i64* %3
br label %13
13: ; preds = %18, %12
%14 = load i64, i64* %3
%15 = load i64, i64* %2
%16 = icmp sle i64 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
br label %18
18: ; preds = %17
%19 = load i64, i64* %3
%20 = add nsw i64 %19, 1
store i64 %20, i64* %3
br label %13
21: ; preds = %13
store i64 0, i64* %3
br label %22
22: ; preds = %27, %21
%23 = load i64, i64* %3
%24 = load i64, i64* %2
%25 = icmp sle i64 %23, %24
br i1 %25, label %26, label %30
26: ; preds = %22
br label %27
27: ; preds = %26
%28 = load i64, i64* %3
%29 = add nsw i64 %28, 1
store i64 %29, i64* %3
br label %22
30: ; preds = %22
ret void
}

LLVM IR (-O2):
define void @retardo(i64 %0) {
ret void
}
/* Type definitions */
struct net_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ LOG_MSG(char *);
int rtl8169_stop(struct net_device *dev) {
  LOG_MSG("rtl8169_open is called\n");
  return 0;
}


x86 assembly (clang, -O0):
<rtl8169_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <LOG_MSG@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.net_device = type { i32 }
@.str = [24 x i8] c"rtl8169_open is called\0A\00"
define i32 @rtl8169_stop(%struct.net_device* %0) {
%2 = alloca %struct.net_device*
store %struct.net_device* %0, %struct.net_device** %2
%3 = call i32 @LOG_MSG(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.net_device = type { i32 }
@.str = [24 x i8] c"rtl8169_open is called\0A\00"
define i32 @rtl8169_stop(%struct.net_device* nocapture readnone %0) {
%2 = tail call i32 @LOG_MSG(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int rand();
int poison_random_life() { return (20 + rand() % 80); }


x86 assembly (clang, -O0):
<poison_random_life>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x50,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x14,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<poison_random_life>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
shl    $0x4,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x14,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @poison_random_life() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 80
%3 = add nsw i32 20, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @poison_random_life() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 80
%3 = add nsw i32 %2, 20
ret i32 %3
}
/* Variables and functions */
int _ctype_lookup(int);
int iscntrl(int c) { return _ctype_lookup(c) & (0x20); }


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

x86 assembly (clang, -O2):
<iscntrl>:
push   %rax
call   1030 <_ctype_lookup@plt>
and    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_ctype_lookup(i32 %3)
%5 = and i32 %4, 32
ret i32 %5
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = tail call i32 @_ctype_lookup(i32 %0)
%3 = and i32 %2, 32
ret i32 %3
}
void vec2_copy(const float a[2], float out[2]) {
  out[0] = a[0];
  out[1] = a[1];
}


x86 assembly (clang, -O0):
<vec2_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_copy>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
ret

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

LLVM IR (-O2):
define void @vec2_copy(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 1
store float %5, float* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_device();
int /*<<< orphan*/ stop_capturing();
int /*<<< orphan*/ uninit_device();
void ShutdownV4l() {
  stop_capturing();
  uninit_device();
  close_device();
}


x86 assembly (clang, -O0):
<ShutdownV4l>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <stop_capturing@plt>
mov    $0x0,%al
call   1040 <uninit_device@plt>
mov    $0x0,%al
call   1050 <close_device@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShutdownV4l>:
push   %rax
xor    %eax,%eax
call   1030 <stop_capturing@plt>
xor    %eax,%eax
call   1040 <uninit_device@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <close_device@plt>

LLVM IR (-O0):
define void @ShutdownV4l() {
%1 = call i32 (...) @stop_capturing()
%2 = call i32 (...) @uninit_device()
%3 = call i32 (...) @close_device()
ret void
}

LLVM IR (-O2):
define void @ShutdownV4l() {
%1 = tail call i32 (...) @stop_capturing()
%2 = tail call i32 (...) @uninit_device()
%3 = tail call i32 (...) @close_device()
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
__attribute__((always_)) int32_t clamp(int32_t min, int32_t max, int32_t n) {
  n = n > max ? max : n;
  return n < min ? min : n;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    112b <clamp+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1133 <clamp+0x33>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1156 <clamp+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    115e <clamp+0x5e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @clamp(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* %5
%9 = icmp sgt i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i64, i64* %5
br label %14
12: ; preds = %3
%13 = load i64, i64* %6
br label %14
14: ; preds = %12, %10
%15 = phi i64 [ %11, %10 ], [ %13, %12 ]
store i64 %15, i64* %6
%16 = load i64, i64* %6
%17 = load i64, i64* %4
%18 = icmp slt i64 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i64, i64* %4
br label %23
21: ; preds = %14
%22 = load i64, i64* %6
br label %23
23: ; preds = %21, %19
%24 = phi i64 [ %20, %19 ], [ %22, %21 ]
ret i64 %24
}

LLVM IR (-O2):
define i64 @clamp(i64 %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %2, %1
%5 = select i1 %4, i64 %1, i64 %2
%6 = icmp slt i64 %5, %0
%7 = select i1 %6, i64 %0, i64 %5
ret i64 %7
}
/* Variables and functions */
int open(char const *, int, int);
int metautils_syscall_open(const char *p, int flag, int mode) {
  return open(p, flag, mode);
}


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

x86 assembly (clang, -O2):
<metautils_syscall_open>:
jmp    1030 <open@plt>

LLVM IR (-O0):
define i32 @metautils_syscall_open(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 @open(i8* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @metautils_syscall_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void fatal(char *s1, char *s2, int n) {
  fprintf(stderr, "%s%s\n", s1, s2);
  exit(n);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rbx
mov    %edx,%ebx
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s%s\0A\00"
define void @fatal(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = tail call i32 @exit(i32 %2)
unreachable
}
void sigterm(signo) int signo;
{ fatal(2, "SIGTERM"); }


x86 assembly (clang, -O0):
<sigterm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigterm>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
xor    %eax,%eax
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"SIGTERM\00"
define void @sigterm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @fatal to i32 (i32, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"SIGTERM\00"
define void @sigterm(i32 %0) {
%2 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @fatal to i32 (i32, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
void RTStrToUInt32(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToUInt32() {
ret void
}
void why_me(void) {
  printf("The func is %s.\n", __func__);
  printf("The line is %d.\n", 512);
}


x86 assembly (clang, -O0):
<why_me>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x200,%esi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<why_me>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef2(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x200,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"The func is %s.\0A\00"
@__func__.why_me = [7 x i8] c"why_me\00"
@.str.1 = [17 x i8] c"The line is %d.\0A\00"
define void @why_me() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.why_me, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 512)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"The func is %s.\0A\00"
@__func__.why_me = [7 x i8] c"why_me\00"
@.str.1 = [17 x i8] c"The line is %d.\0A\00"
define void @why_me() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.why_me, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 512)
ret void
}
/* Variables and functions */
char *intsize_to_string(int);
int /*<<< orphan*/ puts(char *);
char *uintsize_to_string(int);
int main(void) {
  char *str0 = uintsize_to_string(32);
  puts(str0);
  char *str1 = uintsize_to_string(0);
  puts(str1);
  char *str2 = intsize_to_string(-32);
  puts(str2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x20,%edi
call   1040 <uintsize_to_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <uintsize_to_string@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <puts@plt>
mov    $0xffffffe0,%edi
call   1050 <intsize_to_string@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x20,%edi
call   1040 <uintsize_to_string@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <uintsize_to_string@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
mov    $0xffffffe0,%edi
call   1050 <intsize_to_string@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @uintsize_to_string(i32 32)
%2 = tail call i32 @puts(i8* dereferenceable(1) %1)
%3 = tail call i8* @uintsize_to_string(i32 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = tail call i8* @intsize_to_string(i32 -32)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
void settleTime(time) {
  int i;
  for (i = time; i != 0; --i) {
    asm("");
  }
}


x86 assembly (clang, -O0):
<settleTime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1125 <settleTime+0x25>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110d <settleTime+0xd>
pop    %rbp
ret

x86 assembly (clang, -O2):
<settleTime>:
test   %edi,%edi
je     1115 <settleTime+0x15>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0xffffffff,%edi
jne    1110 <settleTime+0x10>
ret

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

LLVM IR (-O2):
define void @settleTime(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%5 = add nsw i32 %4, -1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _nfree(void *p) {
  if (p)
    free(p);
}


x86 assembly (clang, -O0):
<_nfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <_nfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nfree>:
test   %rdi,%rdi
je     111a <_nfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @_nfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @_nfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int PseudoRandomUsingAtomic_nex();
int /*<<< orphan*/ __VERIFIER_error();
void *thr1(void *arg) {
  {
    if (!(PseudoRandomUsingAtomic_nex() <= 10)) {
    ERROR:
      __VERIFIER_error();
      (void)0;
    }
  };
  return 0;
}


x86 assembly (clang, -O0):
<thr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PseudoRandomUsingAtomic_nex@plt>
cmp    $0xa,%eax
jle    1148 <thr1+0x28>
jmp    1141 <thr1+0x21>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr1>:
push   %rax
xor    %eax,%eax
call   1030 <PseudoRandomUsingAtomic_nex@plt>
cmp    $0xb,%eax
jl     1134 <thr1+0x14>
xor    %eax,%eax
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @thr1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @PseudoRandomUsingAtomic_nex()
%4 = icmp sle i32 %3, 10
br i1 %4, label %8, label %5
5: ; preds = %1
br label %6
6: ; preds = %5
%7 = call i32 (...) @__VERIFIER_error()
br label %8
8: ; preds = %6, %1
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thr1(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @PseudoRandomUsingAtomic_nex()
%3 = icmp slt i32 %2, 11
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @__VERIFIER_error()
br label %6
6: ; preds = %4, %1
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ __NR_unlink;
int syscall(int /*<<< orphan*/, char const *);
int f_unlink(const char *pathname) { return syscall(__NR_unlink, pathname); }


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

x86 assembly (clang, -O2):
<f_unlink>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_unlink = global i32 0
define i32 @f_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @__NR_unlink
%4 = load i8*, i8** %2
%5 = call i32 @syscall(i32 %3, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@__NR_unlink = global i32 0
define i32 @f_unlink(i8* %0) {
%2 = load i32, i32* @__NR_unlink
%3 = tail call i32 @syscall(i32 %2, i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void display_string(char *string) {
  while (*string != '\0') {
    putchar(*string);
    ++string;
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<display_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <display_string+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <display_string+0xc>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <display_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <display_string+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @display_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetCamera();
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void myReshape(int w, int h) {
  SetCamera();
  glViewport(0, 0, w, h);
}


x86 assembly (clang, -O0):
<myReshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <SetCamera@plt>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <glViewport@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myReshape>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <SetCamera@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <glViewport@plt>

LLVM IR (-O0):
define void @myReshape(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @SetCamera()
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @glViewport(i32 0, i32 0, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @myReshape(i32 %0, i32 %1) {
%3 = tail call i32 (...) @SetCamera()
%4 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
ret void
}
/* Type definitions */
struct taint {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void shift_taints(struct taint *dst, struct taint *src, int level) {
  fprintf(stderr, "Should not use SHIFT taints in copy mode\n");
}


x86 assembly (clang, -O0):
<shift_taints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_taints>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.taint = type { i32 }
@stderr = global i32 0
@.str = [42 x i8] c"Should not use SHIFT taints in copy mode\0A\00"
define void @shift_taints(%struct.taint* %0, %struct.taint* %1, i32 %2) {
%4 = alloca %struct.taint*
%5 = alloca %struct.taint*
%6 = alloca i32
store %struct.taint* %0, %struct.taint** %4
store %struct.taint* %1, %struct.taint** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.taint = type { i32 }
@stderr = global i32 0
@.str = [42 x i8] c"Should not use SHIFT taints in copy mode\0A\00"
define void @shift_taints(%struct.taint* nocapture readnone %0, %struct.taint* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}