xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *envp[]) {
  while (1)
    printf("Hello\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
jmp    112a <main+0x1a>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
br label %4
4: ; preds = %3, %4
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ trap(char *);
void trap_ui(void) { trap("undefined instruction"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"undefined instruction\00"
define void @trap_ui() {
%1 = call i32 @trap(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"undefined instruction\00"
define void @trap_ui() {
%1 = tail call i32 @trap(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct libjte_env {
  int dummy;
};

/* Variables and functions */
int jte_add_mapping(struct libjte_env *, char *);
int libjte_add_mapping(struct libjte_env *o, char *arg) {
  int ret;
  ret = jte_add_mapping(o, arg);
  return !ret;
}


x86 assembly (clang, -O0):
<libjte_add_mapping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <jte_add_mapping@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libjte_add_mapping>:
push   %rax
call   1030 <jte_add_mapping@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.libjte_env = type { i32 }
define i32 @libjte_add_mapping(%struct.libjte_env* %0, i8* %1) {
%3 = alloca %struct.libjte_env*
%4 = alloca i8*
%5 = alloca i32
store %struct.libjte_env* %0, %struct.libjte_env** %3
store i8* %1, i8** %4
%6 = load %struct.libjte_env*, %struct.libjte_env** %3
%7 = load i8*, i8** %4
%8 = call i32 @jte_add_mapping(%struct.libjte_env* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.libjte_env = type { i32 }
define i32 @libjte_add_mapping(%struct.libjte_env* %0, i8* %1) {
%3 = tail call i32 @jte_add_mapping(%struct.libjte_env* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cBSL_putch(char const);
unsigned int cBSL_put_cstr(const char *str) {
  unsigned int max = 2048;
  while (*str != '\0') {
    cBSL_putch(*str);
    ++str;
    --max;
    if (max == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<cBSL_put_cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x800,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116f <cBSL_put_cstr+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <cBSL_putch@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    116a <cBSL_put_cstr+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1176 <cBSL_put_cstr+0x66>
jmp    1123 <cBSL_put_cstr+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cBSL_put_cstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%eax
test   %al,%al
je     1141 <cBSL_put_cstr+0x31>
movsbl %al,%edi
call   1030 <cBSL_putch@plt>
add    $0x1,%rbx
cmp    $0x800,%ebx
jne    1120 <cBSL_put_cstr+0x10>
xor    %eax,%eax
jmp    1146 <cBSL_put_cstr+0x36>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @cBSL_put_cstr(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %9, %7 ]
%4 = phi i32 [ 2048, %1 ], [ %10, %7 ]
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = tail call i32 @cBSL_putch(i8 signext %5)
%9 = getelementptr inbounds i8, i8* %3, i64 1
%10 = add nsw i32 %4, -1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %2
12: ; preds = %2, %7
%13 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %13
}
/* Variables and functions */
unsigned char flash_readcommand(int);
int /*<<< orphan*/ flash_softwareentry();
int /*<<< orphan*/ flash_softwareexit();
int flash_verify() {
  unsigned char deviceid;
  unsigned char manuid;
  flash_softwareentry();
  manuid = flash_readcommand(0);
  deviceid = flash_readcommand(1);
  flash_softwareexit();
  if ((manuid == 0xBF) && (deviceid == 0xD7)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<flash_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <flash_softwareentry@plt>
xor    %edi,%edi
call   1030 <flash_readcommand@plt>
mov    %al,-0x6(%rbp)
mov    $0x1,%edi
call   1030 <flash_readcommand@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1050 <flash_softwareexit@plt>
movzbl -0x6(%rbp),%eax
cmp    $0xbf,%eax
jne    1187 <flash_verify+0x57>
movzbl -0x5(%rbp),%eax
cmp    $0xd7,%eax
jne    1187 <flash_verify+0x57>
movl   $0x1,-0x4(%rbp)
jmp    118e <flash_verify+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_verify>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <flash_softwareentry@plt>
xor    %edi,%edi
call   1030 <flash_readcommand@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   1030 <flash_readcommand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <flash_softwareexit@plt>
xor    $0xbf,%bpl
xor    $0xd7,%bl
xor    %eax,%eax
or     %bpl,%bl
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @flash_verify() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = call i32 (...) @flash_softwareentry()
%5 = call zeroext i8 @flash_readcommand(i32 0)
store i8 %5, i8* %3
%6 = call zeroext i8 @flash_readcommand(i32 1)
store i8 %6, i8* %2
%7 = call i32 (...) @flash_softwareexit()
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 191
br i1 %10, label %11, label %16
11: ; preds = %0
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 215
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %1
br label %17
16: ; preds = %11, %0
store i32 0, i32* %1
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @flash_verify() {
%1 = tail call i32 (...) @flash_softwareentry()
%2 = tail call zeroext i8 @flash_readcommand(i32 0)
%3 = tail call zeroext i8 @flash_readcommand(i32 1)
%4 = tail call i32 (...) @flash_softwareexit()
%5 = icmp eq i8 %2, -65
%6 = icmp eq i8 %3, -41
%7 = select i1 %5, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ pow(double, double);
int optimal_nside(double lb, double rmax, int np) {
  int nside1 = (int)(16.0 * lb / rmax);
  int nside2 = (int)(pow(0.5 * np, 0.3333333));
  return (((nside1) < (nside2)) ? (nside1) : (nside2));
}


x86 assembly (clang, -O0):
<optimal_nside>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xebd(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea9(%rip),%xmm1
call   1030 <pow@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1176 <optimal_nside+0x66>
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    117c <optimal_nside+0x6c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optimal_nside>:
push   %rbx
mulsd  0xee7(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
mulsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
call   1030 <pow@plt>
cmp    %eax,%ebx
cmovl  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @optimal_nside(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%9 = load double, double* %4
%10 = fmul double 1.600000e+01, %9
%11 = load double, double* %5
%12 = fdiv double %10, %11
%13 = fptosi double %12 to i32
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to double
%16 = fmul double 5.000000e-01, %15
%17 = call i64 @pow(double %16, double 0x3FD55555318ABC87)
%18 = trunc i64 %17 to i32
store i32 %18, i32* %8
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %3
%23 = load i32, i32* %7
br label %26
24: ; preds = %3
%25 = load i32, i32* %8
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ %23, %22 ], [ %25, %24 ]
ret i32 %27
}

LLVM IR (-O2):
define i32 @optimal_nside(double %0, double %1, i32 %2) {
%4 = fmul double %0, 1.600000e+01
%5 = fdiv double %4, %1
%6 = fptosi double %5 to i32
%7 = sitofp i32 %2 to double
%8 = fmul double %7, 5.000000e-01
%9 = tail call i64 @pow(double %8, double 0x3FD55555318ABC87)
%10 = trunc i64 %9 to i32
%11 = icmp slt i32 %6, %10
%12 = select i1 %11, i32 %6, i32 %10
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
char fConsumeChar(FILE *f) { return fgetc(f); }


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

x86 assembly (clang, -O2):
<fConsumeChar>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
define signext i8 @fConsumeChar(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x27() {
  Assert_real((isdigit(39) == 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_isdigit.c",
              200, ("isdigit should be 0 for '"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x27>:
push   %rax
mov    $0x27,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xc8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for '\00"
define void @t_isdigit_0x27() {
%1 = call i64 @isdigit(i32 39)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 200, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for '\00"
define void @t_isdigit_0x27() {
%1 = tail call i64 @isdigit(i32 39)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 200, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TCIFLUSH;
long tcflush(int, int /*<<< orphan*/);
long int portflush(int fd) {
  long int len = 1, n = 0;
  n = 1;
  while (n != 0) {
    n = tcflush(fd, TCIFLUSH);
  }
  return 1;
}


x86 assembly (clang, -O0):
<portflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1158 <portflush+0x48>
mov    -0x4(%rbp),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
mov    %rax,-0x18(%rbp)
jmp    1133 <portflush+0x23>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portflush>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ec3(%rip),%r14
nopl   (%rax)
mov    (%r14),%esi
mov    %ebx,%edi
call   1030 <tcflush@plt>
test   %rax,%rax
jne    1120 <portflush+0x10>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@TCIFLUSH = global i32 0
define i64 @portflush(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = load i32, i32* @TCIFLUSH
%4 = tail call i64 @tcflush(i32 %0, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret i64 1
}
long double fmodl(long double x, long double y) {
  long double res = 0.0L;
  asm volatile("1:\tfprem\n\t"
               "fstsw   %%ax\n\t"
               "sahf\n\t"
               "jp      1b\n\t"
               "fstp    %%st(1)"
               : "=t"(res)
               : "0"(x), "u"(y)
               : "ax", "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<fmodl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldz
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fprem
fstsw  %ax
sahf
jp     111d <fmodl+0x1d>
fstp   %st(1)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodl>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fxch   %st(1)
fprem
fstsw  %ax
sahf
jp     110a <fmodl+0xa>
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
store x86_fp80 0xK00000000000000000000, x86_fp80* %5
%6 = load x86_fp80, x86_fp80* %3
%7 = load x86_fp80, x86_fp80* %4
%8 = call x86_fp80 asm sideeffect "1:\09fprem\0A\09fstsw %ax\0A\09sahf\0A\09jp 1b\0A\09fstp %st(1)", "={st},0,{st(1)},~{ax},~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %6, x86_fp80 %7)
store x86_fp80 %8, x86_fp80* %5
%9 = load x86_fp80, x86_fp80* %5
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 asm sideeffect "1:\09fprem\0A\09fstsw %ax\0A\09sahf\0A\09jp 1b\0A\09fstp %st(1)", "={st},0,{st(1)},~{ax},~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
int XSaveContext() {}


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

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

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

LLVM IR (-O2):
define i32 @XSaveContext() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ luaI_addchar(int /*<<< orphan*/);
int /*<<< orphan*/ luaI_emptybuff();
scalar_t__ luaL_check_number(int);
char *luaL_check_string(int);
int /*<<< orphan*/ lua_pushstring(int /*<<< orphan*/);
void str_rep(void) {
  char *s = luaL_check_string(1);
  int n = (int)luaL_check_number(2);
  luaI_emptybuff();
  while (n-- > 0)
    addstr(s);
  lua_pushstring(luaI_addchar(0));
}


x86 assembly (clang, -O0):
<str_rep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1050 <luaL_check_string@plt>
mov    %rax,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <luaI_emptybuff@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    11ac <str_rep+0x4c>
mov    -0x8(%rbp),%rdi
call   1070 <addstr@plt>
jmp    118a <str_rep+0x2a>
xor    %edi,%edi
call   1060 <luaI_addchar@plt>
mov    %eax,%edi
call   1080 <lua_pushstring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_rep>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%edi
call   1050 <luaL_check_string@plt>
mov    %rax,%r14
mov    $0x2,%edi
call   1030 <luaL_check_number@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <luaI_emptybuff@plt>
test   %ebx,%ebx
jle    11a0 <str_rep+0x40>
add    $0x1,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1070 <addstr@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1190 <str_rep+0x30>
xor    %edi,%edi
call   1060 <luaI_addchar@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1080 <lua_pushstring@plt>

LLVM IR (-O0):
define void @str_rep() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @luaL_check_string(i32 1)
store i8* %3, i8** %1
%4 = call i64 @luaL_check_number(i32 2)
%5 = trunc i64 %4 to i32
store i32 %5, i32* %2
%6 = call i32 (...) @luaI_emptybuff()
br label %7
7: ; preds = %11, %0
%8 = load i32, i32* %2
%9 = add nsw i32 %8, -1
store i32 %9, i32* %2
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %1
%13 = call i32 @addstr(i8* %12)
br label %7
14: ; preds = %7
%15 = call i32 @luaI_addchar(i32 0)
%16 = call i32 @lua_pushstring(i32 %15)
ret void
}

LLVM IR (-O2):
define void @str_rep() {
%1 = tail call i8* @luaL_check_string(i32 1)
%2 = tail call i64 @luaL_check_number(i32 2)
%3 = trunc i64 %2 to i32
%4 = tail call i32 (...) @luaI_emptybuff()
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %11
6: ; preds = %0, %6
%7 = phi i32 [ %8, %6 ], [ %3, %0 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @addstr(i8* %1)
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %0
%12 = tail call i32 @luaI_addchar(i32 0)
%13 = tail call i32 @lua_pushstring(i32 %12)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const, int const, int const, int const);
void print_ip4addr(const uint8_t addr[4]) {
  printf("%u.%u.%u.%u", addr[0], addr[1], addr[2], addr[3]);
}


x86 assembly (clang, -O0):
<print_ip4addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r8d
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ip4addr>:
mov    (%rdi),%esi
mov    0x4(%rdi),%edx
mov    0x8(%rdi),%ecx
mov    0xc(%rdi),%r8d
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%u.%u.%u.%u\00"
define void @print_ip4addr(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6, i32 %8)
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ init_uart(int /*<<< orphan*/, int);
int /*<<< orphan*/ putchar(char);
int main(void) {
  char c;
  init_uart(0, 1);
  for (;;) {
    c = getchar();
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <init_uart@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    114b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <init_uart@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @init_uart(i32 0, i32 1)
br label %4
4: ; preds = %4, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = call i32 @putchar(i8 signext %6)
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @init_uart(i32 0, i32 1)
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = tail call i32 @putchar(i8 signext %3)
br label %2
}
int test_imm_A7uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xA7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A7uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 167
%6 = icmp ne i64 %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_A7uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 167
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *strerror(int errnum) {
  static char buf[16];
  sprintf(buf, "Error %d", errnum);
  return buf;
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@strerror.buf = internal global [16 x i8] zeroinitializer
@.str = [9 x i8] c"Error %d\00"
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @strerror.buf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @strerror.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@strerror.buf = internal global [16 x i8] zeroinitializer
@.str = [9 x i8] c"Error %d\00"
define i8* @strerror(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @strerror.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @strerror.buf, i64 0, i64 0)
}
void test() {}


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

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

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

LLVM IR (-O2):
define void @test() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int /*<<< orphan*/ f3();
int /*<<< orphan*/ f4();
int main() {
  f1();
  f2();
  f3();
  f4();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <f1@plt>
mov    $0x0,%al
call   1030 <f2@plt>
mov    $0x0,%al
call   1040 <f3@plt>
mov    $0x0,%al
call   1060 <f4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <f1@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1040 <f3@plt>
xor    %eax,%eax
call   1060 <f4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f1()
%3 = call i32 (...) @f2()
%4 = call i32 (...) @f3()
%5 = call i32 (...) @f4()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f2()
%3 = tail call i32 (...) @f3()
%4 = tail call i32 (...) @f4()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f();
void call_f(void) {
  f();
  exit(0);
}


x86 assembly (clang, -O0):
<call_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<call_f>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @call_f() {
%1 = call i32 (...) @f()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @call_f() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int ZwClose(int Handle) {
  {
    int tmp_ndt_9;
    tmp_ndt_9 = __VERIFIER_nondet_int();
    if (tmp_ndt_9 == 0) {
      goto switch_9_0;
    } else {
      goto switch_9_default;
      if (0) {
      switch_9_0:;
        return (0);
      switch_9_default:;
        return (-1073741823);
      } else {
      }
    }
  }
}


x86 assembly (clang, -O0):
<ZwClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <ZwClose+0x24>
jmp    1139 <ZwClose+0x29>
jmp    1145 <ZwClose+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114c <ZwClose+0x3c>
movl   $0xc0000001,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZwClose>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0xc0000001,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ZwClose(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
br label %13
10: ; No predecessors!
br i1 false, label %11, label %14
11: ; preds = %10
br label %12
12: ; preds = %11, %8
store i32 0, i32* %2
br label %16
13: ; preds = %9
store i32 -1073741823, i32* %2
br label %16
14: ; preds = %10
br label %15
15: ; preds = %14
br label %16
16: ; preds = %12, %13, %15
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @ZwClose(i32 %0) {
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 0, i32 -1073741823
ret i32 %4
}
int equalTo(int lhs, int rhs) { return lhs == rhs; }


x86 assembly (clang, -O0):
<equalTo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equalTo>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @equalTo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ tm_to_beats(struct tm *);
int main(int argc, char *argv[], char *envp[]) {
  time_t now;
  struct tm *now_tm;
  now = time(NULL);
  now_tm = gmtime(&now);
  printf("@%.2lf\n", tm_to_beats(now_tm));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
call   1060 <gmtime@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <tm_to_beats@plt>
mov    %eax,%esi
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1060 <gmtime@plt>
mov    %rax,%rdi
call   1030 <tm_to_beats@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [8 x i8] c"@%.2lf\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca %struct.tm*
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%10 = call i32 @time(i32* null)
store i32 %10, i32* %8
%11 = call %struct.tm* @gmtime(i32* %8)
store %struct.tm* %11, %struct.tm** %9
%12 = load %struct.tm*, %struct.tm** %9
%13 = call i32 @tm_to_beats(%struct.tm* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [8 x i8] c"@%.2lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @time(i32* null)
store i32 %6, i32* %4
%7 = call %struct.tm* @gmtime(i32* %4)
%8 = call i32 @tm_to_beats(%struct.tm* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void flush_stdout__() {
  int ier;
  ier = fflush(stdout);
}


x86 assembly (clang, -O0):
<flush_stdout__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_stdout__>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @flush_stdout__() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @flush_stdout__() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Type definitions */
struct _tuple17 {
  int dummy;
};
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
struct _tuple17 *Cyc_spec_rec(struct Cyc_Lexing_lexbuf *, int);
struct _tuple17 *Cyc_spec(struct Cyc_Lexing_lexbuf *lexbuf) {
  struct _tuple17 *_T0;
  _T0 = Cyc_spec_rec(lexbuf, 13);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_spec>:
mov    $0xd,%esi
jmp    1030 <Cyc_spec_rec@plt>

LLVM IR (-O0):
%struct._tuple17 = type { i32 }
%struct.Cyc_Lexing_lexbuf = type { i32 }
define %struct._tuple17* @Cyc_spec(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca %struct._tuple17*
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call %struct._tuple17* @Cyc_spec_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 13)
store %struct._tuple17* %5, %struct._tuple17** %3
%6 = load %struct._tuple17*, %struct._tuple17** %3
ret %struct._tuple17* %6
}

LLVM IR (-O2):
%struct._tuple17 = type { i32 }
%struct.Cyc_Lexing_lexbuf = type { i32 }
define %struct._tuple17* @Cyc_spec(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call %struct._tuple17* @Cyc_spec_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 13)
ret %struct._tuple17* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glVertex4dv(int /*<<< orphan*/ *);
void Vertex4dv(GLdouble v[4]) { glVertex4dv(v); }


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

x86 assembly (clang, -O2):
<Vertex4dv>:
jmp    1030 <glVertex4dv@plt>

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

LLVM IR (-O2):
define void @Vertex4dv(i32* %0) {
%2 = tail call i32 @glVertex4dv(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int comp(int *, int *, int);
int /*<<< orphan*/ printf(char *, int, int);
void dotest(int *d1, int *d2, int k, bool exp) {
  bool act = comp(d1, d2, k);
  if (act != exp)
    printf("Error. Expected %d but got %d\n", exp, act);
  assert(act == exp);
}


x86 assembly (clang, -O0):
<dotest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <comp@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     1177 <dotest+0x47>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotest>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
call   1030 <comp@plt>
mov    %eax,%ebp
cmp    %ebx,%eax
je     1150 <dotest+0x20>
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1040 <printf@plt>
xor    %edi,%edi
cmp    %ebx,%ebp
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <assert@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Error. Expected %d but got %d\0A\00"
define void @dotest(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @comp(i32* %10, i32* %11, i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = load i32, i32* %8
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %4
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19)
br label %21
21: ; preds = %17, %4
%22 = load i32, i32* %9
%23 = load i32, i32* %8
%24 = icmp eq i32 %22, %23
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Error. Expected %d but got %d\0A\00"
define void @dotest(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @comp(i32* %0, i32* %1, i32 %2)
%6 = icmp eq i32 %5, %3
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
br label %9
9: ; preds = %7, %4
%10 = zext i1 %6 to i32
%11 = tail call i32 @assert(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 0, j = 7;
  while (i < 10) {
    i++;
    if (i == j) {
      break;
    }
  }
  printf("i termino: %d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1156 <main+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1151 <main+0x41>
jmp    1156 <main+0x46>
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea0(%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    $0x7,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"i termino: %d\0A\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 7, i32* %3
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %7
br label %15
14: ; preds = %7
br label %4
15: ; preds = %13, %4
%16 = load i32, i32* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"i termino: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}
int Round(double a) {
  int t = a;
  if (a - (double)t < 0.5)
    return t;
  else if (a - (double)t > 0.5)
    return t + 1;
  else
    return (t + (t % 2));
}


x86 assembly (clang, -O0):
<Round>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x14(%rbp),%xmm0
subsd  %xmm0,%xmm1
movsd  0xed9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    113c <Round+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <Round+0x83>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeae(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    116a <Round+0x6a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <Round+0x83>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Round>:
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     113c <Round+0x3c>
ucomisd 0xeda(%rip),%xmm0
jbe    112c <Round+0x2c>
add    $0x1,%eax
ret
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
mov    %eax,%edx
sub    %ecx,%edx
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Round(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = load double, double* %3
%6 = fptosi double %5 to i32
store i32 %6, i32* %4
%7 = load double, double* %3
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fsub double %7, %9
%11 = fcmp olt double %10, 5.000000e-01
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %28
14: ; preds = %1
%15 = load double, double* %3
%16 = load i32, i32* %4
%17 = sitofp i32 %16 to double
%18 = fsub double %15, %17
%19 = fcmp ogt double %18, 5.000000e-01
br i1 %19, label %20, label %23
20: ; preds = %14
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %28
23: ; preds = %14
%24 = load i32, i32* %4
%25 = load i32, i32* %4
%26 = srem i32 %25, 2
%27 = add nsw i32 %24, %26
store i32 %27, i32* %2
br label %28
28: ; preds = %23, %20, %12
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @Round(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %0, %3
%5 = fcmp olt double %4, 5.000000e-01
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = fcmp ogt double %4, 5.000000e-01
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = add nsw i32 %2, 1
br label %13
10: ; preds = %6
%11 = srem i32 %2, 2
%12 = add nsw i32 %11, %2
br label %13
13: ; preds = %1, %10, %8
%14 = phi i32 [ %9, %8 ], [ %12, %10 ], [ %2, %1 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ editor_test();
int /*<<< orphan*/ textseq_test();
int main(void) {
  textseq_test();
  editor_test();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @textseq_test()
%3 = call i32 (...) @editor_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @textseq_test()
%2 = tail call i32 (...) @editor_test()
ret i32 0
}
char const *vl_get_version_string() { return "0.9.4"; }


x86 assembly (clang, -O0):
<vl_get_version_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"0.9.4\00"
define i8* @vl_get_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.9.4\00"
define i8* @vl_get_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int main(void) {
  if (cproj(2 + 3i) != 2 + 3i)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1050 <cproj@plt>
movsd  0xe98(%rip),%xmm2
ucomisd %xmm2,%xmm0
setne  %al
setp   %cl
or     %cl,%al
movsd  0xe7c(%rip),%xmm0
ucomisd %xmm0,%xmm1
setne  %cl
setp   %dl
or     %dl,%cl
or     %cl,%al
test   $0x1,%al
jne    119f <main+0x6f>
jmp    11a4 <main+0x74>
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
movsd  0xec7(%rip),%xmm1
call   1050 <cproj@plt>
ucomisd 0xeb2(%rip),%xmm0
jne    1165 <main+0x35>
jp     1165 <main+0x35>
ucomisd 0xeae(%rip),%xmm1
jne    1165 <main+0x35>
jp     1165 <main+0x35>
xor    %edi,%edi
call   1040 <exit@plt>
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca { double, double }
store i32 0, i32* %1
%3 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 0
%4 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 1
store double 2.000000e+00, double* %3
store double 3.000000e+00, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds { double, double }, { double, double }* %2, i32 0, i32 1
%8 = load double, double* %7
%9 = call { double, double } @cproj(double %6, double %8)
%10 = extractvalue { double, double } %9, 0
%11 = extractvalue { double, double } %9, 1
%12 = fcmp une double %10, 2.000000e+00
%13 = fcmp une double %11, 3.000000e+00
%14 = or i1 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %0
unreachable
16: ; preds = %0
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call { double, double } @cproj(double 2.000000e+00, double 3.000000e+00)
%2 = extractvalue { double, double } %1, 0
%3 = extractvalue { double, double } %1, 1
%4 = fcmp une double %2, 2.000000e+00
%5 = fcmp une double %3, 3.000000e+00
%6 = or i1 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %0
tail call void @abort()
unreachable
8: ; preds = %0
tail call void @exit(i32 0)
unreachable
}