xunge/DecIR huggingface dataset:
unsigned tfx_hash(const char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++)
    hashval = *s + 31 * hashval;
  return hashval % 101;
}


x86 assembly (clang, -O0):
<tfx_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <tfx_hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <tfx_hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x65,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfx_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1147 <tfx_hash+0x47>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <tfx_hash+0x10>
mov    %eax,%ecx
imul   $0x446f8657,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x6,%edx
imul   $0x65,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @tfx_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 101
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ Report(char *);
int astG3DQch(float *ch) {
  Report("astG3DQch");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"astG3DQch\00"
define i32 @astG3DQch(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = call i32 @Report(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"astG3DQch\00"
define i32 @astG3DQch(float* nocapture readnone %0) {
%2 = tail call i32 @Report(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double exponencial(double x) {
  int n = 1;
  double exp = 0.0, termino = 1.0;
  exp = termino;
  while (termino > 1e-7) {
    termino *= x / n;
    exp += termino;
    n++;
  }
  return exp;
}


x86 assembly (clang, -O0):
<exponencial>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117b <exponencial+0x7b>
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <exponencial+0x2f>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponencial>:
mov    $0x1,%eax
movsd  0xef3(%rip),%xmm2
movsd  0xef3(%rip),%xmm3
movapd %xmm2,%xmm1
nopl   0x0(%rax)
xorps  %xmm4,%xmm4
cvtsi2sd %eax,%xmm4
movapd %xmm0,%xmm5
divsd  %xmm4,%xmm5
mulsd  %xmm5,%xmm2
addsd  %xmm2,%xmm1
add    $0x1,%eax
ucomisd %xmm3,%xmm2
ja     1120 <exponencial+0x20>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @exponencial(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %2
store i32 1, i32* %3
store double 0.000000e+00, double* %4
store double 1.000000e+00, double* %5
%6 = load double, double* %5
store double %6, double* %4
br label %7
7: ; preds = %10, %1
%8 = load double, double* %5
%9 = fcmp ogt double %8, 0x3E7AD7F29ABCAF48
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load double, double* %2
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to double
%14 = fdiv double %11, %13
%15 = load double, double* %5
%16 = fmul double %15, %14
store double %16, double* %5
%17 = load double, double* %5
%18 = load double, double* %4
%19 = fadd double %18, %17
store double %19, double* %4
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %7
22: ; preds = %7
%23 = load double, double* %4
ret double %23
}

LLVM IR (-O2):
define double @exponencial(double %0) {
br label %2
2: ; preds = %1, %2
%3 = phi double [ 1.000000e+00, %1 ], [ %8, %2 ]
%4 = phi double [ 1.000000e+00, %1 ], [ %9, %2 ]
%5 = phi i32 [ 1, %1 ], [ %10, %2 ]
%6 = sitofp i32 %5 to double
%7 = fdiv double %0, %6
%8 = fmul double %3, %7
%9 = fadd double %4, %8
%10 = add nuw nsw i32 %5, 1
%11 = fcmp ogt double %8, 0x3E7AD7F29ABCAF48
br i1 %11, label %2, label %12
12: ; preds = %2
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strncmp(char *, char *, int);
void strncmp_diff_length_5() {
  char *x = "012";
  char *y = "12345";
  clang_analyzer_eval(strncmp(x, y, 3) == -1);
}


x86 assembly (clang, -O0):
<strncmp_diff_length_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_diff_length_5>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"012\00"
@.str.1 = [6 x i8] c"12345\00"
define void @strncmp_diff_length_5() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strncmp(i8* %3, i8* %4, i32 3)
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"012\00"
@.str.1 = [6 x i8] c"12345\00"
define void @strncmp_diff_length_5() {
%1 = tail call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 3)
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int /*<<< orphan*/, int);
int /*<<< orphan*/ south_fill(int);
void south_fill_test(void **state) {
  assert_int_equal(south_fill(0x0100000000000000ul), 0x0101010101010101ul);
}


x86 assembly (clang, -O0):
<south_fill_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <south_fill@plt>
mov    %eax,%edi
mov    $0x1010101,%esi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<south_fill_test>:
push   %rax
xor    %edi,%edi
call   1030 <south_fill@plt>
mov    %eax,%edi
mov    $0x1010101,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @south_fill_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @south_fill(i32 0)
%4 = call i32 @assert_int_equal(i32 %3, i32 16843009)
ret void
}

LLVM IR (-O2):
define void @south_fill_test(i8** nocapture readnone %0) {
%2 = tail call i32 @south_fill(i32 0)
%3 = tail call i32 @assert_int_equal(i32 %2, i32 16843009)
ret void
}
/* Variables and functions */
int crc16(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strlen(char *);
int main() {
  char *test = "admin6b8b4567";
  printf("%d\n", crc16(test, strlen(test)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1050 <crc16@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <crc16@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"admin6b8b4567\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @crc16(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
void gtk_color_selection_get_current_alpha() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_selection_get_current_alpha() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void error(char *s) {
  (void)move(21 + 2, 0);
  (void)clrtoeol();
  if (s) {
    (void)addstr(s);
    (void)write(1, "\007", 1);
    ;
  }
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x17,%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    $0x0,%al
call   1040 <clrtoeol@plt>
cmpq   $0x0,-0x8(%rbp)
je     1186 <error+0x46>
mov    -0x8(%rbp),%rdi
call   1050 <addstr@plt>
mov    $0x1,%edx
lea    0xe81(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
mov    $0x17,%edi
xor    %esi,%esi
call   1060 <move@plt>
xor    %eax,%eax
call   1040 <clrtoeol@plt>
test   %rbx,%rbx
je     117b <error+0x3b>
mov    %rbx,%rdi
call   1050 <addstr@plt>
lea    0xe95(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <write@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\07\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @move(i32 23, i32 0)
%4 = call i32 (...) @clrtoeol()
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @addstr(i8* %8)
%10 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\07\00"
define void @error(i8* %0) {
%2 = tail call i32 @move(i32 23, i32 0)
%3 = tail call i32 (...) @clrtoeol()
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @addstr(i8* %0)
%7 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %8
8: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_sleep_low() {
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
}


x86 assembly (clang, -O0):
<set_pmu_sleep_low>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_sleep_low>:
push   %rax
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_sleep_low() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 49697)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 49697)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 49697)
%6 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @set_pmu_sleep_low() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 49697)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 49697)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 49697)
%6 = tail call i32 @delay(i32 100)
ret void
}
/* Variables and functions */
bool SHAREMIND_SET_KEY_LESS_THAN_unsigned_char(unsigned char const k1,
                                               unsigned char const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_LESS_THAN_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_LESS_THAN_unsigned_char>:
xor    %eax,%eax
cmp    %sil,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_unsigned_char(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp slt i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_unsigned_char(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp ult i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void handle_BUS(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_BUS(i32 %0) {
ret void
}
void n_condWait(struct _WsbmCond *cond, struct _WsbmMutex *mutex) { ; }


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

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

LLVM IR (-O0):
%struct._WsbmCond = type opaque
%struct._WsbmMutex = type opaque
define void @n_condWait(%struct._WsbmCond* %0, %struct._WsbmMutex* %1) {
%3 = alloca %struct._WsbmCond*
%4 = alloca %struct._WsbmMutex*
store %struct._WsbmCond* %0, %struct._WsbmCond** %3
store %struct._WsbmMutex* %1, %struct._WsbmMutex** %4
ret void
}

LLVM IR (-O2):
%struct._WsbmCond = type opaque
%struct._WsbmMutex = type opaque
define void @n_condWait(%struct._WsbmCond* nocapture %0, %struct._WsbmMutex* nocapture %1) {
ret void
}
/* Variables and functions */
int *prime(int);
int is_prime(int n) {
  int i, *p = prime(n);
  for (i = 0; p[i] != 0; i++)
    ;
  return p[i - 1];
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <prime@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1153 <is_prime+0x43>
jmp    1145 <is_prime+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <is_prime+0x1e>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
push   %rax
call   1030 <prime@plt>
movabs $0xfffffffe00000000,%rcx
ff ff ff
movabs $0x100000000,%rdx
mov    %rax,%rsi
nopl   (%rax)
add    %rdx,%rcx
cmpl   $0x0,(%rsi)
lea    0x4(%rsi),%rsi
jne    1130 <is_prime+0x20>
sar    $0x1e,%rcx
mov    (%rax,%rcx,1),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = tail call i32* @prime(i32 %0)
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i32, i32* %2, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = shl i64 %4, 32
%11 = add i64 %10, -4294967296
%12 = ashr exact i64 %11, 32
%13 = getelementptr inbounds i32, i32* %2, i64 %12
%14 = load i32, i32* %13
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ AT_SYMLINK_NOFOLLOW;
int fchmodat(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int lchmodat(int fd, char const *file, mode_t mode) {
  return fchmodat(fd, file, mode, AT_SYMLINK_NOFOLLOW);
}


x86 assembly (clang, -O0):
<lchmodat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
call   1030 <fchmodat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lchmodat>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <fchmodat@plt>

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

LLVM IR (-O2):
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @lchmodat(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%5 = tail call i32 @fchmodat(i32 %0, i8* %1, i32 %2, i32 %4)
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
void set_XConfigureRequestEvent_send_event(void *_p, int _v) {
  ((XConfigureRequestEvent *)_p)->send_event = (int)_v;
}


x86 assembly (clang, -O0):
<set_XConfigureRequestEvent_send_event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XConfigureRequestEvent_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XConfigureRequestEvent_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XConfigureRequestEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetGate(void *, int, int /*<<< orphan*/, void *);
void SetTrapGate(void *idt, int n, void *address) {
  SetGate(&idt[n], 15, 0, address);
}


x86 assembly (clang, -O0):
<SetTrapGate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rcx
mov    $0xf,%esi
xor    %edx,%edx
call   1030 <SetGate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetTrapGate>:
mov    %rdx,%rcx
movslq %esi,%rax
add    %rax,%rdi
mov    $0xf,%esi
xor    %edx,%edx
jmp    1030 <SetGate@plt>

LLVM IR (-O0):
define void @SetTrapGate(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8*, i8** %6
%12 = call i32 @SetGate(i8* %10, i32 15, i32 0, i8* %11)
ret void
}

LLVM IR (-O2):
define void @SetTrapGate(i8* %0, i32 %1, i8* %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @SetGate(i8* %5, i32 15, i32 0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char input_string[105];
  scanf("%[^\n]", input_string);
  printf("Hello, World.\n");
  printf("%s\n", input_string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%[^\0A]\00"
@str = [14 x i8] c"Hello, World.\00"
define i32 @main() {
%1 = alloca [105 x i8]
%2 = getelementptr inbounds [105 x i8], [105 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* %2)
ret i32 0
}
reg0regx1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (r0 <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0regx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jg     1138 <reg0regx1+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <reg0regx1+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0regx1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmp    %edi,(%r9,%rcx,4)
setge  %al
ret

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

LLVM IR (-O2):
define i32 @reg0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = icmp sge i32 %9, %0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void err_syntax11_error(const char *s) { printf("%s\n", s); }


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

x86 assembly (clang, -O2):
<err_syntax11_error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @err_syntax11_error(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)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @err_syntax11_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int none() {
  for (;;) {
  }
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @none() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define i32 @none() {
br label %1
1: ; preds = %1, %0
br label %1
}
int test_imm_BDint8_reg(signed char val) {
  return ((val) & (-0xBD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BDint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff43,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BDint8_reg>:
test   $0xffffff43,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BDint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -189
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int IsEqualChar(void *a, void *b) { return *(char *)a == *(char *)b; }


x86 assembly (clang, -O0):
<IsEqualChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsEqualChar>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @IsEqualChar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsEqualChar(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int main() {
  int a = 108, b = 111;
  putchar(72);
  putchar(101);
  putchar(a);
  putchar(a);
  putchar(b);
  putchar(32);
  putchar(87);
  putchar(b);
  putchar(114);
  putchar(a);
  putchar(100);
  putchar(33);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6c,-0x8(%rbp)
movl   $0x6f,-0xc(%rbp)
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x57,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x64,%edi
call   1030 <putchar@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x57,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x64,%edi
call   1030 <putchar@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 108, i32* %2
store i32 111, i32* %3
%4 = call i32 @putchar(i32 72)
%5 = call i32 @putchar(i32 101)
%6 = load i32, i32* %2
%7 = call i32 @putchar(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @putchar(i32 %8)
%10 = load i32, i32* %3
%11 = call i32 @putchar(i32 %10)
%12 = call i32 @putchar(i32 32)
%13 = call i32 @putchar(i32 87)
%14 = load i32, i32* %3
%15 = call i32 @putchar(i32 %14)
%16 = call i32 @putchar(i32 114)
%17 = load i32, i32* %2
%18 = call i32 @putchar(i32 %17)
%19 = call i32 @putchar(i32 100)
%20 = call i32 @putchar(i32 33)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 72)
%2 = tail call i32 @putchar(i32 101)
%3 = tail call i32 @putchar(i32 108)
%4 = tail call i32 @putchar(i32 108)
%5 = tail call i32 @putchar(i32 111)
%6 = tail call i32 @putchar(i32 32)
%7 = tail call i32 @putchar(i32 87)
%8 = tail call i32 @putchar(i32 111)
%9 = tail call i32 @putchar(i32 114)
%10 = tail call i32 @putchar(i32 108)
%11 = tail call i32 @putchar(i32 100)
%12 = tail call i32 @putchar(i32 33)
ret i32 0
}
void CMovableEntity_OnInitClass(void) {}


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

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

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

LLVM IR (-O2):
define void @CMovableEntity_OnInitClass() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int i = 1;
  switch (i) {
    printf("\nHello, ");
  case 1:
    printf("One, ");
    i++;
    break;
  case 2:
    printf("Two");
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     114b <main+0x3b>
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1165 <main+0x55>
jmp    1171 <main+0x61>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <main+0x61>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"One, \00"
@.str.1 = [4 x i8] c"Two\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %8
]
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %0, %8, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"One, \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ myarray;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ tail(int *, int);
int main(void) {
  int myarray[] = {24, 37, 142, 205};
  int length = sizeof(myarray) / sizeof(*myarray);
  printf("Length of myarray is %d \n", length);
  tail(myarray, length);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <tail@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeda(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <tail@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.myarray = [4 x i32] [i32 24, i32 37, i32 142, i32 205]
@.str = [26 x i8] c"Length of myarray is %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
store i32 4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @tail(i32* %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.myarray = [4 x i32] [i32 24, i32 37, i32 142, i32 205]
@.str = [26 x i8] c"Length of myarray is %d \0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%5 = call i32 @tail(i32* %4, i32 4)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_quaddobl_container_to_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(262, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_container_to_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x106,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_quaddobl_container_to_target_system>:
mov    $0x106,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_container_to_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 262, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_quaddobl_container_to_target_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 262, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ timeout;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVTIMEO;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int setSocketTimeout(int sockfd) {
  int ret = 0;
  struct timeval timeout;
  timeout.tv_sec = 2;
  timeout.tv_usec = 0;
  ret = setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout,
                   sizeof(timeout));
  return ret;
}


x86 assembly (clang, -O0):
<setSocketTimeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
lea    -0x18(%rbp),%rcx
mov    $0x10,%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSocketTimeout>:
sub    $0x18,%rsp
movl   $0x2,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rcx
mov    $0x10,%r8d
call   1030 <setsockopt@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
@SOL_SOCKET = global i32 0
@SO_RCVTIMEO = global i32 0
define i32 @setSocketTimeout(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timeval
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i32 2, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
store i64 0, i64* %6
%7 = load i32, i32* %2
%8 = load i32, i32* @SOL_SOCKET
%9 = load i32, i32* @SO_RCVTIMEO
%10 = bitcast %struct.timeval* %4 to i8*
%11 = call i32 @setsockopt(i32 %7, i32 %8, i32 %9, i8* %10, i32 16)
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
@SOL_SOCKET = global i32 0
@SO_RCVTIMEO = global i32 0
define i32 @setSocketTimeout(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 2, i32* %4
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 0, i64* %5
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_RCVTIMEO
%8 = call i32 @setsockopt(i32 %0, i32 %6, i32 %7, i8* %3, i32 16)
ret i32 %8
}
struct nouveau_miptree *nouveau_miptree(struct pipe_texture *pt) {
  return (struct nouveau_miptree *)pt;
}


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

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

LLVM IR (-O0):
%struct.nouveau_miptree = type opaque
%struct.pipe_texture = type opaque
define %struct.nouveau_miptree* @nouveau_miptree(%struct.pipe_texture* %0) {
%2 = alloca %struct.pipe_texture*
store %struct.pipe_texture* %0, %struct.pipe_texture** %2
%3 = load %struct.pipe_texture*, %struct.pipe_texture** %2
%4 = bitcast %struct.pipe_texture* %3 to %struct.nouveau_miptree*
ret %struct.nouveau_miptree* %4
}

LLVM IR (-O2):
%struct.nouveau_miptree = type opaque
%struct.pipe_texture = type opaque
define %struct.nouveau_miptree* @nouveau_miptree(%struct.pipe_texture* readnone %0) {
%2 = bitcast %struct.pipe_texture* %0 to %struct.nouveau_miptree*
ret %struct.nouveau_miptree* %2
}
int st_numhash(x, size)
char *x;
int size;
{ return ((((long)x) < 0 ? -((long)x) : ((long)x)) % (size)); }


x86 assembly (clang, -O0):
<st_numhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x0,%rax
jge    112b <st_numhash+0x2b>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1133 <st_numhash+0x33>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_numhash>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
movslq %esi,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1122 <st_numhash+0x22>
cqto
idiv   %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @st_numhash(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i64 @llvm.abs.i64(i64 %3, i1 true)
%5 = sext i32 %1 to i64
%6 = srem i64 %4, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ thread_relinquish();
void thread2(void) {
  static int i;
  for (;;) {
    printf("thread2 %d\n", i += 2);
    thread_relinquish();
  }
}


x86 assembly (clang, -O0):
<thread2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    112d <thread2+0xd>
mov    0x2f01(%rip),%esi
add    $0x2,%esi
mov    %esi,-0x4(%rbp)
mov    %esi,0x2ef5(%rip)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <thread_relinquish@plt>
jmp    112d <thread2+0xd>

x86 assembly (clang, -O2):
<thread2>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    0x2efe(%rip),%esi
add    $0x2,%esi
mov    %esi,0x2ef5(%rip)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <thread_relinquish@plt>
jmp    1130 <thread2+0x10>

LLVM IR (-O0):
@thread2.i = internal global i32 0
@.str = [12 x i8] c"thread2 %d\0A\00"
define void @thread2() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @thread2.i
%3 = add nsw i32 %2, 2
store i32 %3, i32* @thread2.i
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @thread_relinquish()
br label %1
}

LLVM IR (-O2):
@thread2.i = internal unnamed_addr global i32 0
@.str = [12 x i8] c"thread2 %d\0A\00"
define void @thread2() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @thread2.i
%3 = add nsw i32 %2, 2
store i32 %3, i32* @thread2.i
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @thread_relinquish()
br label %1
}
int test_imm_46uint8_mem(unsigned char *val) {
  return ((*val) & (0x46 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_46uint8_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, 70
%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_46uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 70
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void a_barrier() { a_cas(&(int){0}, 0, 0); }


x86 assembly (clang, -O0):
<a_barrier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <a_cas@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_barrier>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <a_cas@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @a_barrier() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @a_cas to i32 (i32*, i32, i32, ...)*)(i32* %1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @a_barrier() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @a_cas to i32 (i32*, i32, i32, ...)*)(i32* %1, i32 0, i32 0)
ret void
}