xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ xlfail(char *);
void checkfneg(float farg) {
  if (farg < 0.0)
    xlfail("square root of a negative number");
}


x86 assembly (clang, -O0):
<checkfneg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    113f <checkfneg+0x2f>
lea    0xec6(%rip),%rdi
call   1030 <xlfail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkfneg>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1124 <checkfneg+0x14>
lea    0xee1(%rip),%rdi
jmp    1030 <xlfail@plt>
ret

LLVM IR (-O0):
@.str = [33 x i8] c"square root of a negative number\00"
define void @checkfneg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @xlfail(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"square root of a negative number\00"
define void @checkfneg(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @xlfail(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
int fn1(int x) { return x + (x & 1); }


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

x86 assembly (clang, -O2):
<fn1>:
mov    %edi,%eax
and    $0x1,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @fn1(i32 %0) {
%2 = and i32 %0, 1
%3 = add nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cutItem(char *, char *, char, int /*<<< orphan*/);
int /*<<< orphan*/ memmove(char *, scalar_t__, scalar_t__);
scalar_t__ strchr(char *, char);
scalar_t__ strlen(char *);
void cutChunk(char *in, char *s1) {
  cutItem(in, s1, '=', 0);
  memmove(in, strchr(in, '=') + 1, strlen(in) - strlen(s1));
}


x86 assembly (clang, -O0):
<cutChunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3d,%edx
xor    %ecx,%ecx
call   1060 <cutItem@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
sub    %rax,%rdx
call   1050 <memmove@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutChunk>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
mov    $0x3d,%edx
xor    %ecx,%ecx
call   1060 <cutItem@plt>
mov    %r12,%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
lea    0x1(%rax),%r15
mov    %r12,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
sub    %rax,%rbx
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1050 <memmove@plt>

LLVM IR (-O0):
define void @cutChunk(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 @cutItem(i8* %5, i8* %6, i8 signext 61, i32 0)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i64 @strchr(i8* %9, i8 signext 61)
%11 = add nsw i64 %10, 1
%12 = load i8*, i8** %3
%13 = call i64 @strlen(i8* %12)
%14 = load i8*, i8** %4
%15 = call i64 @strlen(i8* %14)
%16 = sub nsw i64 %13, %15
%17 = call i32 @memmove(i8* %8, i64 %11, i64 %16)
ret void
}

LLVM IR (-O2):
define void @cutChunk(i8* %0, i8* %1) {
%3 = tail call i32 @cutItem(i8* %0, i8* %1, i8 signext 61, i32 0)
%4 = tail call i64 @strchr(i8* %0, i8 signext 61)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%8 = sub nsw i64 %6, %7
%9 = tail call i32 @memmove(i8* %0, i64 %5, i64 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int count, max;
  count = 0;
  max = 1000000;
  while (count <= max) {
    printf("testword,");
    count = count + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xf4240,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1153 <main+0x43>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xf4241,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"testword,\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000001
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
scalar_t__ atoi(char *);
int /*<<< orphan*/ build_table(double);
int /*<<< orphan*/ dump_table();
int main(int argc, char **argv) {
  build_table((double)atoi(argv[1]));
  dump_table();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
cvtsi2sd %rax,%xmm0
call   1030 <build_table@plt>
mov    $0x0,%al
call   1040 <dump_table@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
cvtsi2sd %rax,%xmm0
call   1030 <build_table@plt>
xor    %eax,%eax
call   1040 <dump_table@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i64 @atoi(i8* %7)
%9 = sitofp i64 %8 to double
%10 = call i32 @build_table(double %9)
%11 = call i32 (...) @dump_table()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @atoi(i8* %4)
%6 = sitofp i64 %5 to double
%7 = tail call i32 @build_table(double %6)
%8 = tail call i32 (...) @dump_table()
ret i32 0
}
int mm_load_plugin(int mid, int (*module_init)(void),
                   unsigned char bCoreFirst) {
  return 0;
}


x86 assembly (clang, -O0):
<mm_load_plugin>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mm_load_plugin(i32 %0, i32 ()* %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32 ()*
%6 = alloca i8
store i32 %0, i32* %4
store i32 ()* %1, i32 ()** %5
store i8 %2, i8* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @mm_load_plugin(i32 %0, i32 ()* nocapture readnone %1, i8 zeroext %2) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void UARTDisableSIR(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000030))) &=
      ~(0x00000002 | 0x00000004);
}


x86 assembly (clang, -O0):
<UARTDisableSIR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffff9,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDisableSIR>:
movslq %edi,%rax
andl   $0xfffffff9,0x30(%rax)
ret

LLVM IR (-O0):
define void @UARTDisableSIR(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 48
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -7
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @UARTDisableSIR(i32 %0) {
%2 = add nsw i32 %0, 48
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -7
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fsqrt(void) {
  put8(0xD9);
  put8(0xFA);
}


x86 assembly (clang, -O0):
<fsqrt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    $0xfa,%edi
call   1030 <put8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsqrt>:
push   %rax
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    $0xfa,%edi
pop    %rax
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fsqrt() {
%1 = call i32 @put8(i32 217)
%2 = call i32 @put8(i32 250)
ret void
}

LLVM IR (-O2):
define void @fsqrt() {
%1 = tail call i32 @put8(i32 217)
%2 = tail call i32 @put8(i32 250)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "usage: lastcomm [-EScesu] [-f file] [+format] [command ...] "
                "[user ...] [terminal ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [87 x i8] c"usage: lastcomm [-EScesu] [-f file] [+format] [command ...] [user ...] [terminal ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [87 x i8] c"usage: lastcomm [-EScesu] [-f file] [+format] [command ...] [user ...] [terminal ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int simple_compare(const void *a, const void *b) { return a == b; }


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

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

LLVM IR (-O0):
define i32 @simple_compare(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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @simple_compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *script_config_get_xml_filename();
scalar_t__ stat(char *, struct stat *);
int script_repo_file_exists() {
  char *filename;
  int rc;
  struct stat st;
  filename = script_config_get_xml_filename();
  if (!filename)
    return 0;
  rc = 0;
  if (stat(filename, &st) == 0)
    rc = 1;
  free(filename);
  return rc;
}


x86 assembly (clang, -O0):
<script_repo_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <script_config_get_xml_filename@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115a <script_repo_file_exists+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    118e <script_repo_file_exists+0x5e>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    117f <script_repo_file_exists+0x4f>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_repo_file_exists>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <script_config_get_xml_filename@plt>
test   %rax,%rax
je     1160 <script_repo_file_exists+0x30>
mov    %rax,%r14
mov    %rsp,%rsi
mov    %rax,%rdi
call   1040 <stat@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %r14,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @script_repo_file_exists() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.stat
%5 = call i8* (...) @script_config_get_xml_filename()
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %0
store i32 0, i32* %1
br label %18
9: ; preds = %0
store i32 0, i32* %3
%10 = load i8*, i8** %2
%11 = call i64 @stat(i8* %10, %struct.stat* %4)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %3
br label %14
14: ; preds = %13, %9
%15 = load i8*, i8** %2
%16 = call i32 @free(i8* %15)
%17 = load i32, i32* %3
store i32 %17, i32* %1
br label %18
18: ; preds = %14, %8
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @script_repo_file_exists() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = tail call i8* (...) @script_config_get_xml_filename()
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %0
%6 = call i64 @stat(i8* %3, %struct.stat* %1)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @free(i8* %3)
br label %10
10: ; preds = %0, %5
%11 = phi i32 [ %8, %5 ], [ 0, %0 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
void keyboard(unsigned char key, int x, int y) {
  switch (key) {
  case 'q':
  case 27:
    exit(0);
    break;
  default:
    break;
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1b,%eax
je     115a <keyboard+0x3a>
jmp    1149 <keyboard+0x29>
mov    -0x10(%rbp),%eax
sub    $0x71,%eax
jne    1161 <keyboard+0x41>
jmp    115a <keyboard+0x3a>
xor    %edi,%edi
call   1040 <exit@plt>
jmp    1166 <keyboard+0x46>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
cmp    $0x71,%dil
je     1133 <keyboard+0x13>
cmp    $0x1b,%dil
je     1133 <keyboard+0x13>
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 113, label %9
i32 27, label %9
]
9: ; preds = %3, %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
br label %12
12: ; preds = %11
%13 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %6 [
i8 113, label %4
i8 27, label %4
]
4: ; preds = %3, %3
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %3
%7 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
float sqrt(float);
void main() {
  float num;
  float raiz;
  printf("Escreva um numero: ");
  scanf("%f", &num);
  raiz = sqrt(num);
  printf("O maior numero menor ou igual a raiz do numero informado é %d \n",
         ((int)raiz));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
call   1050 <sqrt@plt>
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1164 <main+0x34>
sqrtss %xmm0,%xmm0
jmp    1169 <main+0x39>
call   1050 <sqrt@plt>
cvttss2si %xmm0,%esi
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Escreva um numero: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [65 x i8] c"O maior numero menor ou igual a raiz do numero informado \C3\A9 %d \0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call float @sqrt(float %5)
store float %6, float* %2
%7 = load float, float* %2
%8 = fptosi float %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Escreva um numero: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [65 x i8] c"O maior numero menor ou igual a raiz do numero informado \C3\A9 %d \0A\00"
define void @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call float @sqrt(float %5)
%7 = fptosi float %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("USAGE: eie <command> [arguments]\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_usage>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"USAGE: eie <command> [arguments]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"USAGE: eie <command> [arguments]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void endItFunVerbose() { printf("\n"); }


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

x86 assembly (clang, -O2):
<endItFunVerbose>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @endItFunVerbose() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b1_get_byte(unsigned int);
unsigned int b1_get_word(unsigned int);
unsigned int b1_get_slice(unsigned int base, unsigned char *dp) {
  unsigned int len, i;
  len = i = b1_get_word(base);
  while (i-- > 0)
    *dp++ = b1_get_byte(base);
  return len;
}


x86 assembly (clang, -O0):
<b1_get_slice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <b1_get_word@plt>
mov    %eax,-0x18(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
jbe    1171 <b1_get_slice+0x51>
mov    -0x4(%rbp),%edi
call   1040 <b1_get_byte@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    113d <b1_get_slice+0x1d>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b1_get_slice>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %edi,%r12d
call   1030 <b1_get_word@plt>
mov    %eax,%r14d
test   %eax,%eax
je     1154 <b1_get_slice+0x34>
mov    %r14d,%ebx
xor    %ebp,%ebp
nop
mov    %r12d,%edi
call   1040 <b1_get_byte@plt>
mov    %al,(%r15,%rbp,1)
add    $0x1,%rbp
cmp    %ebp,%ebx
jne    1140 <b1_get_slice+0x20>
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @b1_get_slice(i32 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @b1_get_word(i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ %1, %2 ]
%8 = add i32 %6, -1
%9 = tail call i32 @b1_get_byte(i32 %0)
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %10, i8* %7
%12 = icmp eq i32 %8, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(size_t);
double *alloc_dvec(long first, long last) {
  double *v;
  v = (double *)malloc((size_t)((last - first + 1 + 0) * sizeof(double)));
  return v - first + 0;
}


x86 assembly (clang, -O0):
<alloc_dvec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x0,%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_dvec>:
push   %rbx
mov    %rdi,%rbx
sub    %rdi,%rsi
lea    0x8(,%rsi,8),%rdi
call   1030 <malloc@plt>
shl    $0x3,%rbx
sub    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define double* @alloc_dvec(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 0
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = load i64, i64* %3
%16 = sub i64 0, %15
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = getelementptr inbounds double, double* %17, i64 0
ret double* %18
}

LLVM IR (-O2):
define double* @alloc_dvec(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to double*
%8 = sub i64 0, %0
%9 = getelementptr inbounds double, double* %7, i64 %8
ret double* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i, sum = 0;
  i = 1;
loop:
  if (i <= 100) {
    sum = sum + i;
    i++;
    goto loop;
  }
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5050)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_131() {
  Assert_real((isqrt(131) == 11),
              "/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/stdlib/isqrt.c",
              660, ("Integer square root of 131 should be 11"));
}


x86 assembly (clang, -O0):
<t_sqrt_131>:
push   %rbp
mov    %rsp,%rbp
mov    $0x83,%edi
call   1030 <isqrt@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x294,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_131>:
push   %rax
mov    $0x83,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x294,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 131 should be 11\00"
define void @t_sqrt_131() {
%1 = call i32 @isqrt(i32 131)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 660, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 131 should be 11\00"
define void @t_sqrt_131() {
%1 = tail call i32 @isqrt(i32 131)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 660, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void test45_N_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test45_N_targetInit__I() {
ret void
}
/* Variables and functions */
int get_end(int);
int get_start(int);
int get_num_rows(int rank) { return 1 + get_end(rank) - get_start(rank); }


x86 assembly (clang, -O0):
<get_num_rows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <get_end@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_start@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_rows>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <get_end@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <get_start@plt>
sub    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_num_rows(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @get_end(i32 %3)
%5 = add nsw i32 1, %4
%6 = load i32, i32* %2
%7 = call i32 @get_start(i32 %6)
%8 = sub nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_num_rows(i32 %0) {
%2 = tail call i32 @get_end(i32 %0)
%3 = add nsw i32 %2, 1
%4 = tail call i32 @get_start(i32 %0)
%5 = sub i32 %3, %4
ret i32 %5
}
reg0adrx1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (r0 <= (((short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movswl -0x6(%rbp),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movswl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     1144 <reg0adrx1+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <reg0adrx1+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0adrx1>:
movswl %di,%edx
movslq %ecx,%rax
movswl 0xa98ac7(%rax,%rax,1),%ecx
xor    %eax,%eax
cmp    %ecx,%edx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @reg0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = shl i32 %0, 16
%8 = ashr exact i32 %7, 16
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %9
%11 = load i16, i16* %10
%12 = sext i16 %11 to i32
%13 = icmp sle i32 %8, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ Log(char *);
int /*<<< orphan*/ abort();
void Bus() {
  Log("Bus error caused abort");
  abort();
}


x86 assembly (clang, -O0):
<Bus>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <Log@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<Bus>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Bus error caused abort\00"
define void @Bus() {
%1 = call i32 @Log(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"Bus error caused abort\00"
define void @Bus() {
%1 = tail call i32 @Log(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
void ya_getopt_error(const char *optstring, const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @ya_getopt_error(i8* nocapture %0, i8* nocapture %1, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int zkp_send(char *data, int sockfd) {
  if ((int)sizeof(data) > 1024) {
    printf("Warning, size of data (%lu) is greater than %d", sizeof(data),
           1024);
    return (-1);
  }
  printf("Client sending: '%s'\n", data);
  return send(sockfd, data, strlen(data), 0);
}


x86 assembly (clang, -O0):
<zkp_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zkp_send>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <send@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Client sending: '%s'\0A\00"
define i32 @zkp_send(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @send(i32 %7, i8* %8, i32 %10, i32 0)
ret i32 %11
}

LLVM IR (-O2):
@.str = [22 x i8] c"Client sending: '%s'\0A\00"
define i32 @zkp_send(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @send(i32 %1, i8* %0, i32 %4, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cache_sync();
int /*<<< orphan*/ cache_wait(int, int);
int /*<<< orphan*/ l2x0_flush_line(unsigned long);
void l2x0_flush_range(unsigned long start, unsigned long end) {
  start &= ~(32 - 1);
  while (start < end) {
    l2x0_flush_line(start);
    start += 32;
  }
  cache_wait((0xC4200000 + 0x7F0), 1);
  cache_sync();
}


x86 assembly (clang, -O0):
<l2x0_flush_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffffffffffffe0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1174 <l2x0_flush_range+0x44>
mov    -0x8(%rbp),%rdi
call   1030 <l2x0_flush_line@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x8(%rbp)
jmp    114c <l2x0_flush_range+0x1c>
mov    $0xc42007f0,%edi
mov    $0x1,%esi
call   1050 <cache_wait@plt>
mov    $0x0,%al
call   1040 <cache_sync@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l2x0_flush_range>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
and    $0xffffffffffffffe0,%rbx
cmp    %rsi,%rbx
jae    1161 <l2x0_flush_range+0x31>
mov    %rsi,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <l2x0_flush_line@plt>
add    $0x20,%rbx
cmp    %r14,%rbx
jb     1150 <l2x0_flush_range+0x20>
mov    $0xc42007f0,%edi
mov    $0x1,%esi
call   1050 <cache_wait@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cache_sync@plt>

LLVM IR (-O0):
define void @l2x0_flush_range(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = and i64 %5, -32
store i64 %6, i64* %3
br label %7
7: ; preds = %11, %2
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i64, i64* %3
%13 = call i32 @l2x0_flush_line(i64 %12)
%14 = load i64, i64* %3
%15 = add i64 %14, 32
store i64 %15, i64* %3
br label %7
16: ; preds = %7
%17 = call i32 @cache_wait(i32 -1004533776, i32 1)
%18 = call i32 (...) @cache_sync()
ret void
}

LLVM IR (-O2):
define void @l2x0_flush_range(i64 %0, i64 %1) {
%3 = and i64 %0, -32
%4 = icmp ult i64 %3, %1
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ %3, %2 ]
%7 = tail call i32 @l2x0_flush_line(i64 %6)
%8 = add i64 %6, 32
%9 = icmp ult i64 %8, %1
br i1 %9, label %5, label %10
10: ; preds = %5, %2
%11 = tail call i32 @cache_wait(i32 -1004533776, i32 1)
%12 = tail call i32 (...) @cache_sync()
ret void
}
/* Variables and functions */
int rand();
int nrand(int min, int max) {
  int nb;
  nb = (rand() % (max - min + 1)) + min;
  return nb;
}


x86 assembly (clang, -O0):
<nrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nrand(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 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @nrand(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_putline(char *str) {
  while (*str)
    ft_putchar(*str++);
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_putline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <ft_putline+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <ft_putchar@plt>
jmp    111c <ft_putline+0xc>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putline>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_putline+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_putline+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <ft_putchar@plt>

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

LLVM IR (-O2):
define void @ft_putline(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @ft_putchar(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Variables and functions */
double pow(double, double);
int /*<<< orphan*/ printf(char *, double);
main() {
  printf("5 elevado na 4 eh: %0.2f\n", pow(5.0, 4.0));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"5 elevado na 4 eh: %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @pow(double 5.000000e+00, double 4.000000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"5 elevado na 4 eh: %0.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double 6.250000e+02)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void liberaCrucigrama() { printf("Libera la memoria de un crucigrama\n"); }


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

x86 assembly (clang, -O2):
<liberaCrucigrama>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Libera la memoria de un crucigrama\0A\00"
define void @liberaCrucigrama() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"Libera la memoria de un crucigrama\00"
define void @liberaCrucigrama() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
void *fill(void *(*emit)(void *, char), void *arg, int *nchar, int numFillers,
           char filler) {
  while (numFillers-- > 0) {
    arg = emit(arg, filler);
    (*nchar)++;
  }
  return arg;
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
jle    1153 <fill+0x53>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
movsbl -0x1d(%rbp),%esi
call   *%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    111d <fill+0x1d>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
test   %ecx,%ecx
jle    1134 <fill+0x34>
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %rdi,%r15
add    $0x1,%ebx
movsbl %r8b,%ebp
nopl   (%rax)
mov    %rax,%rdi
mov    %ebp,%esi
call   *%r15
addl   $0x1,(%r14)
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <fill+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @fill(i8* (i8*, i8)* nocapture %0, i8* %1, i32* nocapture %2, i32 %3, i8 signext %4) {
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %15
7: ; preds = %5, %7
%8 = phi i8* [ %11, %7 ], [ %1, %5 ]
%9 = phi i32 [ %10, %7 ], [ %3, %5 ]
%10 = add nsw i32 %9, -1
%11 = tail call i8* %0(i8* %8, i8 signext %4)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = icmp ugt i32 %9, 1
br i1 %14, label %7, label %15
15: ; preds = %7, %5
%16 = phi i8* [ %1, %5 ], [ %11, %7 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ insb(unsigned int, void *, unsigned long);
void nsp_multi_read_1(unsigned int BaseAddr, unsigned int Register, void *buf,
                      unsigned long count) {
  insb(BaseAddr + Register, buf, count);
}


x86 assembly (clang, -O0):
<nsp_multi_read_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <insb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsp_multi_read_1>:
add    %esi,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <insb@plt>

LLVM IR (-O0):
define void @nsp_multi_read_1(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add i32 %9, %10
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = call i32 @insb(i32 %11, i8* %12, i64 %13)
ret void
}

LLVM IR (-O2):
define void @nsp_multi_read_1(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = add i32 %1, %0
%6 = tail call i32 @insb(i32 %5, i8* %2, i64 %3)
ret void
}
void ffinit_() {}


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

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

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

LLVM IR (-O2):
define void @ffinit_() {
ret void
}