xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EVT_exit();
int /*<<< orphan*/ PM_fatalError(char *);
void _EVT_abort() {
  EVT_exit();
  PM_fatalError("Unhandled exception!");
}


x86 assembly (clang, -O0):
<_EVT_abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <EVT_exit@plt>
lea    0xece(%rip),%rdi
call   1030 <PM_fatalError@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_EVT_abort>:
push   %rax
xor    %eax,%eax
call   1040 <EVT_exit@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <PM_fatalError@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Unhandled exception!\00"
define void @_EVT_abort() {
%1 = call i32 (...) @EVT_exit()
%2 = call i32 @PM_fatalError(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Unhandled exception!\00"
define void @_EVT_abort() {
%1 = tail call i32 (...) @EVT_exit()
%2 = tail call i32 @PM_fatalError(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double atof(char const *);
int numeric_str_cmp(const void *a, const void *b) {
  double aa = atof(*((const char **)a));
  double bb = atof(*((const char **)b));
  if (aa > bb)
    return 1;
  else if (aa < bb)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<numeric_str_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    115e <numeric_str_cmp+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1185 <numeric_str_cmp+0x75>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    117e <numeric_str_cmp+0x6e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <numeric_str_cmp+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeric_str_cmp>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    (%rdi),%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    (%rbx),%rdi
call   1030 <atof@plt>
xor    %ecx,%ecx
movsd  0x8(%rsp),%xmm1
ucomisd %xmm1,%xmm0
seta   %cl
neg    %ecx
ucomisd %xmm0,%xmm1
mov    $0x1,%eax
cmovbe %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @numeric_str_cmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call double @atof(i8* %10)
store double %11, double* %6
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to i8**
%14 = load i8*, i8** %13
%15 = call double @atof(i8* %14)
store double %15, double* %7
%16 = load double, double* %6
%17 = load double, double* %7
%18 = fcmp ogt double %16, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 1, i32* %3
br label %26
20: ; preds = %2
%21 = load double, double* %6
%22 = load double, double* %7
%23 = fcmp olt double %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 -1, i32* %3
br label %26
25: ; preds = %20
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %19
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @numeric_str_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = tail call double @atof(i8* %4)
%6 = bitcast i8* %1 to i8**
%7 = load i8*, i8** %6
%8 = tail call double @atof(i8* %7)
%9 = fcmp ogt double %5, %8
%10 = fcmp olt double %5, %8
%11 = sext i1 %10 to i32
%12 = select i1 %9, i32 1, i32 %11
ret i32 %12
}
const char *plugin_api_info_color_ansi_regex_cb(void *data,
                                                const char *info_name,
                                                const char *arguments) {
  (void)data;
  (void)info_name;
  (void)arguments;
  return "\33("
         "([()].)|"
         "([<>])|"
         "(\\[[0-9;?]*[A-Za-z]))";
}


x86 assembly (clang, -O0):
<plugin_api_info_color_ansi_regex_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xee9(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_info_color_ansi_regex_cb>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [39 x i8] c"\1B(([()].)|([<>])|(\\[[0-9;?]*[A-Za-z]))\00"
define i8* @plugin_api_info_color_ansi_regex_cb(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [39 x i8] c"\1B(([()].)|([<>])|(\\[[0-9;?]*[A-Za-z]))\00"
define i8* @plugin_api_info_color_ansi_regex_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i;
  for (i = 1; i <= 10; i++) {
    printf("No debo fumar en clases\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"No debo fumar en clases\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@str = [24 x i8] c"No debo fumar en clases\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int is_separator(char *line) {
  unsigned int i;
  for (i = 0; line[i] != '\0'; i++) {
    if (line[i] != '-') {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_separator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1156 <is_separator+0x56>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
je     1143 <is_separator+0x43>
movl   $0x0,-0x4(%rbp)
jmp    115d <is_separator+0x5d>
jmp    1148 <is_separator+0x48>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <is_separator+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_separator>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
movzbl (%rdi,%rcx,1),%ecx
cmp    $0x2d,%cl
jne    1120 <is_separator+0x20>
add    $0x1,%eax
jmp    1110 <is_separator+0x10>
test   %cl,%cl
jne    112a <is_separator+0x2a>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_separator(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i32 [ 0, %1 ], [ %8, %7 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %10
i8 45, label %7
]
7: ; preds = %2
%8 = add i32 %3, 1
br label %2
9: ; preds = %2
br label %10
10: ; preds = %2, %9
%11 = phi i32 [ 0, %9 ], [ 1, %2 ]
ret i32 %11
}
float suma(int a, int b) {
  float c;
  c = a + b;
  return c;
}


x86 assembly (clang, -O0):
<suma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<suma>:
add    %esi,%edi
cvtsi2ss %edi,%xmm0
ret

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

LLVM IR (-O2):
define float @suma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sitofp i32 %3 to float
ret float %4
}
/* Variables and functions */
void putc(char c) {
  while (!((*(volatile unsigned long *)0x50000010) & (1 << 2)))
    ;
  (*(volatile unsigned char *)0x50000020) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x50000010,%eax
mov    (%rax),%rax
and    $0x4,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112c <putc+0x2c>
jmp    1131 <putc+0x31>
jmp    110a <putc+0xa>
mov    -0x1(%rbp),%cl
mov    $0x50000020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
testq  $0x4,0x50000010
je     1100 <putc>
mov    %dil,0x50000020
50
ret

LLVM IR (-O0):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i64, i64* inttoptr (i64 1342177296 to i64*)
%5 = and i64 %4, 4
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i8, i8* %2
store volatile i8 %10, i8* inttoptr (i64 1342177312 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 1342177296 to i64*)
%4 = and i64 %3, 4
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 1342177312 to i8*)
ret void
}
/* Variables and functions */
int asdad();
int /*<<< orphan*/ errorFn();
int sdsd();
int main(void) {
  int a;
  int b;
  int c;
  a = 5;
  b = a + 1;
  c = asdad();
  b = sdsd();
  if (c == 89) {
    b = 90;
  } else {
    b = 2000;
  }
  c = b;
  a = c - 1;
  if (a == 89) {
    errorFn();
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <asdad@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <sdsd@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x59,-0x10(%rbp)
jne    1179 <main+0x49>
movl   $0x5a,-0xc(%rbp)
jmp    1180 <main+0x50>
movl   $0x7d0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x59,-0x8(%rbp)
jne    11a0 <main+0x70>
mov    $0x0,%al
call   1030 <errorFn@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <asdad@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <sdsd@plt>
cmp    $0x59,%ebx
jne    114d <main+0x1d>
xor    %eax,%eax
call   1030 <errorFn@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = call i32 (...) @asdad()
store i32 %7, i32* %4
%8 = call i32 (...) @sdsd()
store i32 %8, i32* %3
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 89
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 90, i32* %3
br label %13
12: ; preds = %0
store i32 2000, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 89
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (...) @errorFn()
br label %21
21: ; preds = %19, %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @asdad()
%2 = tail call i32 (...) @sdsd()
%3 = icmp eq i32 %1, 89
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @errorFn()
br label %6
6: ; preds = %4, %0
ret i32 0
}
int is_in_modem_pintrl(unsigned int gpio) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @is_in_modem_pintrl(i32 %0) {
ret i32 -1
}
void sort_Free(void) { return; }


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

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

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

LLVM IR (-O2):
define void @sort_Free() {
ret void
}
int hash_id(const char *s) {
  register int h = 0;
  while (*s)
    h += *s++ & 0x1F;
  return h % 16;
}


x86 assembly (clang, -O0):
<hash_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <hash_id+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
and    $0x1f,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_id+0xf>
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_id>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <hash_id+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
and    $0x1f,%cl
movzbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_id+0x10>
and    $0xf,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_id(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 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = and i8 %5, 31
%10 = zext i8 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 15
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
int Mem_Free(void *ptr) {}


x86 assembly (clang, -O0):
<Mem_Free>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Mem_Free(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ clear32(int, int);
int /*<<< orphan*/ gecko_enable(int /*<<< orphan*/);
int /*<<< orphan*/ set32(int, int);
int /*<<< orphan*/ udelay(int);
int /*<<< orphan*/ write32(int, int);
void powerpc_reset(void) {
  do {
  } while (0);
  gecko_enable(0);
  write32((0xd800000 + 0x034), (1 << 30));
  clear32((0xd800000 + 0x194), 0x30);
  udelay(100);
  set32((0xd800000 + 0x194), 0x20);
  udelay(100);
  set32((0xd800000 + 0x194), 0x10);
  udelay(100000);
  set32((0xd800000 + 0x070), 1);
}


x86 assembly (clang, -O0):
<powerpc_reset>:
push   %rbp
mov    %rsp,%rbp
jmp    1159 <powerpc_reset+0x9>
jmp    115e <powerpc_reset+0xe>
xor    %edi,%edi
call   1050 <gecko_enable@plt>
mov    $0xd800034,%edi
mov    $0x40000000,%esi
call   1030 <write32@plt>
mov    $0xd800194,%edi
mov    $0x30,%esi
call   1070 <clear32@plt>
mov    $0x64,%edi
call   1060 <udelay@plt>
mov    $0xd800194,%edi
mov    $0x20,%esi
call   1040 <set32@plt>
mov    $0x64,%edi
call   1060 <udelay@plt>
mov    $0xd800194,%edi
mov    $0x10,%esi
call   1040 <set32@plt>
mov    $0x186a0,%edi
call   1060 <udelay@plt>
mov    $0xd800070,%edi
mov    $0x1,%esi
call   1040 <set32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerpc_reset>:
push   %rax
xor    %edi,%edi
call   1050 <gecko_enable@plt>
mov    $0xd800034,%edi
mov    $0x40000000,%esi
call   1030 <write32@plt>
mov    $0xd800194,%edi
mov    $0x30,%esi
call   1070 <clear32@plt>
mov    $0x64,%edi
call   1060 <udelay@plt>
mov    $0xd800194,%edi
mov    $0x20,%esi
call   1040 <set32@plt>
mov    $0x64,%edi
call   1060 <udelay@plt>
mov    $0xd800194,%edi
mov    $0x10,%esi
call   1040 <set32@plt>
mov    $0x186a0,%edi
call   1060 <udelay@plt>
mov    $0xd800070,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <set32@plt>

LLVM IR (-O0):
define void @powerpc_reset() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
%3 = call i32 @gecko_enable(i32 0)
%4 = call i32 @write32(i32 226492468, i32 1073741824)
%5 = call i32 @clear32(i32 226492820, i32 48)
%6 = call i32 @udelay(i32 100)
%7 = call i32 @set32(i32 226492820, i32 32)
%8 = call i32 @udelay(i32 100)
%9 = call i32 @set32(i32 226492820, i32 16)
%10 = call i32 @udelay(i32 100000)
%11 = call i32 @set32(i32 226492528, i32 1)
ret void
}

LLVM IR (-O2):
define void @powerpc_reset() {
%1 = tail call i32 @gecko_enable(i32 0)
%2 = tail call i32 @write32(i32 226492468, i32 1073741824)
%3 = tail call i32 @clear32(i32 226492820, i32 48)
%4 = tail call i32 @udelay(i32 100)
%5 = tail call i32 @set32(i32 226492820, i32 32)
%6 = tail call i32 @udelay(i32 100)
%7 = tail call i32 @set32(i32 226492820, i32 16)
%8 = tail call i32 @udelay(i32 100000)
%9 = tail call i32 @set32(i32 226492528, i32 1)
ret void
}
/* Variables and functions */
char *strstr(char const *, char const *);
int string_count_fields(const char *string, const char *delim) {
  int count = 0;
  const char *p = string;
  while (p) {
    count++;
    p = strstr(p, delim);
    if (p)
      p = &p[1];
  }
  return count;
}


x86 assembly (clang, -O0):
<string_count_fields>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1170 <string_count_fields+0x60>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     116b <string_count_fields+0x5b>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112f <string_count_fields+0x1f>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_count_fields>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1136 <string_count_fields+0x26>
mov    %rsi,%rbx
xor    %ebp,%ebp
nopl   (%rax)
add    $0x1,%ebp
mov    %rbx,%rsi
call   1030 <strstr@plt>
lea    0x1(%rax),%rdi
test   %rax,%rax
jne    1120 <string_count_fields+0x10>
jmp    1138 <string_count_fields+0x28>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @string_count_fields(i8* %0, i8* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ 0, %2 ]
%7 = add nuw nsw i32 %6, 1
%8 = tail call i8* @strstr(i8* %5, i8* dereferenceable(1) %1)
%9 = icmp eq i8* %8, null
%10 = getelementptr inbounds i8, i8* %8, i64 1
br i1 %9, label %11, label %4
11: ; preds = %4, %2
%12 = phi i32 [ 0, %2 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int printf(char *);
int main() { return printf("a") + (printf("b") + printf("c")); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
mov    %eax,%ebx
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    %eax,%ebp
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    %ebx,%ebp
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"b\00"
@.str.2 = [2 x i8] c"c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = add i32 %2, %1
%5 = add i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello Github!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello Github!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo(int *a, int *b) {
  if (a[0] > 1) {
    b[0] = 2;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jle    1123 <foo+0x23>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmpl   $0x2,(%rdi)
jl     110b <foo+0xb>
movl   $0x2,(%rsi)
ret

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

LLVM IR (-O2):
define void @foo(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %2
store i32 2, i32* %1
br label %6
6: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_err(char const *);
void error(const char *msg) {
  write_err("sysloglread: Error: ");
  write_err(msg);
  write_err("\n");
}


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

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <write_err@plt>
mov    %rbx,%rdi
call   1030 <write_err@plt>
lea    0xee6(%rip),%rdi
pop    %rbx
jmp    1030 <write_err@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"sysloglread: Error: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @write_err(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @write_err(i8* %4)
%6 = call i32 @write_err(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"sysloglread: Error: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @write_err(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write_err(i8* %0)
%4 = tail call i32 @write_err(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void bnxt_shutdown_tc(struct bnxt *bp) {}


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

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

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

LLVM IR (-O2):
%struct.bnxt = type opaque
define void @bnxt_shutdown_tc(%struct.bnxt* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char a;
  scanf("%c", &a);
  printf("%c", a - 32);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
lea    0xeba(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xf(%rsp),%al
add    $0xe0,%al
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 32
%6 = trunc i32 %5 to i8
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = add i8 %3, -32
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ const int32_t;

/* Variables and functions */
int32_t compute2(const uint32_t t[6][2]) { return t[0][1] + t[2][1]; }


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

x86 assembly (clang, -O2):
<compute2>:
mov    0x28(%rdi),%rax
add    0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @compute2([2 x i64]* %0) {
%2 = alloca [2 x i64]*
store [2 x i64]* %0, [2 x i64]** %2
%3 = load [2 x i64]*, [2 x i64]** %2
%4 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0
%5 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 1
%6 = load i64, i64* %5
%7 = load [2 x i64]*, [2 x i64]** %2
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 2
%9 = getelementptr inbounds [2 x i64], [2 x i64]* %8, i64 0, i64 1
%10 = load i64, i64* %9
%11 = add nsw i64 %6, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @compute2([2 x i64]* nocapture %0) {
%2 = getelementptr inbounds [2 x i64], [2 x i64]* %0, i64 0, i64 1
%3 = load i64, i64* %2
%4 = getelementptr inbounds [2 x i64], [2 x i64]* %0, i64 2, i64 1
%5 = load i64, i64* %4
%6 = add nsw i64 %5, %3
ret i64 %6
}
void check_logfs_je_anchor(void) { ; }


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

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

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

LLVM IR (-O2):
define void @check_logfs_je_anchor() {
ret void
}
int list_comparator_double(const void *a, const void *b) {
  return (*(double *)a < *(double *)b) - (*(double *)a > *(double *)b);
}


x86 assembly (clang, -O0):
<list_comparator_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
movsd  (%rcx),%xmm0
mov    -0x10(%rbp),%rcx
ucomisd (%rcx),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_comparator_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @list_comparator_double(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp olt double %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to double*
%15 = load double, double* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to double*
%18 = load double, double* %17
%19 = fcmp ogt double %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @list_comparator_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp ogt double %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void form_output_back_to_top_button(void) {
  printf("<td><a onClick=\"%s\"><img src=\"/%s/top.png\"></a>\n",
         "window.scrollTo(0,0)", "appaserver/zimages");
}


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

x86 assembly (clang, -O2):
<form_output_back_to_top_button>:
lea    0xee9(%rip),%rdi
lea    0xf13(%rip),%rsi
lea    0xf21(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"<td><a onClick=\22%s\22><img src=\22/%s/top.png\22></a>\0A\00"
@.str.1 = [21 x i8] c"window.scrollTo(0,0)\00"
@.str.2 = [19 x i8] c"appaserver/zimages\00"
define void @form_output_back_to_top_button() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"<td><a onClick=\22%s\22><img src=\22/%s/top.png\22></a>\0A\00"
@.str.1 = [21 x i8] c"window.scrollTo(0,0)\00"
@.str.2 = [19 x i8] c"appaserver/zimages\00"
define void @form_output_back_to_top_button() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void check(int *a, int *res, int len) {
  int i;
  for (i = 0; i < len; i++)
    if (a[i] != res[i])
      abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116c <check+0x5c>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     1159 <check+0x49>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    115e <check+0x4e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <check+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rax
test   %edx,%edx
jle    1131 <check+0x21>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    (%rdi,%rcx,4),%edx
cmp    (%rsi,%rcx,4),%edx
jne    1133 <check+0x23>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1120 <check+0x10>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @check(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %19, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9
%18 = tail call i32 (...) @abort()
unreachable
19: ; preds = %7, %3
ret void
}
/* Variables and functions */
bool chkcir(const double x, const double y) {
  const double x_c = 0.5;
  const double y_c = 0.5;
  const double r = 0.5;
  const double f = (x - x_c) * (x - x_c) + (y - y_c) * (y - y_c) - r * r;
  if (f > 0.0) {
    return false;
  } else {
    return true;
  }
}


x86 assembly (clang, -O0):
<chkcir>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xef2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xeb5(%rip),%xmm1
subsd  %xmm1,%xmm2
movsd  -0x18(%rbp),%xmm1
movsd  0xea4(%rip),%xmm3
subsd  %xmm3,%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  0xe93(%rip),%xmm4
subsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe73(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11b4 <chkcir+0xb4>
movl   $0x0,-0x4(%rbp)
jmp    11bb <chkcir+0xbb>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chkcir>:
movsd  0xef8(%rip),%xmm2
addsd  %xmm2,%xmm0
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
addsd  0xee4(%rip),%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setbe  %al
ret

LLVM IR (-O0):
define i32 @chkcir(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store double 5.000000e-01, double* %6
store double 5.000000e-01, double* %7
store double 5.000000e-01, double* %8
%10 = load double, double* %4
%11 = fsub double %10, 5.000000e-01
%12 = load double, double* %4
%13 = fsub double %12, 5.000000e-01
%14 = load double, double* %5
%15 = fsub double %14, 5.000000e-01
%16 = load double, double* %5
%17 = fsub double %16, 5.000000e-01
%18 = fmul double %15, %17
%19 = call double @llvm.fmuladd.f64(double %11, double %13, double %18)
%20 = fsub double %19, 2.500000e-01
store double %20, double* %9
%21 = load double, double* %9
%22 = fcmp ogt double %21, 0.000000e+00
br i1 %22, label %23, label %24
23: ; preds = %2
store i32 0, i32* %3
br label %25
24: ; preds = %2
store i32 1, i32* %3
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @chkcir(double %0, double %1) {
%3 = fadd double %0, -5.000000e-01
%4 = fadd double %1, -5.000000e-01
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %3, double %3, double %5)
%7 = fadd double %6, -2.500000e-01
%8 = fcmp ule double %7, 0.000000e+00
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
float ceil(float);
float _ceil(float s) { return ceil(s); }


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

x86 assembly (clang, -O2):
<_ceil>:
jmp    1030 <ceilf@plt>

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

LLVM IR (-O2):
define float @_ceil(float %0) {
%2 = tail call float @llvm.ceil.f32(float %0)
ret float %2
}
int IsGoodDate(int iyear, int imonth, int iday) {
  if (iyear >= 1800 && iyear <= 2100 && imonth > 0 && imonth < 13 && iday > 0 &&
      iday < 32)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<IsGoodDate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x708,-0x8(%rbp)
jl     115b <IsGoodDate+0x5b>
cmpl   $0x834,-0x8(%rbp)
jg     115b <IsGoodDate+0x5b>
cmpl   $0x0,-0xc(%rbp)
jle    115b <IsGoodDate+0x5b>
cmpl   $0xd,-0xc(%rbp)
jge    115b <IsGoodDate+0x5b>
cmpl   $0x0,-0x10(%rbp)
jle    115b <IsGoodDate+0x5b>
cmpl   $0x20,-0x10(%rbp)
jge    115b <IsGoodDate+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <IsGoodDate+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsGoodDate>:
add    $0xfffff8f8,%edi
cmp    $0x12d,%edi
setb   %al
add    $0xffffffff,%esi
cmp    $0xc,%esi
setb   %cl
and    %al,%cl
add    $0xffffffff,%edx
cmp    $0x1f,%edx
setb   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @IsGoodDate(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = icmp sge i32 %8, 1800
br i1 %9, label %10, label %26
10: ; preds = %3
%11 = load i32, i32* %5
%12 = icmp sle i32 %11, 2100
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = load i32, i32* %6
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load i32, i32* %6
%18 = icmp slt i32 %17, 13
br i1 %18, label %19, label %26
19: ; preds = %16
%20 = load i32, i32* %7
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i32, i32* %7
%24 = icmp slt i32 %23, 32
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 1, i32* %4
br label %27
26: ; preds = %22, %19, %16, %13, %10, %3
store i32 0, i32* %4
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @IsGoodDate(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, -1800
%5 = icmp ult i32 %4, 301
%6 = add i32 %1, -1
%7 = icmp ult i32 %6, 12
%8 = and i1 %5, %7
%9 = add i32 %2, -1
%10 = icmp ult i32 %9, 31
%11 = and i1 %10, %8
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
ssize_t writev(int fd, const struct iovec *vector, int count) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "writev");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<writev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
lea    0xee3(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writev>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.iovec = type { i32 }
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"writev\00"
define i32 @writev(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.iovec*
%7 = alloca i32
store i32 %0, i32* %5
store %struct.iovec* %1, %struct.iovec** %6
store i32 %2, i32* %7
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @assert(i32 0)
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"writev\00"
define i32 @writev(i32 %0, %struct.iovec* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main() {
  int a = 1;
  foo();
  a += 2;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
char *alloc(int nbytes) {
  char *malloc();
  return (malloc(nbytes));
}


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

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

LLVM IR (-O0):
define i8* @alloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @alloc(i32 %0) {
%2 = tail call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %0)
ret i8* %2
}