xunge/DecIR huggingface dataset:
/* Variables and functions */
int is_longopt(const char *arg) {
  return arg != NULL && arg[0] == '-' && arg[1] == '-' && arg[2] != '\0';
}


x86 assembly (clang, -O0):
<is_longopt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1154 <is_longopt+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
jne    1154 <is_longopt+0x54>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
jne    1154 <is_longopt+0x54>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_longopt>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <is_longopt+0x1b>
cmpb   $0x2d,(%rdi)
jne    111b <is_longopt+0x1b>
cmpb   $0x2d,0x1(%rdi)
jne    111b <is_longopt+0x1b>
xor    %eax,%eax
cmpb   $0x0,0x2(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @is_longopt(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 %23
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %11, label %23
11: ; preds = %5
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 45
br i1 %16, label %17, label %23
17: ; preds = %11
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 0
br label %23
23: ; preds = %17, %11, %5, %1
%24 = phi i1 [ false, %11 ], [ false, %5 ], [ false, %1 ], [ %22, %17 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @is_longopt(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 45
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 45
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %10, %6, %3, %1
%16 = phi i32 [ 0, %6 ], [ 0, %3 ], [ 0, %1 ], [ %14, %10 ]
ret i32 %16
}
char get_num_len(unsigned int value) {
  char l = 1;
  while (value > 9) {
    l++;
    value /= 10;
  }
  return l;
}


x86 assembly (clang, -O0):
<get_num_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
cmpl   $0x9,-0x4(%rbp)
jbe    1131 <get_num_len+0x31>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
jmp    110b <get_num_len+0xb>
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_len>:
mov    $0x1,%al
cmp    $0xa,%edi
jb     1123 <get_num_len+0x23>
mov    $0x1,%al
mov    $0xcccccccd,%ecx
xchg   %ax,%ax
add    $0x1,%al
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x63,%edi
mov    %edx,%edi
ja     1110 <get_num_len+0x10>
ret

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

LLVM IR (-O2):
define signext i8 @get_num_len(i32 %0) {
%2 = icmp ugt i32 %0, 9
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i8 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i8 %4, 1
%7 = udiv i32 %5, 10
%8 = icmp ugt i32 %5, 99
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i8 [ 1, %1 ], [ %6, %3 ]
ret i8 %10
}
/* Variables and functions */
int con_put_str(char *);
int con_cls() { return con_put_str("\x1b[2J"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
define i32 @con_cls() {
%1 = call i32 @con_put_str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define i32 @con_cls() {
%1 = tail call i32 @con_put_str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int strncmp(char const *, char const *, int);
int compare_strings_1(const void *a, const void *b) {
  return strncmp(*(const char **)a, *(const char **)b, 1);
}


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

x86 assembly (clang, -O2):
<compare_strings_1>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    $0x1,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @compare_strings_1(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strncmp(i8* %7, i8* %10, i32 1)
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_strings_1(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strncmp(i8* %4, i8* %6, i32 1)
ret i32 %7
}
int test_omp_nested() {
  int counter = 0;
#pragma omp parallel shared(counter)
  {
#pragma omp critical
    counter++;
#pragma omp parallel
    {
#pragma omp critical
      counter--;
    }
  }
  return (counter != 0);
}


x86 assembly (clang, -O0):
<test_omp_nested>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_omp_nested() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_omp_nested() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fclose(void *);
void zfile_fclose(void *z) { fclose(z); }


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

x86 assembly (clang, -O2):
<zfile_fclose>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @zfile_fclose(i8* nocapture %0) {
%2 = tail call i32 @fclose(i8* %0)
ret void
}
/* Type definitions */
struct CMatchFinder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ MatchFinder_MoveBlock(struct CMatchFinder *);
scalar_t__ MatchFinder_NeedMove(struct CMatchFinder *);
int /*<<< orphan*/ MatchFinder_ReadBlock(struct CMatchFinder *);
void MatchFinder_CheckAndMoveAndRead(struct CMatchFinder *p) {
  if (MatchFinder_NeedMove(p))
    MatchFinder_MoveBlock(p);
  MatchFinder_ReadBlock(p);
}


x86 assembly (clang, -O0):
<MatchFinder_CheckAndMoveAndRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <MatchFinder_NeedMove@plt>
cmp    $0x0,%rax
je     1158 <MatchFinder_CheckAndMoveAndRead+0x28>
mov    -0x8(%rbp),%rdi
call   1050 <MatchFinder_MoveBlock@plt>
mov    -0x8(%rbp),%rdi
call   1040 <MatchFinder_ReadBlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatchFinder_CheckAndMoveAndRead>:
push   %rbx
mov    %rdi,%rbx
call   1030 <MatchFinder_NeedMove@plt>
test   %rax,%rax
je     1146 <MatchFinder_CheckAndMoveAndRead+0x16>
mov    %rbx,%rdi
call   1050 <MatchFinder_MoveBlock@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <MatchFinder_ReadBlock@plt>

LLVM IR (-O0):
%struct.CMatchFinder = type { i32 }
define void @MatchFinder_CheckAndMoveAndRead(%struct.CMatchFinder* %0) {
%2 = alloca %struct.CMatchFinder*
store %struct.CMatchFinder* %0, %struct.CMatchFinder** %2
%3 = load %struct.CMatchFinder*, %struct.CMatchFinder** %2
%4 = call i64 @MatchFinder_NeedMove(%struct.CMatchFinder* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.CMatchFinder*, %struct.CMatchFinder** %2
%8 = call i32 @MatchFinder_MoveBlock(%struct.CMatchFinder* %7)
br label %9
9: ; preds = %6, %1
%10 = load %struct.CMatchFinder*, %struct.CMatchFinder** %2
%11 = call i32 @MatchFinder_ReadBlock(%struct.CMatchFinder* %10)
ret void
}

LLVM IR (-O2):
%struct.CMatchFinder = type { i32 }
define void @MatchFinder_CheckAndMoveAndRead(%struct.CMatchFinder* %0) {
%2 = tail call i64 @MatchFinder_NeedMove(%struct.CMatchFinder* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @MatchFinder_MoveBlock(%struct.CMatchFinder* %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @MatchFinder_ReadBlock(%struct.CMatchFinder* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func(int *index) {
  printf("%d\n", *index);
  *index++;
  func(index);
}


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

x86 assembly (clang, -O2):
<func>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
xchg   %ax,%ax
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x4,%rbx
jmp    1120 <func+0x10>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @func(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32* [ %0, %1 ], [ %6, %2 ]
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds i32, i32* %3, i64 1
br label %2
}
/* Variables and functions */
int close(int);
int real_close(int fd) { return close(fd); }


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

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

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

LLVM IR (-O2):
define i32 @real_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_PALETTE_swap(char *, int);
void U_WMRSETPALENTRIES_swap(char *record, int torev) {
  U_WMRCORE_PALETTE_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRSETPALENTRIES_swap>:
jmp    1030 <U_WMRCORE_PALETTE_swap@plt>

LLVM IR (-O0):
define void @U_WMRSETPALENTRIES_swap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @U_WMRCORE_PALETTE_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRSETPALENTRIES_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_PALETTE_swap(i8* %0, i32 %1)
ret void
}
void get_formalparmtype(const char *arg, char *formal) {
  while (*arg != '|' && *arg != '\0')
    *formal++ = *arg++;
  *formal = '\0';
}


x86 assembly (clang, -O0):
<get_formalparmtype>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x7c,%ecx
mov    %al,-0x11(%rbp)
je     1131 <get_formalparmtype+0x31>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1141 <get_formalparmtype+0x41>
jmp    1168 <get_formalparmtype+0x68>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <get_formalparmtype+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_formalparmtype>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1126 <get_formalparmtype+0x26>
cmp    $0x7c,%cl
je     1126 <get_formalparmtype+0x26>
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
jmp    1110 <get_formalparmtype+0x10>
movb   $0x0,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @get_formalparmtype(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %17, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 124
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %10, %5
%16 = phi i1 [ false, %5 ], [ %14, %10 ]
br i1 %16, label %17, label %23
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
%20 = load i8, i8* %18
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
store i8 %20, i8* %21
br label %5
23: ; preds = %15
%24 = load i8*, i8** %4
store i8 0, i8* %24
ret void
}

LLVM IR (-O2):
define void @get_formalparmtype(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = phi i8* [ %1, %2 ], [ %9, %7 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 124, label %10
i8 0, label %10
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %6, i8* %5
br label %3
10: ; preds = %3, %3
store i8 0, i8* %5
ret void
}
unsigned int millis() {
  volatile unsigned int *uart = (volatile unsigned int *)0x90000000;
  return *(uart + 3);
}


x86 assembly (clang, -O0):
<millis>:
push   %rbp
mov    %rsp,%rbp
mov    $0x90000000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<millis>:
mov    $0x9000000c,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @millis() {
%1 = alloca i32*
store i32* inttoptr (i64 2415919104 to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = getelementptr inbounds i32, i32* %2, i64 3
%4 = load volatile i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @millis() {
%1 = load volatile i32, i32* inttoptr (i64 2415919116 to i32*)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void newline(void) { printf("\n"); }


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

x86 assembly (clang, -O2):
<newline>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @newline() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int rand();
int sorteio() {
  int num;
  num = (rand() % 6) + 1;
  return num;
}


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

x86 assembly (clang, -O2):
<sorteio>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sorteio() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 6
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @sorteio() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}
void ecm_sfe_multicast_ipv6_init(void) { return; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @block_fatal_signals() {
ret void
}
int hashInt(int key, int capacity) {
  return key >= 0 ? key % capacity : (capacity - 1 - (-key) % capacity);
}


x86 assembly (clang, -O0):
<hashInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1123 <hashInt+0x23>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
jmp    113d <hashInt+0x3d>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashInt>:
mov    %edi,%eax
cltd
test   %edi,%edi
js     110c <hashInt+0xc>
idiv   %esi
mov    %edx,%eax
ret
idiv   %esi
lea    (%rsi,%rdx,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @hashInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
br label %19
11: ; preds = %2
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = load i32, i32* %3
%15 = sub nsw i32 0, %14
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = sub nsw i32 %13, %17
br label %19
19: ; preds = %11, %7
%20 = phi i32 [ %10, %7 ], [ %18, %11 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @hashInt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = srem i32 %0, %1
br label %10
6: ; preds = %2
%7 = add nsw i32 %1, -1
%8 = srem i32 %0, %1
%9 = add nsw i32 %7, %8
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ %5, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ lua_error(char *);
void gettableFB(void) { lua_error("indexed expression not a table"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"indexed expression not a table\00"
define void @gettableFB() {
%1 = call i32 @lua_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"indexed expression not a table\00"
define void @gettableFB() {
%1 = tail call i32 @lua_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cblas_cdotu_sub(int const, void const *, int const,
                                   void const *, int const, void *);
void acc_cdotu_sub_(const int *N, const void *X, const int *incX, const void *Y,
                    const int *incY, void *dotu) {
  cblas_cdotu_sub(*N, X, *incX, Y, *incY, dotu);
}


x86 assembly (clang, -O0):
<acc_cdotu_sub_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%r9
call   1030 <cblas_cdotu_sub@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acc_cdotu_sub_>:
mov    (%rdi),%edi
mov    (%rdx),%edx
mov    (%r8),%r8d
jmp    1030 <cblas_cdotu_sub@plt>

LLVM IR (-O0):
define void @acc_cdotu_sub_(i32* %0, i8* %1, i32* %2, i8* %3, i32* %4, i8* %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i32*
%12 = alloca i8*
store i32* %0, i32** %7
store i8* %1, i8** %8
store i32* %2, i32** %9
store i8* %3, i8** %10
store i32* %4, i32** %11
store i8* %5, i8** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i8*, i8** %8
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = load i8*, i8** %10
%19 = load i32*, i32** %11
%20 = load i32, i32* %19
%21 = load i8*, i8** %12
%22 = call i32 @cblas_cdotu_sub(i32 %14, i8* %15, i32 %17, i8* %18, i32 %20, i8* %21)
ret void
}

LLVM IR (-O2):
define void @acc_cdotu_sub_(i32* nocapture %0, i8* %1, i32* nocapture %2, i8* %3, i32* nocapture %4, i8* %5) {
%7 = load i32, i32* %0
%8 = load i32, i32* %2
%9 = load i32, i32* %4
%10 = tail call i32 @cblas_cdotu_sub(i32 %7, i8* %1, i32 %8, i8* %3, i32 %9, i8* %5)
ret void
}
int test_imm_3Aint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x3A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Aint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 249108103168
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ isalpha(char);
extern int getLevel(char *str) {
  int rValue = 0;
  while (!isalpha(*str)) {
    if (*str == '\t')
      rValue++;
    str++;
  }
  return rValue;
}


x86 assembly (clang, -O0):
<getLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <getLevel+0x34>
jmp    116e <getLevel+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    115d <getLevel+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <getLevel+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLevel>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <isalpha@plt>
xor    %ebp,%ebp
test   %eax,%eax
jne    114b <getLevel+0x3b>
add    $0x1,%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
cmpb   $0x9,-0x1(%rbx)
sete   %al
add    %eax,%ebp
movsbl (%rbx),%edi
call   1030 <isalpha@plt>
add    $0x1,%rbx
test   %eax,%eax
je     1130 <getLevel+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getLevel(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @isalpha(i8 signext %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %1, %5
%6 = phi i32 [ %11, %5 ], [ 0, %1 ]
%7 = phi i8* [ %12, %5 ], [ %0, %1 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 9
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = tail call i32 @isalpha(i8 signext %13)
%15 = icmp eq i32 %14, 0
br i1 %15, label %5, label %16
16: ; preds = %5, %1
%17 = phi i32 [ 0, %1 ], [ %11, %5 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help() { fprintf(stderr, "Appel: tp [-h] [-v] programme.txt\n"); }


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Appel: tp [-h] [-v] programme.txt\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Appel: tp [-h] [-v] programme.txt\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
void g_scanner_new() {}


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

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

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

LLVM IR (-O2):
define void @g_scanner_new() {
ret void
}
/* Variables and functions */
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int getchar(void) { return (getc(stdin)); }


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = call i32 @getc(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @getc(i32 %1)
ret i32 %2
}
void ocl_hw_barrier() {}


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

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

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

LLVM IR (-O2):
define void @ocl_hw_barrier() {
ret void
}
/* Variables and functions */
size_t get_data_tag_in_Party(size_t __tag) {
  (void)__tag;
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @get_data_tag_in_Party(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 0
}

LLVM IR (-O2):
define i64 @get_data_tag_in_Party(i64 %0) {
ret i64 0
}
p(int *p) { return !((long)p & 1); }


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
mov    %rdi,%rax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @p(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = and i64 %4, 1
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @p(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = trunc i64 %2 to i32
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
ret i32 %5
}
/* Variables and functions */
char *mkfn(char const *, char const *, char const *);
extern char *mkcmdfn(const char *name, const char *dir, const char *ext) {
  return mkfn(name, dir, ext);
}


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

x86 assembly (clang, -O2):
<mkcmdfn>:
jmp    1030 <mkfn@plt>

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

LLVM IR (-O2):
define i8* @mkcmdfn(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @mkfn(i8* %0, i8* %1, i8* %2)
ret i8* %4
}
/* Variables and functions */
int Pop();
int /*<<< orphan*/ Push(int);
int CmdOrBitwise(void) {
  Push(Pop() | Pop());
  return 0;
}


x86 assembly (clang, -O0):
<CmdOrBitwise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Pop@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Pop@plt>
mov    -0x4(%rbp),%edi
or     %eax,%edi
call   1040 <Push@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdOrBitwise>:
push   %rbx
xor    %eax,%eax
call   1030 <Pop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <Pop@plt>
or     %eax,%ebx
mov    %ebx,%edi
call   1040 <Push@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CmdOrBitwise() {
%1 = call i32 (...) @Pop()
%2 = call i32 (...) @Pop()
%3 = or i32 %1, %2
%4 = call i32 @Push(i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @CmdOrBitwise() {
%1 = tail call i32 (...) @Pop()
%2 = tail call i32 (...) @Pop()
%3 = or i32 %2, %1
%4 = tail call i32 @Push(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printReverser(void) {
  printf("\x1b[0K");
  printf("\x1b[%dmF   OFF   R\x1b[39m\n", 36);
  printf("\x1b[0K");
  printf("\x1b[%dm|\x1b[%dm----\x1b[%dm|\x1b[%dm----\x1b[%dm|\x1b[39m\n", 36,
         34, 36, 34, 36);
  return;
}


x86 assembly (clang, -O0):
<printReverser>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x24,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x24,%r9d
mov    $0x22,%r8d
mov    %r9d,%esi
mov    %r8d,%edx
mov    %r9d,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printReverser>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x24,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x24,%esi
mov    $0x22,%edx
mov    $0x24,%ecx
mov    $0x22,%r8d
mov    $0x24,%r9d
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0K\00"
@.str.1 = [23 x i8] c"\1B[%dmF OFF R\1B[39m\0A\00"
@.str.2 = [43 x i8] c"\1B[%dm|\1B[%dm----\1B[%dm|\1B[%dm----\1B[%dm|\1B[39m\0A\00"
define void @printReverser() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 36)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 36, i32 34, i32 36, i32 34, i32 36)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0K\00"
@.str.1 = [23 x i8] c"\1B[%dmF OFF R\1B[39m\0A\00"
@.str.2 = [43 x i8] c"\1B[%dm|\1B[%dm----\1B[%dm|\1B[%dm----\1B[%dm|\1B[39m\0A\00"
define void @printReverser() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 36)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 36, i32 34, i32 36, i32 34, i32 36)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int futimens(int, struct timespec const *);
__attribute__((__weak__, __always___)) int
softboundmpx_futimens(int fd, const struct timespec times[2]) {
  return futimens(fd, times);
}


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

x86 assembly (clang, -O2):
<softboundmpx_futimens>:
jmp    1030 <futimens@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define weak i32 @softboundmpx_futimens(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @futimens(i32 %5, %struct.timespec* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define weak i32 @softboundmpx_futimens(i32 %0, %struct.timespec* %1) {
%3 = tail call i32 @futimens(i32 %0, %struct.timespec* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ strpbrk(char *, char *);
int ispattern(char *pattern) { return (strpbrk(pattern, "*?[^") != 0); }


x86 assembly (clang, -O0):
<ispattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strpbrk@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispattern>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strpbrk@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"*?[^\00"
define i32 @ispattern(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strpbrk(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"*?[^\00"
define i32 @ispattern(i8* %0) {
%2 = tail call i64 @strpbrk(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
uint len(char *str) {
  if (str == NULL) {
    return 0;
  }
  int l = 0;
  while (*(++str) != '\0') {
    l++;
  }
  return l;
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <len+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1156 <len+0x56>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1150 <len+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <len+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len>:
test   %rdi,%rdi
je     111d <len+0x1d>
add    $0x1,%rdi
mov    $0xffffffff,%eax
xchg   %ax,%ax
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @len(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = add nuw nsw i32 %5, 1
br i1 %8, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %5, %3 ]
ret i32 %11
}
int getblockid(int row, int col) { return row / 3 * 3 + col / 3; }


x86 assembly (clang, -O0):
<getblockid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getblockid>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%ecx
movslq %esi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getblockid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 3
%7 = mul nsw i32 %6, 3
%8 = load i32, i32* %4
%9 = sdiv i32 %8, 3
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @getblockid(i32 %0, i32 %1) {
%3 = srem i32 %0, 3
%4 = sub i32 %0, %3
%5 = sdiv i32 %1, 3
%6 = add nsw i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int A[], int s, int e) {
  int index;
  if (s >= e)
    return;
  index = partition(A, s, e);
  quickSort(A, s, index - 1);
  quickSort(A, index + 1, e);
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <quickSort+0x23>
jmp    1179 <quickSort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void vf(volatile struct A *kp) {
  struct A *p = kp;
  (void)p;
}


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

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

LLVM IR (-O0):
%struct.A = type opaque
define void @vf(%struct.A* %0) {
%2 = alloca %struct.A*
%3 = alloca %struct.A*
store %struct.A* %0, %struct.A** %2
%4 = load %struct.A*, %struct.A** %2
store %struct.A* %4, %struct.A** %3
%5 = load %struct.A*, %struct.A** %3
ret void
}

LLVM IR (-O2):
%struct.A = type opaque
define void @vf(%struct.A* nocapture %0) {
ret void
}
void WriteShortLE(unsigned char **addrPtr, unsigned short data) {
  unsigned char *addr = *addrPtr;
  *addr++ = (unsigned char)data;
  *addr++ = (unsigned char)(data >> 8);
  *addrPtr = addr;
}


x86 assembly (clang, -O0):
<WriteShortLE>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xa(%rbp),%ax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteShortLE>:
mov    (%rdi),%rax
mov    %si,(%rax)
add    $0x2,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @WriteShortLE(i8** %0, i16 zeroext %1) {
%3 = alloca i8**
%4 = alloca i16
%5 = alloca i8*
store i8** %0, i8*** %3
store i16 %1, i16* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i16, i16* %4
%9 = trunc i16 %8 to i8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %5
store i8 %9, i8* %10
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = ashr i32 %13, 8
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %5
store i8 %15, i8* %16
%18 = load i8*, i8** %5
%19 = load i8**, i8*** %3
store i8* %18, i8** %19
ret void
}

LLVM IR (-O2):
define void @WriteShortLE(i8** nocapture %0, i16 zeroext %1) {
%3 = load i8*, i8** %0
%4 = trunc i16 %1 to i8
%5 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %4, i8* %3
%6 = lshr i16 %1, 8
%7 = trunc i16 %6 to i8
%8 = getelementptr inbounds i8, i8* %3, i64 2
store i8 %7, i8* %5
store i8* %8, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ egg_secure_clear(unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void egg_secure_strclear(char *str) {
  if (!str)
    return;
  egg_secure_clear((unsigned char *)str, strlen(str));
}


x86 assembly (clang, -O0):
<egg_secure_strclear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <egg_secure_strclear+0x1c>
jmp    1158 <egg_secure_strclear+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <egg_secure_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<egg_secure_strclear>:
test   %rdi,%rdi
je     1139 <egg_secure_strclear+0x19>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <egg_secure_clear@plt>
ret

LLVM IR (-O0):
define void @egg_secure_strclear(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 %6, label %5
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @egg_secure_clear(i8* %7, i32 %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @egg_secure_strclear(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @egg_secure_clear(i8* %0, i32 %4)
br label %6
6: ; preds = %1, %3
ret void
}
void m68k_write_memory_32(unsigned int address, unsigned int value) {
  (void)address;
  (void)value;
}


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

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

LLVM IR (-O0):
define void @m68k_write_memory_32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @m68k_write_memory_32(i32 %0, i32 %1) {
ret void
}
int main(void) {
  int fu;
  return fu;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Variables and functions */
double ut2ts();
int ut2tsi() { return ((int)(ut2ts() - 946684800.0)); }


x86 assembly (clang, -O0):
<ut2tsi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ut2ts@plt>
movsd  0xedd(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut2tsi>:
push   %rax
xor    %eax,%eax
call   1030 <ut2ts@plt>
addsd  0xee0(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ut2tsi() {
%1 = call double (...) @ut2ts()
%2 = fsub double %1, 0x41CC36A1C0000000
%3 = fptosi double %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @ut2tsi() {
%1 = tail call double (...) @ut2ts()
%2 = fadd double %1, 0xC1CC36A1C0000000
%3 = fptosi double %2 to i32
ret i32 %3
}