xunge/DecIR huggingface dataset:
/* Variables and functions */
int sqrt(int);
int isprime(int num) {
  int i = 2;
  for (; i <= sqrt(num); ++i) {
    if (num % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     116c <isprime+0x5c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1159 <isprime+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1173 <isprime+0x63>
jmp    115e <isprime+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <isprime+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jl     1150 <isprime+0x40>
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %ebx,%eax
cltd
idiv   %ebp
test   %edx,%edx
je     114e <isprime+0x3e>
mov    %ebx,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebp
jl     1130 <isprime+0x20>
mov    $0x1,%eax
jmp    1150 <isprime+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %12, label %8
4: ; preds = %8
%5 = add nuw nsw i32 %9, 1
%6 = tail call i32 @sqrt(i32 %0)
%7 = icmp slt i32 %9, %6
br i1 %7, label %8, label %12
8: ; preds = %1, %4
%9 = phi i32 [ %5, %4 ], [ 2, %1 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %8, %4, %1
%13 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %13
}
int tcsendbreak(int fildes, int duration) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<tcsendbreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
lea    0xed9(%rip),%rsi
lea    0xee4(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    1135 <tcsendbreak+0x25>

x86 assembly (clang, -O2):
<tcsendbreak>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <tcsendbreak+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.tcsendbreak = [12 x i8] c"tcsendbreak\00"
define i32 @tcsendbreak(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.tcsendbreak, i64 0, i64 0))
br label %6
6: ; preds = %2, %6
br label %6
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.tcsendbreak = [12 x i8] c"tcsendbreak\00"
define i32 @tcsendbreak(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.tcsendbreak, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", 10);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
int width(int *figure) {
  int max = 0;
  for (int i = 0; i < 4; i++) {
    int width = figure[i] % 10;
    if (width > max)
      max = width;
  }
  return max;
}


x86 assembly (clang, -O0):
<width>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    115b <width+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1148 <width+0x48>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114d <width+0x4d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <width+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<width>:
movslq (%rdi),%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
xor    %edx,%edx
sub    %ecx,%eax
cmovs  %edx,%eax
movslq 0x4(%rdi),%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
cmp    %eax,%ecx
cmovle %eax,%ecx
movslq 0x8(%rdi),%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edx
cmp    %ecx,%edx
cmovle %ecx,%edx
movslq 0xc(%rdi),%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cmp    %edx,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @width(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = srem i32 %2, 10
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = srem i32 %7, 10
%9 = icmp sgt i32 %8, %5
%10 = select i1 %9, i32 %8, i32 %5
%11 = getelementptr inbounds i32, i32* %0, i64 2
%12 = load i32, i32* %11
%13 = srem i32 %12, 10
%14 = icmp sgt i32 %13, %10
%15 = select i1 %14, i32 %13, i32 %10
%16 = getelementptr inbounds i32, i32* %0, i64 3
%17 = load i32, i32* %16
%18 = srem i32 %17, 10
%19 = icmp sgt i32 %18, %15
%20 = select i1 %19, i32 %18, i32 %15
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ errno;
scalar_t__ execvp(char const *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void aeternum_exec(const char *filename, char *args[]) {
  if (execvp(filename, args) != 0) {
    perror("execvp()");
    exit(errno);
  }
}


x86 assembly (clang, -O0):
<aeternum_exec>:
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   1040 <execvp@plt>
cmp    $0x0,%rax
je     1171 <aeternum_exec+0x41>
lea    0xea2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeternum_exec>:
push   %rax
call   1040 <execvp@plt>
test   %rax,%rax
jne    113d <aeternum_exec+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"execvp()\00"
@errno = global i32 0
define void @aeternum_exec(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call i64 @execvp(i8* %5, i8** %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @errno
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"execvp()\00"
@errno = global i32 0
define void @aeternum_exec(i8* %0, i8** %1) {
%3 = tail call i64 @execvp(i8* %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @errno
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
void av_tree_node_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_tree_node_alloc() {
ret void
}
extern void mdp_ppp_init_scale(struct mdp_info *mdp) {}


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

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

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

LLVM IR (-O2):
%struct.mdp_info = type opaque
define void @mdp_ppp_init_scale(%struct.mdp_info* nocapture %0) {
ret void
}
/* Variables and functions */
void(Memento_listNewBlocks)(void) {}


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

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

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

LLVM IR (-O2):
define void @Memento_listNewBlocks() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int puts(const char *str) {
  int c, r;
  r = 0;
  while (0 != (c = *str++))
    putchar(c);
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
je     1152 <puts+0x42>
mov    -0xc(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1123 <puts+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+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 <puts+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @puts(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* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putchar(i8 signext %5)
%9 = load i8, i8* %7
%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 i32 0
}
R0A1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ r0 = (*((char *)11111111)); }


x86 assembly (clang, -O0):
<R0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0xa98ac7,%eax
mov    (%rax),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @R0A1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8, i8* inttoptr (i64 11111111 to i8*)
store i8 %16, i8* %8
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @R0A1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ free(void *);
int huBaseFree(void *p) {
  assert(p);
  free(p);
  return 0;
}


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

x86 assembly (clang, -O2):
<huBaseFree>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @huBaseFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @huBaseFree(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage:  encode pchk-file gen-file source-file encoded-file\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"Usage: encode pchk-file gen-file source-file encoded-file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"Usage: encode pchk-file gen-file source-file encoded-file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ report(int /*<<< orphan*/, char *, char const *,
                          int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void log_open_watchtab(const char *path) {
  report(LOG_ERR, "Unable to open watchtab \"%s\": %s", path, strerror(errno));
}


x86 assembly (clang, -O0):
<log_open_watchtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %eax,%ecx
lea    0xea2(%rip),%rsi
call   1030 <report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_open_watchtab>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <report@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [33 x i8] c"Unable to open watchtab \22%s\22: %s\00"
@errno = global i32 0
define void @log_open_watchtab(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_ERR
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i32 @strerror(i32 %5)
%7 = call i32 @report(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [33 x i8] c"Unable to open watchtab \22%s\22: %s\00"
@errno = global i32 0
define void @log_open_watchtab(i8* %0) {
%2 = load i32, i32* @LOG_ERR
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @report(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int OS_Time();
int /*<<< orphan*/ assert(int);
void OS_DelayUntil(int t) {
  int c = OS_Time();
  if (32 == 32) {
    assert(1 <= (t - c) && (t - c) <= 0x7FFFFFFF);
  } else {
    assert(1 <= (t - c) && (t - c) <= 0x7FFF);
  }
}


x86 assembly (clang, -O0):
<OS_DelayUntil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <OS_Time@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edx
sub    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jg     115e <OS_DelayUntil+0x3e>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x7fffffff,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_DelayUntil>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <OS_Time@plt>
xor    %edi,%edi
cmp    %ebx,%eax
setl   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @OS_DelayUntil(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @OS_Time()
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = icmp sle i32 1, %7
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = sub nsw i32 %10, %11
%13 = icmp sle i32 %12, 2147483647
br label %14
14: ; preds = %9, %1
%15 = phi i1 [ false, %1 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret void
}

LLVM IR (-O2):
define void @OS_DelayUntil(i32 %0) {
%2 = tail call i32 (...) @OS_Time()
%3 = icmp slt i32 %2, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpcodeNotDone();
void stsf(void) { OpcodeNotDone(); }


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

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

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

LLVM IR (-O2):
define void @stsf() {
%1 = tail call i32 (...) @OpcodeNotDone()
ret void
}
float my_random_float() {
  int x, exp, mant;
  float f;
  union {
    float f;
    int i;
  } b;
  x = random();
  asm("bsfl %1, %0" : "=r"(exp) : "r"(x));
  exp = 126 - exp;
  mant = x >> 8;
  b.i = (exp << 23) | mant;
  return b.f;
}


x86 assembly (clang, -O0):
<my_random_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsf    %eax,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7e,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x17,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_random_float>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
bsf    %eax,%ecx
sar    $0x8,%eax
shl    $0x17,%ecx
mov    $0x3f000000,%edx
sub    %ecx,%edx
or     %eax,%edx
movd   %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @my_random_float() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca %union.anon
%6 = call i32 (...) @random()
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = call i32 asm "bsfl $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = sub nsw i32 126, %9
store i32 %10, i32* %2
%11 = load i32, i32* %1
%12 = ashr i32 %11, 8
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = shl i32 %13, 23
%15 = load i32, i32* %3
%16 = or i32 %14, %15
%17 = bitcast %union.anon* %5 to i32*
store i32 %16, i32* %17
%18 = bitcast %union.anon* %5 to float*
%19 = load float, float* %18
ret float %19
}

LLVM IR (-O2):
define float @my_random_float() {
%1 = tail call i32 (...) @random()
%2 = tail call i32 asm "bsfl $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %1)
%3 = ashr i32 %1, 8
%4 = mul i32 %2, -8388608
%5 = add i32 %4, 1056964608
%6 = or i32 %5, %3
%7 = bitcast i32 %6 to float
ret float %7
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ write(int, char *, int);
int secu_malloc(char **str, size_t len) {
  if ((*str = (char *)malloc(sizeof(char) * len)) == NULL) {
    write(2,
          "ft_minishell"
          ": malloc failed\n",
          sizeof("ft_minishell"
                 ": malloc failed\n"));
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<secu_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    1172 <secu_malloc+0x52>
mov    $0x2,%edi
lea    0xea4(%rip),%rsi
mov    $0x1d,%edx
call   1030 <write@plt>
movl   $0x0,-0x4(%rbp)
jmp    1179 <secu_malloc+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secu_malloc>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    %rax,(%rbx)
mov    $0x1,%eax
test   %rcx,%rcx
je     113d <secu_malloc+0x1d>
pop    %rbx
ret
lea    0xebc(%rip),%rsi
mov    $0x2,%edi
mov    $0x1d,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"ft_minishell: malloc failed\0A\00"
define i32 @secu_malloc(i8** %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
store i8** %0, i8*** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = mul i64 1, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
%11 = load i8**, i8*** %4
store i8* %10, i8** %11
%12 = icmp eq i8* %10, null
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @write(i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 29)
store i32 0, i32* %3
br label %16
15: ; preds = %2
store i32 1, i32* %3
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [29 x i8] c"ft_minishell: malloc failed\0A\00"
define i32 @secu_malloc(i8** nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %0
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 29)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_sec;
  int tm_min;
  int tm_hour;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int daytime(time_t *time) {
  struct tm *ptm = localtime(time);
  int retval = ptm->tm_sec + ptm->tm_min * 60 + ptm->tm_hour * 3600;
  return retval;
}


x86 assembly (clang, -O0):
<daytime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   $0x3c,0x4(%rcx),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
imul   $0xe10,0x8(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daytime>:
push   %rax
call   1030 <localtime@plt>
imul   $0x3c,0x4(%rax),%ecx
add    (%rax),%ecx
imul   $0xe10,0x8(%rax),%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32 }
define i32 @daytime(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.tm*
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call %struct.tm* @localtime(i32* %5)
store %struct.tm* %6, %struct.tm** %3
%7 = load %struct.tm*, %struct.tm** %3
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load %struct.tm*, %struct.tm** %3
%11 = getelementptr inbounds %struct.tm, %struct.tm* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = mul nsw i32 %12, 60
%14 = add nsw i32 %9, %13
%15 = load %struct.tm*, %struct.tm** %3
%16 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 2
%17 = load i32, i32* %16
%18 = mul nsw i32 %17, 3600
%19 = add nsw i32 %14, %18
store i32 %19, i32* %4
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32 }
define i32 @daytime(i32* %0) {
%2 = tail call %struct.tm* @localtime(i32* %0)
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 1
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 60
%8 = add nsw i32 %7, %4
%9 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 2
%10 = load i32, i32* %9
%11 = mul nsw i32 %10, 3600
%12 = add nsw i32 %8, %11
ret i32 %12
}
int char_to_ui(char c) { return (((int)c < 0) ? (-((int)c) + 127) : (int)c); }


x86 assembly (clang, -O0):
<char_to_ui>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jge    112a <char_to_ui+0x2a>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x7f,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <char_to_ui+0x31>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_ui>:
mov    $0x7f,%eax
sub    %edi,%eax
test   %dil,%dil
cmovns %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @char_to_ui(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp slt i8 %0, 0
%4 = sub nsw i32 127, %2
%5 = select i1 %3, i32 %4, i32 %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
unsigned int __VERIFIER_nondet_uint();
int main(void) {
  unsigned int a = __VERIFIER_nondet_uint();
  __VERIFIER_assert(a >= 1);
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_uint@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_uint@plt>
mov    %eax,%ebx
xor    %edi,%edi
test   %eax,%eax
setne  %dil
call   1030 <__VERIFIER_assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_uint()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp uge i32 %4, 1
%6 = zext i1 %5 to i32
%7 = call i32 @__VERIFIER_assert(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_uint()
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assert(i32 %3)
ret i32 %1
}
char *ReplaceChar(char *dst, char old, char new) {
  const char *src = dst;
  char c;
  while ((c = *src++)) {
    if (c == old)
      c = new;
    *dst++ = c;
  }
  *dst = '\0';
  return dst;
}


x86 assembly (clang, -O0):
<ReplaceChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
cmp    $0x0,%al
je     1166 <ReplaceChar+0x66>
movsbl -0x19(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114d <ReplaceChar+0x4d>
mov    -0xa(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111b <ReplaceChar+0x1b>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReplaceChar>:
mov    (%rdi),%cl
test   %cl,%cl
je     112e <ReplaceChar+0x2e>
movzbl %dl,%edx
nopl   0x0(%rax)
cmp    %sil,%cl
movzbl %cl,%ecx
cmove  %edx,%ecx
lea    0x1(%rdi),%rax
mov    %cl,(%rdi)
movzbl 0x1(%rdi),%ecx
mov    %rax,%rdi
test   %cl,%cl
jne    1110 <ReplaceChar+0x10>
movb   $0x0,(%rax)
ret
mov    %rdi,%rax
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @ReplaceChar(i8* %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %12, %6 ], [ %4, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = icmp eq i8 %7, %1
%11 = select i1 %10, i8 %2, i8 %7
store i8 %11, i8* %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3
%15 = phi i8* [ %0, %3 ], [ %9, %6 ]
store i8 0, i8* %15
ret i8* %15
}
int test_imm_94int64_lowword_reg(long long val) {
  return ((val) & (0x94 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_94int64_lowword_reg>:
test   $0x94,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_94int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 148
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void av_thread_message_queue_recv() {}


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

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

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

LLVM IR (-O2):
define void @av_thread_message_queue_recv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, int, char *, int, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void write(int fd, char *msg, int size) { int80(4, fd, msg, size, 0, 0); }


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x4,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <int80@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x4,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <int80@plt>

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

LLVM IR (-O2):
define void @write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @int80(i32 4, i32 %0, i8* %1, i32 %2, i32 0, i32 0)
ret void
}
unsigned short to_uns_short(__float128 a) { return (unsigned short)a; }


x86 assembly (clang, -O0):
<to_uns_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
call   1120 <__fixtfsi>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret
xchg   %ax,%ax

x86 assembly (clang, -O2):
<to_uns_short>:
push   %rax
call   1110 <__fixtfsi>
pop    %rcx
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define zeroext i16 @to_uns_short(fp128 %0) {
%2 = alloca fp128
store fp128 %0, fp128* %2
%3 = load fp128, fp128* %2
%4 = fptoui fp128 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @to_uns_short(fp128 %0) {
%2 = fptoui fp128 %0 to i16
ret i16 %2
}
const char *ls_cost_nm10_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_cost_nm10_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_cost_nm10_name_in+0x2b>
jmp    111a <ls_cost_nm10_name_in+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_cost_nm10_name_in+0x3b>
jmp    114b <ls_cost_nm10_name_in+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm10_name_in+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm10_name_in+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm10_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @ls_cost_nm10_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @ls_cost_nm10_name_in(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
int ackerman(int m, int n) {
  if (m == 0)
    return n + 1;
  if (m > 0 && n == 0)
    return ackerman(m - 1, 1);
  return ackerman(m - 1, ackerman(m, n - 1));
}


x86 assembly (clang, -O0):
<ackerman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <ackerman+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <ackerman+0x76>
cmpl   $0x0,-0x8(%rbp)
jle    1162 <ackerman+0x52>
cmpl   $0x0,-0xc(%rbp)
jne    1162 <ackerman+0x52>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <ackerman@plt>
mov    %eax,-0x4(%rbp)
jmp    1186 <ackerman+0x76>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <ackerman@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <ackerman@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ackerman>:
push   %rbx
test   %edi,%edi
je     1140 <ackerman+0x30>
mov    %edi,%ebx
jmp    1131 <ackerman+0x21>
nopl   0x0(%rax)
add    $0xffffffff,%esi
mov    %ebx,%edi
call   1030 <ackerman@plt>
mov    %eax,%esi
add    $0xffffffff,%ebx
je     1142 <ackerman+0x32>
test   %ebx,%ebx
jle    1120 <ackerman+0x10>
mov    $0x1,%eax
test   %esi,%esi
je     112a <ackerman+0x1a>
jmp    1120 <ackerman+0x10>
mov    %esi,%eax
add    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ackerman(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %13, %2
%5 = phi i32 [ %1, %2 ], [ %14, %13 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %13
%8 = phi i32 [ %14, %13 ], [ %1, %2 ]
%9 = phi i32 [ %15, %13 ], [ %0, %2 ]
%10 = icmp sgt i32 %9, 0
%11 = icmp eq i32 %8, 0
%12 = and i1 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %7, %17
%14 = phi i32 [ %19, %17 ], [ 1, %7 ]
%15 = add nsw i32 %9, -1
%16 = icmp eq i32 %15, 0
br i1 %16, label %4, label %7
17: ; preds = %7
%18 = add nsw i32 %8, -1
%19 = tail call i32 @ackerman(i32 %9, i32 %18)
br label %13
}
/* Variables and functions */
double ceil(double);
__attribute__((__weak__, __always___)) double softboundcets_ceil(double x) {
  return ceil(x);
}


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

x86 assembly (clang, -O2):
<softboundcets_ceil>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define weak double @softboundcets_ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.ceil.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define weak double @softboundcets_ceil(double %0) {
%2 = tail call double @llvm.ceil.f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ handle_CONT(int /*<<< orphan*/);
int gen_CONT() {
  handle_CONT(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_CONT>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_CONT@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_CONT() {
%1 = call i32 @handle_CONT(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_CONT() {
%1 = tail call i32 @handle_CONT(i32 0)
ret i32 0
}
/* Variables and functions */
long lrand48();
long random(void) { return lrand48(); }


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

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

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

LLVM IR (-O2):
define i64 @random() {
%1 = tail call i64 (...) @lrand48()
ret i64 %1
}
/* Variables and functions */
int compiler();
int main() {
  compiler();
  compiler();
  return compiler();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <compiler@plt>
xor    %eax,%eax
call   1030 <compiler@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <compiler@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @compiler()
%2 = tail call i32 (...) @compiler()
%3 = tail call i32 (...) @compiler()
ret i32 %3
}
void ASN1_GENERALSTRING_new(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_GENERALSTRING_new() {
ret void
}
/* Variables and functions */
int isFive(int /*<<< orphan*/);
int isFive2(int);
int isFive3(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%i\n", isFive(0));
  printf("%i\n", isFive2(5));
  printf("%i\n", isFive3(2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1060 <isFive@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <isFive2@plt>
mov    %eax,%esi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <isFive3@plt>
mov    %eax,%esi
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1060 <isFive@plt>
lea    0xeb1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <isFive2@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <isFive3@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @isFive(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isFive2(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @isFive3(i32 2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void swap(int *x, int *y) {
  int z = *x;
  *x = *y;
  *y = z;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int u8isbasespacei(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointcc(char const *);
int u8isbasespacecc(const char *c) { return u8isbasespacei(u8tointcc(c)); }


x86 assembly (clang, -O0):
<u8isbasespacecc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointcc@plt>
mov    %eax,%edi
call   1040 <u8isbasespacei@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isbasespacecc>:
push   %rax
call   1030 <u8tointcc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isbasespacei@plt>

LLVM IR (-O0):
define i32 @u8isbasespacecc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @u8tointcc(i8* %3)
%5 = call i32 @u8isbasespacei(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @u8isbasespacecc(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
%3 = tail call i32 @u8isbasespacei(i32 %2)
ret i32 %3
}
void XKillClient() {}


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

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

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

LLVM IR (-O2):
define void @XKillClient() {
ret void
}