xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isascii(int);
int utf32_isalpha(int c) { return isascii(c) && isalpha(c); }


x86 assembly (clang, -O0):
<utf32_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isascii@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1157 <utf32_isalpha+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf32_isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <isascii@plt>
test   %rax,%rax
je     1141 <utf32_isalpha+0x21>
mov    %ebx,%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @utf32_isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isascii(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isalpha(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @utf32_isalpha(i32 %0) {
%2 = tail call i64 @isascii(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @isalpha(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int cos(int);
double f(double x) { return 1 - 4 * x * cos(x) + 2 * x * x + cos(2 * x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1030 <cos@plt>
movsd  -0x18(%rbp),%xmm1
cvtsi2sd %eax,%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe70(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movsd  %xmm0,(%rsp)
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xed2(%rip),%xmm1
movsd  (%rsp),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xec5(%rip),%xmm1
movapd %xmm2,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 4.000000e+00, %3
%5 = load double, double* %2
%6 = fptosi double %5 to i32
%7 = call i32 @cos(i32 %6)
%8 = sitofp i32 %7 to double
%9 = fneg double %4
%10 = call double @llvm.fmuladd.f64(double %9, double %8, double 1.000000e+00)
%11 = load double, double* %2
%12 = fmul double 2.000000e+00, %11
%13 = load double, double* %2
%14 = call double @llvm.fmuladd.f64(double %12, double %13, double %10)
%15 = load double, double* %2
%16 = fmul double 2.000000e+00, %15
%17 = fptosi double %16 to i32
%18 = call i32 @cos(i32 %17)
%19 = sitofp i32 %18 to double
%20 = fadd double %14, %19
ret double %20
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call i32 @cos(i32 %2)
%4 = sitofp i32 %3 to double
%5 = fmul double %0, -4.000000e+00
%6 = tail call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = fmul double %0, 2.000000e+00
%8 = tail call double @llvm.fmuladd.f64(double %7, double %0, double %6)
%9 = fptosi double %7 to i32
%10 = tail call i32 @cos(i32 %9)
%11 = sitofp i32 %10 to double
%12 = fadd double %8, %11
ret double %12
}
/* Variables and functions */
double __ocml_sqrt_f64(double);
double sqrt(double x) { return __ocml_sqrt_f64(x); }


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

x86 assembly (clang, -O2):
<sqrt>:
jmp    1030 <__ocml_sqrt_f64@plt>

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

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = tail call double @__ocml_sqrt_f64(double %0)
ret double %2
}
int SemInit(int sem_count) {
  int sid;
  if (sem_count < 0)
    return -1;
  asm("movl %1, %%eax; int $51; movl %%eax, %0"
      : "=g"(sid)
      : "g"(sem_count)
      : "eax");
  return sid;
}


x86 assembly (clang, -O0):
<SemInit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <SemInit+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1131 <SemInit+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
int    $0x33
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SemInit>:
test   %edi,%edi
js     1117 <SemInit+0x17>
mov    %edi,-0x8(%rsp)
mov    -0x8(%rsp),%eax
int    $0x33
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @SemInit(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp slt i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = load i32, i32* %2
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ -1, %1 ]
ret i32 %8
}
void gtk_window_resize() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_resize() {
ret void
}
/* Variables and functions */
scalar_t__ isdigit(char);
int strlen(char *);
int IsSerialName(char *str) {
  int len = strlen(str);
  return (len > 1 && isdigit(str[len - 1]));
}


x86 assembly (clang, -O0):
<IsSerialName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    1167 <IsSerialName+0x47>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsSerialName>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
jl     1149 <IsSerialName+0x29>
add    $0xffffffff,%ecx
movsbl (%rbx,%rcx,1),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @IsSerialName(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8, i8* %13
%15 = call i64 @isdigit(i8 signext %14)
%16 = icmp ne i64 %15, 0
br label %17
17: ; preds = %8, %1
%18 = phi i1 [ false, %1 ], [ %16, %8 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @IsSerialName(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i64 @isdigit(i8 signext %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %13
}
void XcmsCIEXYZToCIELab() {}


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

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

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

LLVM IR (-O2):
define void @XcmsCIEXYZToCIELab() {
ret void
}
void colamd_set_defaults(double knobs[20]) {
  int i;
  if (!knobs) {
    return;
  }
  for (i = 0; i < 20; i++) {
    knobs[i] = 0;
  }
  knobs[0] = 0.5;
  knobs[1] = 0.5;
}


x86 assembly (clang, -O0):
<colamd_set_defaults>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <colamd_set_defaults+0x18>
jmp    1168 <colamd_set_defaults+0x68>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1147 <colamd_set_defaults+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <colamd_set_defaults+0x1f>
mov    -0x8(%rbp),%rax
movsd  0xead(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xe9d(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<colamd_set_defaults>:
test   %rdi,%rdi
je     113c <colamd_set_defaults+0x3c>
xorps  %xmm0,%xmm0
movups %xmm0,0x90(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movaps 0xec7(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @colamd_set_defaults(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
%4 = load double*, double** %2
%5 = icmp ne double* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
br label %24
7: ; preds = %1
store i32 0, i32* %3
br label %8
8: ; preds = %16, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 20
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load double*, double** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
store double 0.000000e+00, double* %15
br label %16
16: ; preds = %11
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %8
19: ; preds = %8
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 0
store double 5.000000e-01, double* %21
%22 = load double*, double** %2
%23 = getelementptr inbounds double, double* %22, i64 1
store double 5.000000e-01, double* %23
br label %24
24: ; preds = %19, %6
ret void
}

LLVM IR (-O2):
define void @colamd_set_defaults(double* writeonly %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = getelementptr inbounds double, double* %0, i64 2
%5 = bitcast double* %4 to i8*
%6 = bitcast double* %0 to <2 x double>*
store <2 x double> <double 5.000000e-01, double 5.000000e-01>, <2 x double>* %6
br label %7
7: ; preds = %1, %3
ret void
}
/* Type definitions */
struct create_cmdline_parser_params {
  int dummy;
};
struct create_args_info {
  int dummy;
};

/* Variables and functions */
int create_cmdline_parser_internal(int, char **, struct create_args_info *,
                                   struct create_cmdline_parser_params *,
                                   int /*<<< orphan*/);
int create_cmdline_parser_ext(int argc, char **argv,
                              struct create_args_info *args_info,
                              struct create_cmdline_parser_params *params) {
  int result;
  result = create_cmdline_parser_internal(argc, argv, args_info, params, 0);
  return result;
}


x86 assembly (clang, -O0):
<create_cmdline_parser_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <create_cmdline_parser_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_cmdline_parser_ext>:
xor    %r8d,%r8d
jmp    1030 <create_cmdline_parser_internal@plt>

LLVM IR (-O0):
%struct.create_args_info = type { i32 }
%struct.create_cmdline_parser_params = type { i32 }
define i32 @create_cmdline_parser_ext(i32 %0, i8** %1, %struct.create_args_info* %2, %struct.create_cmdline_parser_params* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.create_args_info*
%8 = alloca %struct.create_cmdline_parser_params*
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.create_args_info* %2, %struct.create_args_info** %7
store %struct.create_cmdline_parser_params* %3, %struct.create_cmdline_parser_params** %8
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = load %struct.create_args_info*, %struct.create_args_info** %7
%13 = load %struct.create_cmdline_parser_params*, %struct.create_cmdline_parser_params** %8
%14 = call i32 @create_cmdline_parser_internal(i32 %10, i8** %11, %struct.create_args_info* %12, %struct.create_cmdline_parser_params* %13, i32 0)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.create_args_info = type { i32 }
%struct.create_cmdline_parser_params = type { i32 }
define i32 @create_cmdline_parser_ext(i32 %0, i8** %1, %struct.create_args_info* %2, %struct.create_cmdline_parser_params* %3) {
%5 = tail call i32 @create_cmdline_parser_internal(i32 %0, i8** %1, %struct.create_args_info* %2, %struct.create_cmdline_parser_params* %3, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("X = %d\n", (a + b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [8 x i8] c"X = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int test_imm_7Euint8_mem(unsigned char *val) {
  return ((*val) & (-0x7E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Euint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -126
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void effaceMot(char *mot) {
  int indCaractere = 0;
  while (indCaractere < 30) {
    mot[indCaractere] = 0;
    indCaractere = indCaractere + 1;
  }
}


x86 assembly (clang, -O0):
<effaceMot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jge    1133 <effaceMot+0x33>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <effaceMot+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<effaceMot>:
xorps  %xmm0,%xmm0
movups %xmm0,0xe(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @effaceMot(i8* nocapture writeonly %0) {
ret void
}
int lw_exec2_run(char *file, char *commandline) {
  int result = 0;
  file = file;
  commandline = commandline;
  return result;
}


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

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

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

LLVM IR (-O2):
define i32 @lw_exec2_run(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void err_sys(const char *msg) {
  printf("%s\n", msg);
  exit(0);
}


x86 assembly (clang, -O0):
<err_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_sys>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @err_sys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @err_sys(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int findTrailingZeros(int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, z;
  scanf("%d", &n);
  z = findTrailingZeros(n);
  printf("Number of trailing zeros of %d is %d \n", n, z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <findTrailingZeros@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <findTrailingZeros@plt>
mov    0x4(%rsp),%esi
lea    0xead(%rip),%rdi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [39 x i8] c"Number of trailing zeros of %d is %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @findTrailingZeros(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %5)
ret i32 0
}
int fun211() { return 211; }


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

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

LLVM IR (-O0):
define i32 @fun211() {
ret i32 211
}

LLVM IR (-O2):
define i32 @fun211() {
ret i32 211
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void draw_line(unsigned int i) {
  for (unsigned int j = 0; j < i; ++j)
    printf("-");
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<draw_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1148 <draw_line+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <draw_line+0x12>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @draw_line(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 ult i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @draw_line(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %5, %1
%4 = tail call i32 @putchar(i32 10)
ret void
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 @putchar(i32 45)
%8 = add nuw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %3, label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int usage(char *name) {
  printf("Usage: %s [-d] <command> <arg1> ... <argn>\n", name);
  return 252;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfc,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfc,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Usage: %s [-d] <command> <arg1> ... <argn>\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 252
}

LLVM IR (-O2):
@.str = [44 x i8] c"Usage: %s [-d] <command> <arg1> ... <argn>\0A\00"
define i32 @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 252
}
/* Type definitions */
typedef int /*<<< orphan*/ on;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int /*<<< orphan*/ xsetsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                               int *, int);
void disable_tcp_nagle(int fd) {
  int on = 1;
  xsetsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
}


x86 assembly (clang, -O0):
<disable_tcp_nagle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <xsetsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_tcp_nagle>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <xsetsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define void @disable_tcp_nagle(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_TCP
%6 = load i32, i32* @TCP_NODELAY
%7 = call i32 @xsetsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define void @disable_tcp_nagle(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @IPPROTO_TCP
%5 = load i32, i32* @TCP_NODELAY
%6 = call i32 @xsetsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret void
}
unsigned short int unsignedshortint_id(unsigned short int x) { return x; }


x86 assembly (clang, -O0):
<unsignedshortint_id>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedshortint_id>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @unsignedshortint_id(i16 returned zeroext %0) {
ret i16 %0
}
int strcmp(const char *s, const char *t) {
  while (*s == *t) {
    if (*s == '\0') {
      return 0;
    }
    s++;
    t++;
  }
  return *s - *t;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <strcmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <strcmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(void const *, int, int /*<<< orphan*/,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char const *);
void emit_text(FILE *f, const char *t) {
  fwrite((const void *)t, 1, strlen(t), f);
}


x86 assembly (clang, -O0):
<emit_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_text>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>

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

LLVM IR (-O2):
define void @emit_text(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @fwrite(i8* %1, i32 1, i32 %3, i32* %0)
ret void
}
int my_is_prime(int n, int k) {
  if (k <= 0)
    return (0);
  if ((n % k) == 0) {
    return (1);
  } else {
    return my_is_prime(n, k - 1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<my_is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1134 <my_is_prime+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1161 <my_is_prime+0x51>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1150 <my_is_prime+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1161 <my_is_prime+0x51>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <my_is_prime@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_is_prime>:
xor    %ecx,%ecx
test   %esi,%esi
jle    1123 <my_is_prime+0x23>
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1126 <my_is_prime+0x26>
lea    -0x1(%rsi),%eax
cmp    $0x2,%esi
mov    %eax,%esi
jge    1110 <my_is_prime+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @my_is_prime(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* %5
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %20
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = srem i32 %10, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %3
br label %20
15: ; preds = %9
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = sub nsw i32 %17, 1
%19 = call i32 @my_is_prime(i32 %16, i32 %18)
store i32 %19, i32* %3
br label %20
20: ; preds = %15, %14, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @my_is_prime(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %11, label %7
4: ; preds = %7
%5 = add nsw i32 %8, -1
%6 = icmp slt i32 %8, 2
br i1 %6, label %11, label %7
7: ; preds = %2, %4
%8 = phi i32 [ %5, %4 ], [ %1, %2 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %7, %2
%12 = phi i32 [ 0, %2 ], [ 1, %7 ], [ 0, %4 ]
ret i32 %12
}
void f(char *cp) {
#pragma acc parallel present(cp [7:9])
  ;
}


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

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

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

LLVM IR (-O2):
define void @f(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void assert_descriptor(int desc) {
  if (desc < 0) {
    fprintf(stderr, "Error: %s.\n", strerror(errno));
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<assert_descriptor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    117f <assert_descriptor+0x4f>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_descriptor>:
test   %edi,%edi
js     1135 <assert_descriptor+0x5>
ret
push   %rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebx
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Error: %s.\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @assert_descriptor(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}
int prompt_len(char *prompt) {
  char *pos;
  if (!prompt)
    return 0;
  for (pos = prompt; *pos && (*pos != '\n'); ++pos)
    ;
  return pos - prompt;
}


x86 assembly (clang, -O0):
<prompt_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <prompt_len+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1180 <prompt_len+0x80>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     114c <prompt_len+0x4c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    115c <prompt_len+0x5c>
jmp    1172 <prompt_len+0x72>
jmp    1161 <prompt_len+0x61>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <prompt_len+0x27>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_len>:
xor    %eax,%eax
test   %rdi,%rdi
je     1123 <prompt_len+0x23>
nopw   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1123 <prompt_len+0x23>
cmp    $0xa,%cl
je     1123 <prompt_len+0x23>
add    $0x1,%rax
jmp    1110 <prompt_len+0x10>
ret

LLVM IR (-O0):
define i32 @prompt_len(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %33
8: ; preds = %1
%9 = load i8*, i8** %3
store i8* %9, i8** %4
br label %10
10: ; preds = %23, %8
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 10
br label %20
20: ; preds = %15, %10
%21 = phi i1 [ false, %10 ], [ %19, %15 ]
br i1 %21, label %22, label %26
22: ; preds = %20
br label %23
23: ; preds = %22
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
br label %10
26: ; preds = %20
%27 = load i8*, i8** %4
%28 = load i8*, i8** %3
%29 = ptrtoint i8* %27 to i64
%30 = ptrtoint i8* %28 to i64
%31 = sub i64 %29, %30
%32 = trunc i64 %31 to i32
store i32 %32, i32* %2
br label %33
33: ; preds = %26, %7
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @prompt_len(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 10, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %3
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
br label %13
13: ; preds = %1, %8
%14 = phi i32 [ %12, %8 ], [ 0, %1 ]
ret i32 %14
}
int decHex(int num) {
  if (num >= 10) {
    switch (num) {
    case 10:
      return 'A';
      break;
    case 11:
      return 'B';
      break;
    case 12:
      return 'C';
      break;
    case 13:
      return 'D';
      break;
    case 14:
      return 'E';
      break;
    case 15:
      return 'F';
      break;
    }
  } else {
    return num + '0';
  }
  return 1;
}


x86 assembly (clang, -O0):
<decHex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1187 <decHex+0x87>
mov    -0x8(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1182 <decHex+0x82>
mov    -0x10(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x41,-0x4(%rbp)
jmp    119c <decHex+0x9c>
movl   $0x42,-0x4(%rbp)
jmp    119c <decHex+0x9c>
movl   $0x43,-0x4(%rbp)
jmp    119c <decHex+0x9c>
movl   $0x44,-0x4(%rbp)
jmp    119c <decHex+0x9c>
movl   $0x45,-0x4(%rbp)
jmp    119c <decHex+0x9c>
movl   $0x46,-0x4(%rbp)
jmp    119c <decHex+0x9c>
jmp    1195 <decHex+0x95>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    119c <decHex+0x9c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decHex>:
cmp    $0xa,%edi
jl     1117 <decHex+0x17>
lea    -0xa(%rdi),%eax
add    $0x37,%edi
cmp    $0x6,%eax
mov    $0x1,%eax
cmovb  %edi,%eax
ret
add    $0x30,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @decHex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 10
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %3
switch i32 %7, label %14 [
i32 10, label %8
i32 11, label %9
i32 12, label %10
i32 13, label %11
i32 14, label %12
i32 15, label %13
]
8: ; preds = %6
store i32 65, i32* %2
br label %19
9: ; preds = %6
store i32 66, i32* %2
br label %19
10: ; preds = %6
store i32 67, i32* %2
br label %19
11: ; preds = %6
store i32 68, i32* %2
br label %19
12: ; preds = %6
store i32 69, i32* %2
br label %19
13: ; preds = %6
store i32 70, i32* %2
br label %19
14: ; preds = %6
br label %18
15: ; preds = %1
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 48
store i32 %17, i32* %2
br label %19
18: ; preds = %14
store i32 1, i32* %2
br label %19
19: ; preds = %18, %15, %13, %12, %11, %10, %9, %8
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @decHex(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = add i32 %0, -10
%5 = icmp ult i32 %4, 6
%6 = add i32 %0, 55
%7 = select i1 %5, i32 %6, i32 1
br label %10
8: ; preds = %1
%9 = add nsw i32 %0, 48
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ %9, %8 ], [ %7, %3 ]
ret i32 %11
}
__attribute__((weak, section(".after_vectors"))) void SysTick_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<SysTick_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SysTick_Handler+0x9>
jmp    1109 <SysTick_Handler+0x9>

x86 assembly (clang, -O2):
<SysTick_Handler>:
jmp    1100 <SysTick_Handler>

LLVM IR (-O0):
define weak void @SysTick_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @SysTick_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
double Double__MINUS_(double x, double y) { return x - y; }


x86 assembly (clang, -O0):
<Double__MINUS_>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Double__MINUS_>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Double__MINUS_(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @Double__MINUS_(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/ *);
int8_t impl_0(FILE **this, void **unused, bool *valid) {
  int8_t x;
  *valid = fscanf(*this, "%c", &x) == 1;
  return x;
}


x86 assembly (clang, -O0):
<impl_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xece(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <fscanf@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<impl_0>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    (%rdi),%rdi
lea    0xede(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1030 <fscanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,(%rbx)
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @impl_0(i32** %0, i8** %1, i32* %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%8 = load i32**, i32*** %4
%9 = load i32*, i32** %8
%10 = call i32 @fscanf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = load i32*, i32** %6
store i32 %12, i32* %13
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @impl_0(i32** nocapture %0, i8** nocapture readnone %1, i32* nocapture writeonly %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32*, i32** %0
%7 = call i32 @fscanf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
store i32 %9, i32* %2
%10 = load i32, i32* %4
ret i32 %10
}
void interrupt_disable(void) { __asm__ volatile("cli"); }


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

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

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

LLVM IR (-O2):
define void @interrupt_disable() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initdir();
int /*<<< orphan*/ initenv();
int /*<<< orphan*/ initfds();
int /*<<< orphan*/ initnav();
int /*<<< orphan*/ initpasswd();
int /*<<< orphan*/ initsigs();
int /*<<< orphan*/ printf(char *);
void resh_init(void) {
  printf("Welcome to the Fat Dragon.  Type 'help' if you are lost.\n\n");
  initsigs();
  initfds();
  initdir();
  initenv();
  initpasswd();
  initnav();
}


x86 assembly (clang, -O0):
<resh_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <initsigs@plt>
mov    $0x0,%al
call   1060 <initfds@plt>
mov    $0x0,%al
call   1070 <initdir@plt>
mov    $0x0,%al
call   1050 <initenv@plt>
mov    $0x0,%al
call   1090 <initpasswd@plt>
mov    $0x0,%al
call   1030 <initnav@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resh_init>:
push   %rax
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1080 <initsigs@plt>
xor    %eax,%eax
call   1060 <initfds@plt>
xor    %eax,%eax
call   1070 <initdir@plt>
xor    %eax,%eax
call   1050 <initenv@plt>
xor    %eax,%eax
call   1090 <initpasswd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <initnav@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Welcome to the Fat Dragon. Type 'help' if you are lost.\0A\0A\00"
define void @resh_init() {
%1 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @initsigs()
%3 = call i32 (...) @initfds()
%4 = call i32 (...) @initdir()
%5 = call i32 (...) @initenv()
%6 = call i32 (...) @initpasswd()
%7 = call i32 (...) @initnav()
ret void
}

LLVM IR (-O2):
@str = [58 x i8] c"Welcome to the Fat Dragon. Type 'help' if you are lost.\0A\00"
define void @resh_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @initsigs()
%3 = tail call i32 (...) @initfds()
%4 = tail call i32 (...) @initdir()
%5 = tail call i32 (...) @initenv()
%6 = tail call i32 (...) @initpasswd()
%7 = tail call i32 (...) @initnav()
ret void
}