xunge/DecIR huggingface dataset:
int argcintlen(int i) {
  int len = 0;
  if (i < 0) {
    len++;
    i = -i;
  }
  do {
    len++;
    i /= 10;
  } while (i);
  return len;
}


x86 assembly (clang, -O0):
<argcintlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1129 <argcintlen+0x29>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112e <argcintlen+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112e <argcintlen+0x2e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<argcintlen>:
mov    %edi,%eax
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
shr    $0x1f,%eax
nopl   0x0(%rax)
add    $0x1,%eax
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    $0x9,%edx
cmp    $0x12,%edx
ja     1110 <argcintlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @argcintlen(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = lshr i32 %0, 31
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ %2, %1 ], [ %8, %4 ]
%6 = phi i32 [ %3, %1 ], [ %7, %4 ]
%7 = add nuw nsw i32 %6, 1
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void SystemFatal(const char *message) {
  perror(message);
  exit(EXIT_FAILURE);
}


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

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

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @SystemFatal(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int __test() {
  int x = 3, y = 4;
  x = y;
  return x;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 4
}
int test_imm_8Fint8_reg(signed char val) {
  return ((val) & (-0x8F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Fint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -143
%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_8Fint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -143
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
bool fspath_child(const char path[]) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @fspath_child(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *convert_int(char *str, int *p) {
  sprintf(str, "%d", *p);
  return str;
}


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

x86 assembly (clang, -O2):
<convert_int>:
push   %rbx
mov    %rdi,%rbx
mov    (%rsi),%edx
lea    0xee3(%rip),%rsi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @convert_int(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @convert_int(i8* returned writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_moveto() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_moveto>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @caml_gr_moveto() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_moveto() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
void glmGenerateScaleMatrix2d(double m[4], const double s[2]) {
  m[0] = s[0];
  m[2] = 0;
  m[1] = 0;
  m[3] = s[1];
}


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

x86 assembly (clang, -O2):
<glmGenerateScaleMatrix2d>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x18(%rdi)
ret

LLVM IR (-O0):
define void @glmGenerateScaleMatrix2d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 2
store double 0.000000e+00, double* %11
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 1
store double 0.000000e+00, double* %13
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 3
store double %16, double* %18
ret void
}

LLVM IR (-O2):
define void @glmGenerateScaleMatrix2d(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = bitcast double* %4 to i8*
%7 = load double, double* %5
%8 = getelementptr inbounds double, double* %0, i64 3
store double %7, double* %8
ret void
}
read_color_table(file_name, rgb, size) char *file_name;
struct ctstruct *rgb;
int size;
{}


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

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

LLVM IR (-O0):
%struct.ctstruct = type opaque
define i32 @read_color_table(i8* %0, %struct.ctstruct* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.ctstruct*
%7 = alloca i32
store i8* %0, i8** %5
store %struct.ctstruct* %1, %struct.ctstruct** %6
store i32 %2, i32* %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct.ctstruct = type opaque
define i32 @read_color_table(i8* nocapture readnone %0, %struct.ctstruct* nocapture readnone %1, i32 %2) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *applet(char *const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *f, char *const arg0) {
  fprintf(f,
          "Usage: %s [OPTIONS] [--] PATH [ARGV...]\n\n"
          "Options:\n"
          " -v or --verbose        Turn on verbose messages.\n"
          " -D or --debug          Turn on debug messages.\n"
          " -h or --help           Display this message.\n"
          " -V or --version        Display the version.\n"
          "",
          applet(arg0));
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <applet@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <applet@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [240 x i8] c"Usage: %s [OPTIONS] [--] PATH [ARGV...]\0A\0AOptions:\0A -v or --verbose Turn on verbose messages.\0A -D or --debug Turn on debug messages.\0A -h or --help Display this message.\0A -V or --version Display the version.\0A\00"
define void @usage(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 i8*, i8** %4
%7 = call i8* @applet(i8* %6)
%8 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([240 x i8], [240 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [240 x i8] c"Usage: %s [OPTIONS] [--] PATH [ARGV...]\0A\0AOptions:\0A -v or --verbose Turn on verbose messages.\0A -D or --debug Turn on debug messages.\0A -h or --help Display this message.\0A -V or --version Display the version.\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i8* @applet(i8* %1)
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([240 x i8], [240 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ prints(char *);
main() {
  prints("\033 8\033~0");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <prints@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <prints@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B 8\1B~0\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @prints(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B 8\1B~0\00"
define i32 @main() {
%1 = tail call i32 @prints(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
char getchar();
void input(char *txt) {
  char tmp;
  while ((tmp = getchar()) != '\n')
    *txt++ = tmp;
  *txt = 0;
}


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     114b <input+0x3b>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111c <input+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1133 <input+0x23>
mov    %al,(%rbx)
add    $0x1,%rbx
jmp    1120 <input+0x10>
movb   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @input(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %8, %1
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i8, i8* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
store i8 %9, i8* %10
br label %4
12: ; preds = %4
%13 = load i8*, i8** %2
store i8 0, i8* %13
ret void
}

LLVM IR (-O2):
define void @input(i8* nocapture writeonly %0) {
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %8, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %5, i8* %6
%8 = tail call signext i8 (...) @getchar()
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i8* [ %0, %1 ], [ %7, %4 ]
store i8 0, i8* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ldtest1(char *);
int /*<<< orphan*/ ldtest2(char *);
int main() {
  ldtest1("Hello world!");
  ldtest2("Hello world!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @ldtest1(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ldtest2(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __lsan_disable();
int /*<<< orphan*/ __lsan_enable();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
void *malloc(int);
int /*<<< orphan*/ stderr;
int main() {
  void **p;
  {
    __lsan_disable();
    p = malloc(sizeof(void *));
    __lsan_enable();
  }
  *p = malloc(666);
  void *q = malloc(1337);
  fprintf(stderr, "Test alloc: %p.\n", q);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__lsan_disable@plt>
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <__lsan_enable@plt>
mov    $0x29a,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x539,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe5f(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <__lsan_disable@plt>
xor    %eax,%eax
call   1060 <__lsan_enable@plt>
mov    $0x539,%edi
call   1040 <malloc@plt>
mov    0x2e80(%rip),%rcx
mov    (%rcx),%edi
lea    0xe97(%rip),%rsi
mov    %rax,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Test alloc: %p.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8**
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 (...) @__lsan_disable()
%5 = call i8* @malloc(i32 8)
%6 = bitcast i8* %5 to i8**
store i8** %6, i8*** %2
%7 = call i32 (...) @__lsan_enable()
%8 = call i8* @malloc(i32 666)
%9 = load i8**, i8*** %2
store i8* %8, i8** %9
%10 = call i8* @malloc(i32 1337)
store i8* %10, i8** %3
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Test alloc: %p.\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @__lsan_disable()
%2 = tail call i32 (...) @__lsan_enable()
%3 = tail call dereferenceable_or_null(1337) i8* @malloc(i32 1337)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setCursor();
void showCursor() { setCursor(); }


x86 assembly (clang, -O0):
<showCursor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <setCursor@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @showCursor() {
%1 = call i32 (...) @setCursor()
ret void
}

LLVM IR (-O2):
define void @showCursor() {
%1 = tail call i32 (...) @setCursor()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void outch(char c) { putchar(c); }


x86 assembly (clang, -O0):
<outch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outch>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @outch(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
ret void
}
int f2(int i) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ DMA10_DMA26_DriverIRQHandler();
__attribute__((weak)) void DMA10_DMA26_IRQHandler(void) {
  DMA10_DMA26_DriverIRQHandler();
}


x86 assembly (clang, -O0):
<DMA10_DMA26_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DMA10_DMA26_DriverIRQHandler@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define weak void @DMA10_DMA26_IRQHandler() {
%1 = call i32 (...) @DMA10_DMA26_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA10_DMA26_IRQHandler() {
%1 = tail call i32 (...) @DMA10_DMA26_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x4e() {
  Assert_real((isxdigit(78) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              395, ("isxdigit should be 0 for N"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x4e>:
push   %rax
mov    $0x4e,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x18b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for N\00"
define void @t_isxdigit_0x4e() {
%1 = tail call i64 @isxdigit(i32 78)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 395, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat_s(char *, int /*<<< orphan*/, char const *);
int /*<<< orphan*/ strlen(char const *);
char *platform_strcat(char *dest, const char *src) {
  strcat_s(dest, strlen(src), src);
  return dest;
}


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

x86 assembly (clang, -O2):
<platform_strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <strcat_s@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @platform_strcat(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 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @strcat_s(i8* %5, i32 %7, i8* %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @platform_strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strcat_s(i8* %0, i32 %3, i8* %1)
ret i8* %0
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t _strlen(char *Str) {
  uint32_t Len = 0;
  for (int ii = 0; Str[ii] != 0; ++ii) {
    Len++;
  }
  return Len;
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1146 <_strlen+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <_strlen+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen>:
cmpb   $0x0,(%rdi)
je     111f <_strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i64 [ 0, %1 ], [ %8, %6 ]
ret i64 %5
6: ; preds = %1, %6
%7 = phi i64 [ %8, %6 ], [ 0, %1 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %4, label %6
}
void grwter(fd, cbuf, lbuf, cbuf_len) int *fd;
char *cbuf;
int *lbuf;
int cbuf_len;
{
  int nwritten = write(*fd, cbuf, *lbuf);
  if (nwritten != *lbuf)
    perror("Error writing to graphics device");
  *lbuf = 0;
  return;
}


x86 assembly (clang, -O0):
<grwter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
je     116e <grwter+0x4e>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <perror@plt>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grwter>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
mov    (%rdx),%edx
xor    %eax,%eax
call   1030 <write@plt>
cmp    (%rbx),%eax
je     1141 <grwter+0x21>
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <perror@plt>
movl   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Error writing to graphics device\00"
define void @grwter(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = load i8*, i8** %6
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %11, i8* %12, i32 %14)
store i32 %15, i32* %9
%16 = load i32, i32* %9
%17 = load i32*, i32** %7
%18 = load i32, i32* %17
%19 = icmp ne i32 %16, %18
br i1 %19, label %20, label %22
20: ; preds = %4
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %4
%23 = load i32*, i32** %7
store i32 0, i32* %23
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Error writing to graphics device\00"
define void @grwter(i32* nocapture %0, i8* %1, i32* nocapture %2, i32 %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %5, i8* %1, i32 %6)
%8 = load i32, i32* %2
%9 = icmp eq i32 %7, %8
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %4
store i32 0, i32* %2
ret void
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, unsigned int, int);
int i2c_read_word_data(int pi, unsigned handle, unsigned reg) {
  return pigpio_command(pi, 63, handle, reg, 1);
}


x86 assembly (clang, -O0):
<i2c_read_word_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x3f,%esi
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_read_word_data>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x3f,%esi
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @i2c_read_word_data(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @pigpio_command(i32 %7, i32 63, i32 %8, i32 %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @i2c_read_word_data(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pigpio_command(i32 %0, i32 63, i32 %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, double, double, double, double, double);
int main() {
  foo(3, 1.0, 2.0, 3.0, 4.0, 5.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
movsd  0xed4(%rip),%xmm0
movsd  0xed4(%rip),%xmm1
movsd  0xed4(%rip),%xmm2
movsd  0xed4(%rip),%xmm3
movsd  0xed4(%rip),%xmm4
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
movsd  0xee7(%rip),%xmm2
movsd  0xee7(%rip),%xmm3
movsd  0xee7(%rip),%xmm4
mov    $0x3,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 3, double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 3, double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00)
ret i32 0
}
/* Variables and functions */
char *getptr(char *, char *);
int strtol(char *, char **, int);
int getptrint(char *s, char *id, int base) {
  char *c;
  c = getptr(s, id);
  if (!c)
    return (0);
  return (strtol(c, (char **)NULL, base));
}


x86 assembly (clang, -O0):
<getptrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <getptr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115b <getptrint+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    116e <getptrint+0x4e>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtol@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getptrint>:
push   %rbx
mov    %edx,%ebx
call   1030 <getptr@plt>
test   %rax,%rax
je     113a <getptrint+0x1a>
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <strtol@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getptrint(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i8* @getptr(i8* %9, i8* %10)
store i8* %11, i8** %8
%12 = load i8*, i8** %8
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %3
store i32 0, i32* %4
br label %19
15: ; preds = %3
%16 = load i8*, i8** %8
%17 = load i32, i32* %7
%18 = call i32 @strtol(i8* %16, i8** null, i32 %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %15, %14
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @getptrint(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @getptr(i8* %0, i8* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @strtol(i8* nocapture %4, i8** null, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
double DSlater_3S_6S(double, double, double);
double DSlater_6S_3S(double rij, double xii, double xij) {
  return DSlater_3S_6S(rij, xij, xii);
}


x86 assembly (clang, -O0):
<DSlater_6S_3S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <DSlater_3S_6S@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSlater_6S_3S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <DSlater_3S_6S@plt>

LLVM IR (-O0):
define double @DSlater_6S_3S(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* %6
%9 = load double, double* %5
%10 = call double @DSlater_3S_6S(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @DSlater_6S_3S(double %0, double %1, double %2) {
%4 = tail call double @DSlater_3S_6S(double %0, double %2, double %1)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void USB_EndPoint11(uint32_t event) {}


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

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

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

LLVM IR (-O2):
define void @USB_EndPoint11(i32 %0) {
ret void
}
char marca(int i) {
  switch (i) {
  case 1:
    return 'X';
  case 0:
    return ' ';
  case -1:
    return 'O';
  default:
    return ' ';
  }
}


x86 assembly (clang, -O0):
<marca>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xffffffff,%eax
je     114e <marca+0x4e>
jmp    111b <marca+0x1b>
mov    -0xc(%rbp),%eax
test   %eax,%eax
je     1145 <marca+0x45>
jmp    112b <marca+0x2b>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
jne    1157 <marca+0x57>
jmp    113c <marca+0x3c>
movb   $0x58,-0x1(%rbp)
jmp    115b <marca+0x5b>
movb   $0x20,-0x1(%rbp)
jmp    115b <marca+0x5b>
movb   $0x4f,-0x1(%rbp)
jmp    115b <marca+0x5b>
movb   $0x20,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<marca>:
lea    0x8(,%rdi,8),%ecx
mov    %edi,%eax
add    $0x1,%eax
mov    $0x58204f,%edx
shr    %cl,%edx
cmp    $0x3,%eax
mov    $0x20,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @marca(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 1, label %5
i32 0, label %6
i32 -1, label %7
]
5: ; preds = %1
store i8 88, i8* %2
br label %9
6: ; preds = %1
store i8 32, i8* %2
br label %9
7: ; preds = %1
store i8 79, i8* %2
br label %9
8: ; preds = %1
store i8 32, i8* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @marca(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 3
%4 = trunc i32 %2 to i24
%5 = shl i24 %4, 3
%6 = lshr i24 5775439, %5
%7 = trunc i24 %6 to i8
%8 = select i1 %3, i8 %7, i8 32
ret i8 %8
}
void signal_chld(int signo) {}


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

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

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

LLVM IR (-O2):
define void @signal_chld(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void version() {
  printf("cdisk version %d.%d\n", 1, 0);
  printf("Disk image partitioner\n");
  printf("Written by John Detter <jdetter@wisc.edu>\n\n");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"cdisk version %d.%d\0A\00"
@.str.1 = [24 x i8] c"Disk image partitioner\0A\00"
@.str.2 = [44 x i8] c"Written by John Detter <jdetter@wisc.edu>\0A\0A\00"
define void @version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 1, i32 0)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"cdisk version %d.%d\0A\00"
@str = [23 x i8] c"Disk image partitioner\00"
@str.3 = [43 x i8] c"Written by John Detter <jdetter@wisc.edu>\0A\00"
define void @version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 1, i32 0)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ errAbort(char *, char *);
double strtod(char *, char **);
double sqlDouble(char *s) {
  char *end;
  double val = strtod(s, &end);
  if ((end == s) || (*end != '\0'))
    errAbort("invalid double: %s", s);
  return val;
}


x86 assembly (clang, -O0):
<sqlDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     115c <sqlDouble+0x3c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116c <sqlDouble+0x4c>
mov    -0x8(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1040 <errAbort@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlDouble>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <strtod@plt>
mov    0x8(%rsp),%rax
cmp    %rbx,%rax
je     1141 <sqlDouble+0x21>
cmpb   $0x0,(%rax)
je     115a <sqlDouble+0x3a>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
movsd  %xmm0,(%rsp)
call   1040 <errAbort@plt>
movsd  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"invalid double: %s\00"
define double @sqlDouble(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call double @strtod(i8* %5, i8** %3)
store double %6, double* %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = icmp eq i8* %7, %8
br i1 %9, label %15, label %10
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10, %1
%16 = load i8*, i8** %2
%17 = call i32 @errAbort(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %15, %10
%19 = load double, double* %4
ret double %19
}

LLVM IR (-O2):
@.str = [19 x i8] c"invalid double: %s\00"
define double @sqlDouble(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call double @strtod(i8* %0, i8** %2)
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, %0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7, %1
%11 = tail call i32 @errAbort(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %12
12: ; preds = %10, %7
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("usage: build_filelist filelist path\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"usage: build_filelist filelist path\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [36 x i8] c"usage: build_filelist filelist path\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float x, y;
  int i, j;
  x = 1.5;
  y = 2.0;
  i = 2;
  j = 3;
  x = x * y + i / j;
  printf("%f", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cvtsi2ss %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store float 1.500000e+00, float* %2
store float 2.000000e+00, float* %3
store i32 2, i32* %4
store i32 3, i32* %5
%6 = load float, float* %2
%7 = load float, float* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sdiv i32 %8, %9
%11 = sitofp i32 %10 to float
%12 = call float @llvm.fmuladd.f32(float %6, float %7, float %11)
store float %12, float* %2
%13 = load float, float* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float 3.000000e+00)
ret i32 0
}
int fun406() { return 406; }


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

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

LLVM IR (-O0):
define i32 @fun406() {
ret i32 406
}

LLVM IR (-O2):
define i32 @fun406() {
ret i32 406
}
/* Variables and functions */
double sqrt(double);
double func(double x, double y, double z) {
  double c = .4 - sqrt(x * x + y * y);
  return c * c + z * z - .04;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe80(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112d <func+0x1d>
sqrtsd %xmm0,%xmm0
jmp    113c <func+0x2c>
movsd  %xmm2,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm2
movsd  0xebc(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
addsd  0xeac(%rip),%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @func(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %4
%10 = load double, double* %5
%11 = load double, double* %5
%12 = fmul double %10, %11
%13 = call double @llvm.fmuladd.f64(double %8, double %9, double %12)
%14 = call double @sqrt(double %13)
%15 = fsub double 4.000000e-01, %14
store double %15, double* %7
%16 = load double, double* %7
%17 = load double, double* %7
%18 = load double, double* %6
%19 = load double, double* %6
%20 = fmul double %18, %19
%21 = call double @llvm.fmuladd.f64(double %16, double %17, double %20)
%22 = fsub double %21, 4.000000e-02
ret double %22
}

LLVM IR (-O2):
define double @func(double %0, double %1, double %2) {
%4 = fmul double %1, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = tail call double @sqrt(double %5)
%7 = fsub double 4.000000e-01, %6
%8 = fmul double %2, %2
%9 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %8)
%10 = fadd double %9, -4.000000e-02
ret double %10
}
void gdk_screen_broadcast_client_message() {}


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

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

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

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

/* Variables and functions */
uint32_t get_cog_pc(int cog) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_cog_pc(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ transmit_byte_via_SPI(int, int);
void V3A_FinishFWRingBufDownload(void) {
  transmit_byte_via_SPI(((0x65E0) + 0x14), 1);
}


x86 assembly (clang, -O0):
<V3A_FinishFWRingBufDownload>:
push   %rbp
mov    %rsp,%rbp
mov    $0x65f4,%edi
mov    $0x1,%esi
call   1030 <transmit_byte_via_SPI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<V3A_FinishFWRingBufDownload>:
mov    $0x65f4,%edi
mov    $0x1,%esi
jmp    1030 <transmit_byte_via_SPI@plt>

LLVM IR (-O0):
define void @V3A_FinishFWRingBufDownload() {
%1 = call i32 @transmit_byte_via_SPI(i32 26100, i32 1)
ret void
}

LLVM IR (-O2):
define void @V3A_FinishFWRingBufDownload() {
%1 = tail call i32 @transmit_byte_via_SPI(i32 26100, i32 1)
ret void
}