xunge/DecIR huggingface dataset:
/* Variables and functions */
int number_range(int, int);
unsigned char chance(int num) {
  if (number_range(1, 100) <= num)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<chance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x64,%esi
call   1030 <number_range@plt>
cmp    -0x8(%rbp),%eax
jg     113c <chance+0x2c>
movb   $0x1,-0x1(%rbp)
jmp    1140 <chance+0x30>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chance>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
mov    $0x64,%esi
call   1030 <number_range@plt>
cmp    %ebx,%eax
setle  %al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @chance(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @number_range(i32 1, i32 100)
%5 = load i32, i32* %3
%6 = icmp sle i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 1, i8* %2
br label %9
8: ; preds = %1
store i8 0, i8* %2
br label %9
9: ; preds = %8, %7
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @chance(i32 %0) {
%2 = tail call i32 @number_range(i32 1, i32 100)
%3 = icmp sle i32 %2, %0
%4 = zext i1 %3 to i8
ret i8 %4
}
int comp_int(const void *a, const void *b) {
  return (*((int *)a)) > (*((int *)b));
}


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

x86 assembly (clang, -O2):
<comp_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setg   %al
ret

LLVM IR (-O0):
define i32 @comp_int(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 i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @comp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ backchar(int, int);
int isearch(int);
int /*<<< orphan*/ mlerase();
int /*<<< orphan*/ mlwrite(char *);
int risearch(int f, int n) {
  register int status;
  backchar(1, 1);
  if (status = isearch(1))
    mlerase();
  else
    mlwrite("[search failed]");
  return (status);
}


x86 assembly (clang, -O0):
<risearch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
call   1050 <backchar@plt>
mov    $0x1,%edi
call   1040 <isearch@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     117c <risearch+0x3c>
mov    $0x0,%al
call   1060 <mlerase@plt>
jmp    1188 <risearch+0x48>
lea    0xe7d(%rip),%rdi
call   1030 <mlwrite@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<risearch>:
push   %rbx
mov    $0x1,%edi
mov    $0x1,%esi
call   1050 <backchar@plt>
mov    $0x1,%edi
call   1040 <isearch@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1169 <risearch+0x29>
xor    %eax,%eax
call   1060 <mlerase@plt>
jmp    1175 <risearch+0x35>
lea    0xe90(%rip),%rdi
call   1030 <mlwrite@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"[search failed]\00"
define i32 @risearch(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @backchar(i32 1, i32 1)
%7 = call i32 @isearch(i32 1)
store i32 %7, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @mlerase()
br label %13
11: ; preds = %2
%12 = call i32 @mlwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
@.str = [16 x i8] c"[search failed]\00"
define i32 @risearch(i32 %0, i32 %1) {
%3 = tail call i32 @backchar(i32 1, i32 1)
%4 = tail call i32 @isearch(i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @mlerase()
br label %10
8: ; preds = %2
%9 = tail call i32 @mlwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 %4
}
/* Variables and functions */
float __rsind(float);
float r_sind(float *x) { return __rsind(*x); }


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

x86 assembly (clang, -O2):
<r_sind>:
movss  (%rdi),%xmm0
jmp    1030 <__rsind@plt>

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

LLVM IR (-O2):
define float @r_sind(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @__rsind(float %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char **argv) {
  fprintf(stderr, "Usage: %s KEY [INPUT] [OUTPUT]\n", argv[0]);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xecc(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: %s KEY [INPUT] [OUTPUT]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: %s KEY [INPUT] [OUTPUT]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
long GPU_close() { return 0; }


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

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

LLVM IR (-O0):
define i64 @GPU_close() {
ret i64 0
}

LLVM IR (-O2):
define i64 @GPU_close() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ DrawCellsBeginLine();
int /*<<< orphan*/ DrawCellsEndLine();
int /*<<< orphan*/ DrawCellsFromStr(char *);
void DrawCellsKeyCommand(char *k, char *s) {
  DrawCellsBeginLine();
  DrawCellsFromStr("'");
  DrawCellsFromStr(k);
  DrawCellsFromStr("' - ");
  DrawCellsFromStr(s);
  DrawCellsEndLine();
}


x86 assembly (clang, -O0):
<DrawCellsKeyCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <DrawCellsBeginLine@plt>
lea    0xeb2(%rip),%rdi
call   1030 <DrawCellsFromStr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <DrawCellsFromStr@plt>
lea    0xe9f(%rip),%rdi
call   1030 <DrawCellsFromStr@plt>
mov    -0x10(%rbp),%rdi
call   1030 <DrawCellsFromStr@plt>
mov    $0x0,%al
call   1050 <DrawCellsEndLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawCellsKeyCommand>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <DrawCellsBeginLine@plt>
lea    0xeb8(%rip),%rdi
call   1030 <DrawCellsFromStr@plt>
mov    %rbx,%rdi
call   1030 <DrawCellsFromStr@plt>
lea    0xea6(%rip),%rdi
call   1030 <DrawCellsFromStr@plt>
mov    %r14,%rdi
call   1030 <DrawCellsFromStr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <DrawCellsEndLine@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"'\00"
@.str.1 = [5 x i8] c"' - \00"
define void @DrawCellsKeyCommand(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @DrawCellsBeginLine()
%6 = call i32 @DrawCellsFromStr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = call i32 @DrawCellsFromStr(i8* %7)
%9 = call i32 @DrawCellsFromStr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8*, i8** %4
%11 = call i32 @DrawCellsFromStr(i8* %10)
%12 = call i32 (...) @DrawCellsEndLine()
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"'\00"
@.str.1 = [5 x i8] c"' - \00"
define void @DrawCellsKeyCommand(i8* %0, i8* %1) {
%3 = tail call i32 (...) @DrawCellsBeginLine()
%4 = tail call i32 @DrawCellsFromStr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @DrawCellsFromStr(i8* %0)
%6 = tail call i32 @DrawCellsFromStr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @DrawCellsFromStr(i8* %1)
%8 = tail call i32 (...) @DrawCellsEndLine()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void _error_array_bounds() {
  printf("Array index out of bounds");
  exit(-4);
}


x86 assembly (clang, -O0):
<_error_array_bounds>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfffffffc,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_error_array_bounds>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfffffffc,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Array index out of bounds\00"
define void @_error_array_bounds() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -4)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"Array index out of bounds\00"
define void @_error_array_bounds() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -4)
unreachable
}
/* Variables and functions */
short *vrna_pt_ali_get(char const *);
short *alimake_pair_table(const char *structure) {
  return vrna_pt_ali_get(structure);
}


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

x86 assembly (clang, -O2):
<alimake_pair_table>:
jmp    1030 <vrna_pt_ali_get@plt>

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

LLVM IR (-O2):
define i16* @alimake_pair_table(i8* %0) {
%2 = tail call i16* @vrna_pt_ali_get(i8* %0)
ret i16* %2
}
void genbgtz_idle() {}


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

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

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

LLVM IR (-O2):
define void @genbgtz_idle() {
ret void
}
double ho_recognize_font_1_eight(const double *array_in) {
  double return_value = 0.0;
  return return_value;
}


x86 assembly (clang, -O0):
<ho_recognize_font_1_eight>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho_recognize_font_1_eight>:
xorps  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @ho_recognize_font_1_eight(double* nocapture readnone %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int suma, licznik, start, stop;
  suma = 0;
  start = 1;
  stop = 20;
  for (licznik = start; licznik <= stop; licznik++) {
    suma = suma + licznik * licznik;
  }
  printf("Suma kwadratow liczb od %d do %d wynosi %d \n", start, stop, suma);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x14,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1163 <main+0x53>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <main+0x2a>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x14,%edx
mov    $0xb36,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Suma kwadratow liczb od %d do %d wynosi %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %4
store i32 20, i32* %5
%6 = load i32, i32* %4
store i32 %6, i32* %3
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = mul nsw i32 %13, %14
%16 = add nsw i32 %12, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %11
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = load i32, i32* %2
%24 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %22, i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"Suma kwadratow liczb od %d do %d wynosi %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 1, i32 20, i32 2870)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char *arr;
  while (1) {
    fgets(arr, 80, stdin);
    printf("Key: %s \n", arr);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
mov    -0x10(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
lea    0xece(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [10 x i8] c"Key: %s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = load i8*, i8** %2
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 80, i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %3
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [10 x i8] c"Key: %s \0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @stdin
%3 = tail call i32 @fgets(i8* undef, i32 80, i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* undef)
br label %1
}
unsigned outChars(void (*myoutchar)(void *arg, char), void *arg, char ch,
                  int len) {
  unsigned count = 0;
  while (len-- > 0) {
    (*myoutchar)(arg, ch);
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<outChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
jle    114f <outChars+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   *%rax
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111f <outChars+0x1f>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outChars>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %ecx,%ecx
jle    112f <outChars+0x2f>
mov    %ecx,%r14d
mov    %rsi,%r15
mov    %rdi,%r12
movsbl %dl,%ebx
mov    %ecx,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebx,%esi
call   *%r12
add    $0xffffffff,%ebp
jne    1120 <outChars+0x20>
jmp    1132 <outChars+0x32>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @outChars(void (i8*, i8)* nocapture %0, i8* %1, i8 signext %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %10
6: ; preds = %4, %6
%7 = phi i32 [ %8, %6 ], [ 0, %4 ]
tail call void %0(i8* %1, i8 signext %2)
%8 = add nuw nsw i32 %7, 1
%9 = icmp eq i32 %8, %3
br i1 %9, label %10, label %6
10: ; preds = %6, %4
%11 = phi i32 [ 0, %4 ], [ %3, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void raise_error(const char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<raise_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<raise_error>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @raise_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @raise_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ initstate();
int /*<<< orphan*/ makepc();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ resolvestate();
int /*<<< orphan*/ solve();
int main() {
  makepc();
  initstate();
  resolvestate();
  printf("%lld\n", solve());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <makepc@plt>
mov    $0x0,%al
call   1040 <initstate@plt>
mov    $0x0,%al
call   1070 <resolvestate@plt>
mov    $0x0,%al
call   1030 <solve@plt>
mov    %eax,%esi
lea    0xe7c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <makepc@plt>
xor    %eax,%eax
call   1040 <initstate@plt>
xor    %eax,%eax
call   1070 <resolvestate@plt>
xor    %eax,%eax
call   1030 <solve@plt>
lea    0xe8c(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @makepc()
%2 = tail call i32 (...) @initstate()
%3 = tail call i32 (...) @resolvestate()
%4 = tail call i32 (...) @solve()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int test_imm_7Buint8_reg(unsigned char val) {
  return ((val) & (0x7B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Buint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 123
%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_7Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 123
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int multiply(int x, int y) {
  int res = 0;
  while (x != 0) {
    res += y;
    x--;
  }
  return res;
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <multiply+0x32>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <multiply+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @multiply(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ GUI_Control(int, int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void fake_simple_button(int bgmt_code) { GUI_Control(bgmt_code, 0, 0, 0); }


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

x86 assembly (clang, -O2):
<fake_simple_button>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <GUI_Control@plt>

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

LLVM IR (-O2):
define void @fake_simple_button(i32 %0) {
%2 = tail call i32 @GUI_Control(i32 %0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t ret = 0;
  while (str[ret++])
    ;
  return ret;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
cmpb   $0x0,(%rax,%rcx,1)
je     1132 <strlen+0x32>
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %4, %2 ]
%4 = add i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i64 %4
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int os_strcasecmp(const char *str1, const char *str2) {
  return strcasecmp(str1, str2);
}


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

x86 assembly (clang, -O2):
<os_strcasecmp>:
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @os_strcasecmp(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** %4
%7 = call i32 @strcasecmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @os_strcasecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
void *malloc(int);
void *allocate_something_helper2(void) { return malloc(42); }


x86 assembly (clang, -O0):
<allocate_something_helper2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_something_helper2>:
mov    $0x2a,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @allocate_something_helper2() {
%1 = call i8* @malloc(i32 42)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @allocate_something_helper2() {
%1 = tail call dereferenceable_or_null(42) i8* @malloc(i32 42)
ret i8* %1
}
void mt_stats_unlock() {}


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

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

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

LLVM IR (-O2):
define void @mt_stats_unlock() {
ret void
}
int closetonum(int *arr, int len, int num) {}


x86 assembly (clang, -O0):
<closetonum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @closetonum(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* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @closetonum(i32* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/ const);
char *pack_s16(const int16_t *data, char *buffer) {
  *((int16_t *)buffer) = htons(*data);
  return buffer + sizeof(*data);
}


x86 assembly (clang, -O0):
<pack_s16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_s16>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <htons@plt>
mov    %eax,(%rbx)
add    $0x4,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @pack_s16(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = call i32 @htons(i32 %6)
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 4
ret i8* %11
}

LLVM IR (-O2):
define i8* @pack_s16(i32* nocapture %0, i8* writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @htons(i32 %3)
%5 = bitcast i8* %1 to i32*
store i32 %4, i32* %5
%6 = getelementptr inbounds i8, i8* %1, i64 4
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void memory_free(void *ptr, const char *file, int line) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<memory_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <memory_free+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_free>:
test   %rdi,%rdi
je     111a <memory_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @memory_free(i8* %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
unsigned char port_byte_in(unsigned short port) {
  unsigned char result;
  __asm__("in %%dx, %%al" : "=a"(result) : "d"(port));
  return result;
}


x86 assembly (clang, -O0):
<port_byte_in>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_byte_in>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @port_byte_in(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm "in %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @port_byte_in(i16 zeroext %0) {
%2 = tail call i8 asm "in %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ new;
};
struct TYPE_4__ {
  TYPE_1__ xcolormap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xcolormap_new(void *_p) {
  return (int)((XEvent *)_p)->xcolormap.new;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xcolormap_new>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xcolormap_new(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xcolormap_new(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
double computeCircleArea(double);
int computeTriangleArea(double, double, double);
double computeCircumCircleArea(double a, double b, double c) {
  return computeCircleArea(a * b * c / (4 * computeTriangleArea(a, b, c)));
}


x86 assembly (clang, -O0):
<computeCircumCircleArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <computeTriangleArea@plt>
movsd  -0x20(%rbp),%xmm0
shl    $0x2,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
call   1030 <computeCircleArea@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeCircumCircleArea>:
push   %rax
movapd %xmm0,%xmm3
mulsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,(%rsp)
call   1040 <computeTriangleArea@plt>
shl    $0x2,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
jmp    1030 <computeCircleArea@plt>

LLVM IR (-O0):
define double @computeCircumCircleArea(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fmul double %7, %8
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = load double, double* %4
%13 = load double, double* %5
%14 = load double, double* %6
%15 = call i32 @computeTriangleArea(double %12, double %13, double %14)
%16 = mul nsw i32 4, %15
%17 = sitofp i32 %16 to double
%18 = fdiv double %11, %17
%19 = call double @computeCircleArea(double %18)
ret double %19
}

LLVM IR (-O2):
define double @computeCircumCircleArea(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = fmul double %4, %2
%6 = tail call i32 @computeTriangleArea(double %0, double %1, double %2)
%7 = shl nsw i32 %6, 2
%8 = sitofp i32 %7 to double
%9 = fdiv double %5, %8
%10 = tail call double @computeCircleArea(double %9)
ret double %10
}
void flipBit(int bitNum, char *code, int size) {
  if (code[bitNum] > 0) {
    code[bitNum] = 0;
  } else {
    code[bitNum] = 1;
  }
}


x86 assembly (clang, -O0):
<flipBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jle    1134 <flipBit+0x34>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1140 <flipBit+0x40>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<flipBit>:
movslq %edi,%rax
cmpb   $0x0,(%rsi,%rax,1)
setle  (%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @flipBit(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 i8*, i8** %5
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
br label %24
19: ; preds = %3
%20 = load i8*, i8** %5
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 1, i8* %23
br label %24
24: ; preds = %19, %14
ret void
}

LLVM IR (-O2):
define void @flipBit(i32 %0, i8* nocapture %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = icmp slt i8 %6, 1
%8 = zext i1 %7 to i8
store i8 %8, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ disp_files(int, char **);
int /*<<< orphan*/ disp_stdin();
int main(int argc, char **argv) {
  if (argc < 2 || argv[1][0] == '-')
    disp_stdin();
  disp_files(argc, argv);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1154 <main+0x34>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    115b <main+0x3b>
mov    $0x0,%al
call   1040 <disp_stdin@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <disp_files@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x2,%edi
jl     1136 <main+0x16>
mov    0x8(%rbx),%rax
cmpb   $0x2d,(%rax)
jne    113d <main+0x1d>
xor    %eax,%eax
call   1040 <disp_stdin@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <disp_files@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 45
br i1 %8, label %9, label %11
9: ; preds = %4, %2
%10 = tail call i32 (...) @disp_stdin()
br label %11
11: ; preds = %9, %4
%12 = tail call i32 @disp_files(i32 %0, i8** %1)
ret i32 0
}
int imedian_ordered(const int *v, int len) {
  int rank = len / 2;
  return v[rank];
}


x86 assembly (clang, -O0):
<imedian_ordered>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imedian_ordered>:
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
cltq
mov    (%rdi,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @imedian_ordered(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SetNextConstruct(struct constructHeader *,
                                    struct constructHeader *);
void SetNextDefclass(void *theClass, void *targetClass) {
  SetNextConstruct((struct constructHeader *)theClass,
                   (struct constructHeader *)targetClass);
}


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

x86 assembly (clang, -O2):
<SetNextDefclass>:
jmp    1030 <SetNextConstruct@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define void @SetNextDefclass(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 %struct.constructHeader*
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to %struct.constructHeader*
%9 = call i32 @SetNextConstruct(%struct.constructHeader* %6, %struct.constructHeader* %8)
ret void
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define void @SetNextDefclass(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to %struct.constructHeader*
%4 = bitcast i8* %1 to %struct.constructHeader*
%5 = tail call i32 @SetNextConstruct(%struct.constructHeader* %3, %struct.constructHeader* %4)
ret void
}
int __str1cmp(char a, char b) {
  unsigned char ua = (unsigned char)a;
  unsigned char ub = (unsigned char)b;
  return ua - ub;
}


x86 assembly (clang, -O0):
<__str1cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x4(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x4(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__str1cmp>:
movzbl %dil,%eax
movzbl %sil,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__str1cmp(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %3
store i8 %7, i8* %5
%8 = load i8, i8* %4
store i8 %8, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = sub nsw i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @__str1cmp(i8 signext %0, i8 signext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(void) {
  for (int i = 0; i < 10; i++)
    foo(i);
  for (int i = 0; i < 10; i++)
    continue;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    116a <main+0x5a>
jmp    115c <main+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x3d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <foo@plt>
mov    $0x1,%edi
call   1030 <foo@plt>
mov    $0x2,%edi
call   1030 <foo@plt>
mov    $0x3,%edi
call   1030 <foo@plt>
mov    $0x4,%edi
call   1030 <foo@plt>
mov    $0x5,%edi
call   1030 <foo@plt>
mov    $0x6,%edi
call   1030 <foo@plt>
mov    $0x7,%edi
call   1030 <foo@plt>
mov    $0x8,%edi
call   1030 <foo@plt>
mov    $0x9,%edi
call   1030 <foo@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 0, i32* %2
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @foo(i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
store i32 0, i32* %3
br label %14
14: ; preds = %18, %13
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 10
br i1 %16, label %17, label %21
17: ; preds = %14
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %14
21: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = tail call i32 @foo(i32 1)
%3 = tail call i32 @foo(i32 2)
%4 = tail call i32 @foo(i32 3)
%5 = tail call i32 @foo(i32 4)
%6 = tail call i32 @foo(i32 5)
%7 = tail call i32 @foo(i32 6)
%8 = tail call i32 @foo(i32 7)
%9 = tail call i32 @foo(i32 8)
%10 = tail call i32 @foo(i32 9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_load_601_rtcl();
void spr_read_601_rtcl(void *opaque, int sprn) { gen_op_load_601_rtcl(); }


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

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

LLVM IR (-O0):
define void @spr_read_601_rtcl(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @gen_op_load_601_rtcl()
ret void
}

LLVM IR (-O2):
define void @spr_read_601_rtcl(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @gen_op_load_601_rtcl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_sinhf();
scalar_t__ sinhf(float);
void test_sinhf(float f) {
  if (sinhf(f) != sinhf(f))
    link_failure_sinhf();
}


x86 assembly (clang, -O0):
<test_sinhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <sinhf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <sinhf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_sinhf+0x3c>
mov    $0x0,%al
call   1030 <link_failure_sinhf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sinhf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1040 <sinhf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1040 <sinhf@plt>
cmp    %rax,%rbx
jne    1149 <test_sinhf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_sinhf@plt>

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

LLVM IR (-O2):
define void @test_sinhf(float %0) {
%2 = tail call i64 @sinhf(float %0)
%3 = tail call i64 @sinhf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_sinhf()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int strcmp(char const *, char *);
int foo(const char *a) { return strcmp(a, "main"); }


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

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"main\00"
define i32 @foo(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}