xunge/DecIR huggingface dataset:
/* Variables and functions */
int map_global_to_use_box(int const **, int const, int const, int const);
int box_map_local(const int local_uses[3][2], const int map_local_id[],
                  const int global_x, const int global_y, const int global_z) {
  int i = map_global_to_use_box(local_uses, global_x, global_y, global_z);
  if (0 <= i) {
    i = map_local_id[i];
  }
  return i;
}


x86 assembly (clang, -O0):
<box_map_local>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1030 <map_global_to_use_box@plt>
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%eax
jg     1158 <box_map_local+0x48>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<box_map_local>:
push   %rbx
mov    %rsi,%rbx
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
call   1030 <map_global_to_use_box@plt>
test   %eax,%eax
js     1129 <box_map_local+0x19>
mov    %eax,%eax
mov    (%rbx,%rax,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @box_map_local([2 x i32]* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca [2 x i32]*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store [2 x i32]* %0, [2 x i32]** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load [2 x i32]*, [2 x i32]** %6
%13 = bitcast [2 x i32]* %12 to i32**
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @map_global_to_use_box(i32** %13, i32 %14, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = icmp sle i32 0, %18
br i1 %19, label %20, label %26
20: ; preds = %5
%21 = load i32*, i32** %7
%22 = load i32, i32* %11
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
store i32 %25, i32* %11
br label %26
26: ; preds = %20, %5
%27 = load i32, i32* %11
ret i32 %27
}

LLVM IR (-O2):
define i32 @box_map_local([2 x i32]* %0, i32* nocapture %1, i32 %2, i32 %3, i32 %4) {
%6 = bitcast [2 x i32]* %0 to i32**
%7 = tail call i32 @map_global_to_use_box(i32** %6, i32 %2, i32 %3, i32 %4)
%8 = icmp sgt i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = zext i32 %7 to i64
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
br label %13
13: ; preds = %9, %5
%14 = phi i32 [ %12, %9 ], [ %7, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xe0() {
  Assert_real((isgraph(224) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1125, ("isgraph should be 0 for 0xe0"));
}


x86 assembly (clang, -O0):
<t_isgraph_0xe0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x465,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0xe0>:
push   %rax
mov    $0xe0,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x465,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xe0\00"
define void @t_isgraph_0xe0() {
%1 = call i64 @isgraph(i32 224)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xe0\00"
define void @t_isgraph_0xe0() {
%1 = tail call i64 @isgraph(i32 224)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ft_strlen(char *str) {
  int index;
  index = 1;
  while (str[index] != '\0') {
    index++;
    return (index);
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1138 <ft_strlen+0x38>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <ft_strlen+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
xor    %eax,%eax
cmpb   $0x0,0x1(%rdi)
setne  %al
add    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 0, i32 2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ handle_trap(uintptr_t, void *, int /*<<< orphan*/,
                               struct state *);
void trap_handler(uintptr_t stack_limit, void *stack_ptr, uint64_t trap,
                  struct state *state) {
  handle_trap(stack_limit, stack_ptr, trap, state);
}


x86 assembly (clang, -O0):
<trap_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <handle_trap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trap_handler>:
jmp    1030 <handle_trap@plt>

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

LLVM IR (-O2):
%struct.state = type { i32 }
define void @trap_handler(i64 %0, i8* %1, i32 %2, %struct.state* %3) {
%5 = tail call i32 @handle_trap(i64 %0, i8* %1, i32 %2, %struct.state* %3)
ret void
}
float foo22(double a, double b, double c) { return (float)(a * b + c); }


x86 assembly (clang, -O0):
<foo22>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo22>:
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @foo22(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @llvm.fmuladd.f64(double %7, double %8, double %9)
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @foo22(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %2)
%5 = fptrunc double %4 to float
ret float %5
}
int is_digit(unsigned char c) {
  if ((c >= 0x30 && c <= 0x39))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <is_digit+0x30>
movzbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <is_digit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_digit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_digit(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ CreateAttrCat();
scalar_t__ CreateRelCat();
int CreateCats() {
  if (CreateRelCat() == 0 && CreateAttrCat() == 0)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<CreateCats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <CreateRelCat@plt>
cmp    $0x0,%rax
jne    1156 <CreateCats+0x36>
mov    $0x0,%al
call   1040 <CreateAttrCat@plt>
cmp    $0x0,%rax
jne    1156 <CreateCats+0x36>
movl   $0x0,-0x4(%rbp)
jmp    115d <CreateCats+0x3d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateCats>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <CreateRelCat@plt>
test   %rax,%rax
jne    113b <CreateCats+0x1b>
xor    %eax,%eax
call   1040 <CreateAttrCat@plt>
test   %rax,%rax
je     1140 <CreateCats+0x20>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CreateCats() {
%1 = alloca i32
%2 = call i64 (...) @CreateRelCat()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i64 (...) @CreateAttrCat()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4
store i32 0, i32* %1
br label %9
8: ; preds = %4, %0
store i32 -1, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @CreateCats() {
%1 = tail call i64 (...) @CreateRelCat()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 (...) @CreateAttrCat()
%5 = icmp eq i64 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ -1, %6 ], [ 0, %3 ]
ret i32 %8
}
void gtk_tree_view_set_hover_selection() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_set_hover_selection() {
ret void
}
int target_wifi_reconnect_if_disconected(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @target_wifi_reconnect_if_disconected() {
ret i32 0
}
/* Variables and functions */
double pow(double, double);
double ypow(double x) { return pow(2.34, x); }


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

x86 assembly (clang, -O2):
<ypow>:
movaps %xmm0,%xmm1
movsd  0xee5(%rip),%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @ypow(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double 2.340000e+00, double %3)
ret double %4
}

LLVM IR (-O2):
define double @ypow(double %0) {
%2 = tail call double @pow(double 2.340000e+00, double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ system(char *);
int main() {
  chdir("/mnt/user/code/Buttons/bin");
  system("/mnt/user/jvm/java Main");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <chdir@plt>
lea    0xee4(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"/mnt/user/code/Buttons/bin\00"
@.str.1 = [24 x i8] c"/mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @chdir(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"/mnt/user/code/Buttons/bin\00"
@.str.1 = [24 x i8] c"/mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @chdir(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(unsigned int, int);
int /*<<< orphan*/ nrerror(char *);
double *dvector(int nl, int nh) {
  double *v;
  v = (double *)calloc((unsigned)(nh - nl + 1), sizeof(double));
  if (!v)
    nrerror("allocation failure in dvector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x4(%rbp),%edi
add    $0x1,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <dvector+0x3c>
lea    0xea9(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x1(%rsi),%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <dvector+0x28>
lea    0xebd(%rip),%rdi
call   1030 <nrerror@plt>
movslq %ebp,%rax
shl    $0x3,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = call i64 @calloc(i32 %9, i32 8)
%11 = inttoptr i64 %10 to double*
store double* %11, double** %5
%12 = load double*, double** %5
%13 = icmp ne double* %12, null
br i1 %13, label %16, label %14
14: ; preds = %2
%15 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %2
%17 = load double*, double** %5
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = sub i64 0, %19
%21 = getelementptr inbounds double, double* %17, i64 %20
ret double* %21
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = tail call i64 @calloc(i32 %4, i32 8)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = inttoptr i64 %5 to double*
%11 = sext i32 %0 to i64
%12 = sub nsw i64 0, %11
%13 = getelementptr inbounds double, double* %10, i64 %12
ret double* %13
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
unsigned long long _mm_extract_epi8(int /*<<< orphan*/, int);
unsigned long long int foo8(__m128i x) { return _mm_extract_epi8(x, 4); }


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

x86 assembly (clang, -O2):
<foo8>:
mov    $0x4,%esi
jmp    1030 <_mm_extract_epi8@plt>

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

LLVM IR (-O2):
define i64 @foo8(i32 %0) {
%2 = tail call i64 @_mm_extract_epi8(i32 %0, i32 4)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ abs(int);
int floor(int /*<<< orphan*/);
int /*<<< orphan*/ log10(int /*<<< orphan*/);
int digits_int(int i) {
  if (i == 0) {
    return 1;
  } else if (i > 0) {
    return floor(log10(abs(i))) + 1;
  } else {
    return floor(log10(abs(i))) + 2;
  }
}


x86 assembly (clang, -O0):
<digits_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1151 <digits_int+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1198 <digits_int+0x68>
cmpl   $0x0,-0x8(%rbp)
jle    117c <digits_int+0x4c>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <log10@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1198 <digits_int+0x68>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <log10@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digits_int>:
test   %edi,%edi
je     1149 <digits_int+0x29>
push   %rbx
setg   %cl
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
movzbl %cl,%ebx
mov    %eax,%edi
call   1030 <log10@plt>
mov    %eax,%edi
call   1040 <floor@plt>
neg    %ebx
add    %ebx,%eax
add    $0x2,%eax
pop    %rbx
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @digits_int(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 0
%5 = sub nsw i32 0, %0
%6 = select i1 %4, i32 %0, i32 %5
%7 = select i1 %4, i32 1, i32 2
%8 = tail call i32 @log10(i32 %6)
%9 = tail call i32 @floor(i32 %8)
%10 = add nsw i32 %9, %7
br label %11
11: ; preds = %3, %1
%12 = phi i32 [ 1, %1 ], [ %10, %3 ]
ret i32 %12
}
int abs32(int x) {
  return (((int)((short *)&x)[0]) * ((int)((short *)&x)[0]) +
          ((int)((short *)&x)[1]) * ((int)((short *)&x)[1]));
}


x86 assembly (clang, -O0):
<abs32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movswl -0x4(%rbp),%eax
movswl -0x4(%rbp),%ecx
imul   %ecx,%eax
movswl -0x2(%rbp),%ecx
movswl -0x2(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs32>:
movswl %di,%eax
imul   %eax,%eax
sar    $0x10,%edi
imul   %edi,%edi
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs32(i32 %0) {
%2 = shl i32 %0, 16
%3 = ashr exact i32 %2, 16
%4 = mul nsw i32 %3, %3
%5 = ashr i32 %0, 16
%6 = mul nsw i32 %5, %5
%7 = add nuw nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: flag_test <compiler name>\n");
  exit(EXIT_FAILURE);
}


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    0x2e98(%rip),%rax
mov    (%rax),%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    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"usage: flag_test <compiler name>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"usage: flag_test <compiler name>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void msleep(int msec) { usleep(msec * 1000); }


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

x86 assembly (clang, -O2):
<msleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @msleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int close(int);
int serialclose(int fd) { return close(fd); }


x86 assembly (clang, -O0):
<serialclose>:
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):
<serialclose>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @serialclose(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 @serialclose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRABORTDOC_set(void) { return U_WMRCORENONE_set("U_WMRABORTDOC"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"U_WMRABORTDOC\00"
define i8* @U_WMRABORTDOC_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"U_WMRABORTDOC\00"
define i8* @U_WMRABORTDOC_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int f5(void) {
  int v5i = 6, v5j = 7, v5k = 9, v5l = 0, v5n = 0, v5p = 0;
#pragma omp parallel
  {
#pragma omp master
    v5p++;
#pragma omp sections private(v5i) firstprivate(v5k) reduction(+ : v5l)
    {
#pragma omp section
      {
        int v5m = v5j + v5k;
        v5i = 8;
        v5k = 10;
        v5l++;
        v5n = v5m + v5i;
      }
#pragma omp section
      {
        int v5o = v5j + v5k;
        v5i = 10;
        v5k = 11;
        v5l++;
      }
    }
  }
  return v5i + v5j + v5l + v5n + v5p;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
movl   $0x6,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x8,-0x4(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0xa,-0x4(%rbp)
movl   $0xb,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f5() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 6, i32* %1
store i32 7, i32* %2
store i32 9, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
store i32 %10, i32* %6
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
store i32 %13, i32* %7
store i32 8, i32* %1
store i32 10, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
%16 = load i32, i32* %7
%17 = load i32, i32* %1
%18 = add nsw i32 %16, %17
store i32 %18, i32* %5
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = add nsw i32 %19, %20
store i32 %21, i32* %8
store i32 10, i32* %1
store i32 11, i32* %3
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = add nsw i32 %24, %25
%27 = load i32, i32* %4
%28 = add nsw i32 %26, %27
%29 = load i32, i32* %5
%30 = add nsw i32 %28, %29
%31 = load i32, i32* %6
%32 = add nsw i32 %30, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @f5() {
ret i32 44
}
int test_imm_88uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x88 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_88uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 136
%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_88uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 136
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double calcTriArea(float base, float height) { return 0.5 * base * height; }


x86 assembly (clang, -O0):
<calcTriArea>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcTriArea>:
cvtss2sd %xmm0,%xmm2
mulsd  0xef4(%rip),%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @calcTriArea(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fmul double 5.000000e-01, %6
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = fmul double %7, %9
ret double %10
}

LLVM IR (-O2):
define double @calcTriArea(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fmul double %3, 5.000000e-01
%5 = fpext float %1 to double
%6 = fmul double %4, %5
ret double %6
}
void mem_put_be24_as_int(void *vmem, int val) {
  unsigned char *mem = (unsigned char *)vmem;
  mem[0] = (val >> 16) & 0xff;
  mem[1] = (val >> 8) & 0xff;
  mem[2] = (val >> 0) & 0xff;
}


x86 assembly (clang, -O0):
<mem_put_be24_as_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_put_be24_as_int>:
mov    %esi,%eax
mov    %esi,%ecx
shr    $0x10,%ecx
mov    %cl,(%rdi)
mov    %ah,0x1(%rdi)
mov    %al,0x2(%rdi)
ret

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

LLVM IR (-O2):
define void @mem_put_be24_as_int(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = trunc i32 %1 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void nl(int k) {
  int j;
  for (j = 0; j < k; j++)
    putchar('-');
  putchar('\n');
}


x86 assembly (clang, -O0):
<nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <nl+0x36>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <nl+0x12>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl>:
push   %rbx
test   %edi,%edi
jle    112f <nl+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <nl+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @nl(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i8 signext 45)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = tail call i32 @putchar(i8 signext 10)
ret void
}
int rach_max_trans_raw2val(int raw) {
  const int tbl[4] = {1, 2, 4, 7};
  return tbl[raw & 3];
}


x86 assembly (clang, -O0):
<rach_max_trans_raw2val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
cltq
mov    -0x20(%rbp,%rax,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rach_max_trans_raw2val>:
and    $0x3,%edi
lea    0xef6(%rip),%rax
mov    (%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
@__const.rach_max_trans_raw2val.tbl = [4 x i32] [i32 1, i32 2, i32 4, i32 7]
define i32 @rach_max_trans_raw2val(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
store i32 %0, i32* %2
%4 = bitcast [4 x i32]* %3 to i8*
%5 = load i32, i32* %2
%6 = and i32 %5, 3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
@__const.rach_max_trans_raw2val.tbl = [4 x i32] [i32 1, i32 2, i32 4, i32 7]
define i32 @rach_max_trans_raw2val(i32 %0) {
%2 = and i32 %0, 3
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [4 x i32], [4 x i32]* @__const.rach_max_trans_raw2val.tbl, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
int null_main(int argc, char *argv[]) { return 0; }


x86 assembly (clang, -O0):
<null_main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @null_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @null_main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ AT_SYMLINK_NOFOLLOW;
int /*<<< orphan*/ F_OK;
int faccessat2(int /*<<< orphan*/, char *, int /*<<< orphan*/,
               int /*<<< orphan*/);
int main(void) {
  return faccessat2(AT_FDCWD, "dummytestfile", F_OK, AT_SYMLINK_NOFOLLOW);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ecx
lea    0xebf(%rip),%rsi
call   1030 <faccessat2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
mov    0x2eb7(%rip),%rax
mov    (%rax),%ecx
lea    0xece(%rip),%rsi
jmp    1030 <faccessat2@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
@.str = [14 x i8] c"dummytestfile\00"
@F_OK = global i32 0
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @AT_FDCWD
%3 = load i32, i32* @F_OK
%4 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%5 = call i32 @faccessat2(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
@.str = [14 x i8] c"dummytestfile\00"
@F_OK = global i32 0
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @main() {
%1 = load i32, i32* @AT_FDCWD
%2 = load i32, i32* @F_OK
%3 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%4 = tail call i32 @faccessat2(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 %4
}
/* Type definitions */
struct timeval {
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double d2mce_utime() {
  struct timeval now;
  gettimeofday(&now, 0);
  return now.tv_usec;
}


x86 assembly (clang, -O0):
<d2mce_utime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2mce_utime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { double }
define double @d2mce_utime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
%struct.timeval = type { double }
define double @d2mce_utime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_menu() {
  printf("+---------------------------------------+\n"
         "|        Doom's OTP Service v1.0        |\n"
         "+---------------------------------------+\n"
         "|------------ Services Menu ------------|\n"
         "|---------------------------------------|\n"
         "| 1. Create secure message              |\n"
         "| 2. Edit secure message                |\n"
         "| 3. Destroy secure message             |\n"
         "| 4. Print message details              |\n"
         "| 5. Quit                               |\n"
         "+---------------------------------------+\n");
}


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

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

LLVM IR (-O0):
@.str = [463 x i8] c"+---------------------------------------+\0A| Doom's OTP Service v1.0 |\0A+---------------------------------------+\0A|------------ Services Menu ------------|\0A|---------------------------------------|\0A| 1. Create secure message |\0A| 2. Edit secure message |\0A| 3. Destroy secure message |\0A| 4. Print message details |\0A| 5. Quit |\0A+---------------------------------------+\0A\00"
define void @print_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([463 x i8], [463 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [462 x i8] c"+---------------------------------------+\0A| Doom's OTP Service v1.0 |\0A+---------------------------------------+\0A|------------ Services Menu ------------|\0A|---------------------------------------|\0A| 1. Create secure message |\0A| 2. Edit secure message |\0A| 3. Destroy secure message |\0A| 4. Print message details |\0A| 5. Quit |\0A+---------------------------------------+\00"
define void @print_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([462 x i8], [462 x i8]* @str, i64 0, i64 0))
ret void
}
void nchar2nlong() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readline(int, void *, size_t);
ssize_t Readline(int fd, void *ptr, size_t maxlen) {
  ssize_t n;
  if ((n = readline(fd, ptr, maxlen)) < 0) {
    printf("readline error\n");
    exit(1);
  }
  return n;
}


x86 assembly (clang, -O0):
<Readline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <readline@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    1175 <Readline+0x45>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Readline>:
push   %rax
call   1040 <readline@plt>
test   %eax,%eax
js     113c <Readline+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@str = [15 x i8] c"readline error\00"
define i32 @Readline(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @readline(i32 %0, i8* %1, i64 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 %4
}
unsigned int pixel_get_r16(unsigned int pixel) { return pixel & 0x0000FFFF; }


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

x86 assembly (clang, -O2):
<pixel_get_r16>:
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @pixel_get_r16(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ObjWriteByte(int);
int Enc(unsigned n, int nflag) {
  if (n >> 6 == 0)
    return ((n & 0x3f) | nflag);
  ObjWriteByte(Enc(n >> 7, nflag) | 0x80);
  return (n & 0x7f);
}


x86 assembly (clang, -O0):
<Enc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
cmp    $0x0,%eax
jne    114e <Enc+0x2e>
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <Enc+0x52>
mov    -0x8(%rbp),%edi
shr    $0x7,%edi
mov    -0xc(%rbp),%esi
call   1040 <Enc@plt>
mov    %eax,%edi
or     $0x80,%edi
call   1030 <ObjWriteByte@plt>
mov    -0x8(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Enc>:
push   %rbx
mov    %edi,%ebx
cmp    $0x3f,%edi
ja     112c <Enc+0xc>
or     %ebx,%esi
jmp    1147 <Enc+0x27>
mov    %ebx,%edi
shr    $0x7,%edi
call   1040 <Enc@plt>
or     $0x80,%eax
mov    %eax,%edi
call   1030 <ObjWriteByte@plt>
and    $0x7f,%ebx
mov    %ebx,%esi
mov    %esi,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Enc(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 = lshr i32 %6, 6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %4
%11 = and i32 %10, 63
%12 = load i32, i32* %5
%13 = or i32 %11, %12
store i32 %13, i32* %3
br label %23
14: ; preds = %2
%15 = load i32, i32* %4
%16 = lshr i32 %15, 7
%17 = load i32, i32* %5
%18 = call i32 @Enc(i32 %16, i32 %17)
%19 = or i32 %18, 128
%20 = call i32 @ObjWriteByte(i32 %19)
%21 = load i32, i32* %4
%22 = and i32 %21, 127
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %9
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @Enc(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 64
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = or i32 %1, %0
br label %6
6: ; preds = %4, %8
%7 = phi i32 [ %13, %8 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %2
%9 = lshr i32 %0, 7
%10 = tail call i32 @Enc(i32 %9, i32 %1)
%11 = or i32 %10, 128
%12 = tail call i32 @ObjWriteByte(i32 %11)
%13 = and i32 %0, 127
br label %6
}
void get_sb_pseudo(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<get_sb_pseudo>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sb_pseudo>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.get_sb_pseudo = [14 x i8] c"get_sb_pseudo\00"
define void @get_sb_pseudo() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.get_sb_pseudo, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.get_sb_pseudo = [14 x i8] c"get_sb_pseudo\00"
define void @get_sb_pseudo() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.get_sb_pseudo, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @putchar(i32 %8)
br label %3
10: ; preds = %3
ret i32 1
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 1
}