xunge/DecIR huggingface dataset:
/* Variables and functions */
int inputint(char *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a;
  a = inputint("a", a);
  if (a % 2 == 0) {
    printf("%d e\' pari\n", a);
  } else {
    printf("%d e\' dispari\n", a);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1040 <inputint@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1169 <main+0x49>
mov    -0x8(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1178 <main+0x58>
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <inputint@plt>
test   $0x1,%al
lea    0xecc(%rip),%rcx
lea    0xed1(%rip),%rdi
cmove  %rcx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [12 x i8] c"%d e' pari\0A\00"
@.str.2 = [15 x i8] c"%d e' dispari\0A\00"
define i32 @main() {
%1 = tail call i32 @inputint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i32 %1)
ret i32 0
}
/* Variables and functions */
int fn8(int);
int fn9(int);
int fn10(int x) { return fn8(x) + fn9(x); }


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

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

LLVM IR (-O0):
define i32 @fn10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @fn8(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @fn9(i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @fn10(i32 %0) {
%2 = tail call i32 @fn8(i32 %0)
%3 = tail call i32 @fn9(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ execl(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int main(int argc, char *argv[]) {
  execl("/bin/ls", "ls", "-l ./", NULL);
  perror("execl");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    0xeb1(%rip),%rsi
lea    0xead(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1050 <execl@plt>
lea    0xea3(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec6(%rip),%rsi
lea    0xec2(%rip),%rdx
xor    %ecx,%ecx
call   1050 <execl@plt>
lea    0xeba(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [6 x i8] c"-l ./\00"
@.str.3 = [6 x i8] c"execl\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* null)
%7 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [6 x i8] c"-l ./\00"
@.str.3 = [6 x i8] c"execl\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* null)
%4 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
void glmGreaterThanEqual3fs(bool out[3], const float x[3], float y) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = x[i] >= y;
}


x86 assembly (clang, -O0):
<glmGreaterThanEqual3fs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x3,-0x20(%rbp)
jae    1159 <glmGreaterThanEqual3fs+0x59>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
ucomiss -0x14(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1119 <glmGreaterThanEqual3fs+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGreaterThanEqual3fs>:
movss  (%rsi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
mov    %eax,(%rdi)
movss  0x4(%rsi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
mov    %eax,0x4(%rdi)
movss  0x8(%rsi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
mov    %eax,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @glmGreaterThanEqual3fs(i32* nocapture writeonly %0, float* nocapture %1, float %2) {
%4 = load float, float* %1
%5 = fcmp oge float %4, %2
%6 = zext i1 %5 to i32
store i32 %6, i32* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fcmp oge float %8, %2
%10 = zext i1 %9 to i32
%11 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %10, i32* %11
%12 = getelementptr inbounds float, float* %1, i64 2
%13 = load float, float* %12
%14 = fcmp oge float %13, %2
%15 = zext i1 %14 to i32
%16 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %15, i32* %16
ret void
}
void mask_evtchn() {}


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

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

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

LLVM IR (-O2):
define void @mask_evtchn() {
ret void
}
double derivative_righthand(double (*f)(double), double x, double h) {
  return (f(x + h) - f(x)) / h;
}


x86 assembly (clang, -O0):
<derivative_righthand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
call   *%rax
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<derivative_righthand>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %rdi,%rbx
addsd  %xmm1,%xmm0
call   *%rdi
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   *%rbx
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
divsd  0x18(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @derivative_righthand(double (double)* %0, double %1, double %2) {
%4 = alloca double (double)*
%5 = alloca double
%6 = alloca double
store double (double)* %0, double (double)** %4
store double %1, double* %5
store double %2, double* %6
%7 = load double (double)*, double (double)** %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fadd double %8, %9
%11 = call double %7(double %10)
%12 = load double (double)*, double (double)** %4
%13 = load double, double* %5
%14 = call double %12(double %13)
%15 = fsub double %11, %14
%16 = load double, double* %6
%17 = fdiv double %15, %16
ret double %17
}

LLVM IR (-O2):
define double @derivative_righthand(double (double)* nocapture %0, double %1, double %2) {
%4 = fadd double %1, %2
%5 = tail call double %0(double %4)
%6 = tail call double %0(double %1)
%7 = fsub double %5, %6
%8 = fdiv double %7, %2
ret double %8
}
/* Type definitions */
struct rtattr {
  int dummy;
};
struct qdisc_util {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int hpfq_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats) {
  return -1;
}


x86 assembly (clang, -O0):
<hpfq_print_xstats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.qdisc_util = type { i32 }
%struct.rtattr = type { i32 }
define i32 @hpfq_print_xstats(%struct.qdisc_util* %0, i32* %1, %struct.rtattr* %2) {
%4 = alloca %struct.qdisc_util*
%5 = alloca i32*
%6 = alloca %struct.rtattr*
store %struct.qdisc_util* %0, %struct.qdisc_util** %4
store i32* %1, i32** %5
store %struct.rtattr* %2, %struct.rtattr** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.qdisc_util = type { i32 }
%struct.rtattr = type { i32 }
define i32 @hpfq_print_xstats(%struct.qdisc_util* nocapture readnone %0, i32* nocapture readnone %1, %struct.rtattr* nocapture readnone %2) {
ret i32 -1
}
/* Type definitions */
struct rsync_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int p_sync_callback(int send_socket, short event,
                    struct rsync_info *rsync_info) {
  printf("- p_sync_callback start! -\n");
}


x86 assembly (clang, -O0):
<p_sync_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.rsync_info = type { i32 }
@.str = [28 x i8] c"- p_sync_callback start! -\0A\00"
define i32 @p_sync_callback(i32 %0, i16 signext %1, %struct.rsync_info* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i16
%7 = alloca %struct.rsync_info*
store i32 %0, i32* %5
store i16 %1, i16* %6
store %struct.rsync_info* %2, %struct.rsync_info** %7
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct.rsync_info = type { i32 }
@str = [27 x i8] c"- p_sync_callback start! -\00"
define i32 @p_sync_callback(i32 %0, i16 signext %1, %struct.rsync_info* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_string(void *buf) {
  uint8_t *str = (uint8_t *)buf;
  printf("%s", str);
}


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

x86 assembly (clang, -O2):
<print_string>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void bailOut(int code, char *message) {
  fprintf(stderr, message);
  exit(code);
}


x86 assembly (clang, -O0):
<bailOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bailOut>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @bailOut(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32 %5, i8* %6)
%8 = load i32, i32* %3
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @bailOut(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* %1)
%5 = tail call i32 @exit(i32 %0)
unreachable
}
int read_Name(char *name) {}


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

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

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

LLVM IR (-O2):
define i32 @read_Name(i8* nocapture readnone %0) {
ret i32 undef
}
unsigned long check_apicid_present(int bit) { return (1); }


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

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

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

LLVM IR (-O2):
define i64 @check_apicid_present(i32 %0) {
ret i64 1
}
/* Variables and functions */
char *multiply(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("%s\n", multiply(argv[1], argv[2]));
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <multiply@plt>
lea    0xecb(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i8* @multiply(i8* %4, i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _putchar(char);
void print_line(int n) {
  int i;
  if (n > 0) {
    for (i = 0; i < n; i++)
      _putchar('_');
  }
  _putchar('\n');
}


x86 assembly (clang, -O0):
<print_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1155 <print_line+0x45>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <print_line+0x40>
mov    $0x5f,%edi
call   1030 <_putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112c <print_line+0x1c>
jmp    1155 <print_line+0x45>
mov    $0xa,%edi
call   1030 <_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_line>:
push   %rbx
test   %edi,%edi
jle    112f <print_line+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x5f,%edi
call   1030 <_putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_line+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <_putchar@plt>

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

LLVM IR (-O2):
define void @print_line(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @_putchar(i8 signext 95)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = tail call i32 @_putchar(i8 signext 10)
ret void
}
void foo261(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo261(i32 %0) {
ret void
}
int main(void) {
  char str[] = "Hello, World!";
  unsigned int t = ~crc32(str);
  printf("0x%08x\n", t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x12(%rbp),%rdi
mov    $0x0,%al
call   1030 <crc32@plt>
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x21646c726f5720,%rax
mov    %rax,0xe(%rsp)
movabs $0x57202c6f6c6c6548,%rax
2c 20 57
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1030 <crc32@plt>
not    %eax
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [14 x i8] c"Hello, World!\00"
@.str = [8 x i8] c"0x%08x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [14 x i8]* %2 to i8*
%5 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @crc32 to i32 (i8*, ...)*)(i8* %5)
%7 = xor i32 %6, -1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [14 x i8] c"Hello, World!\00"
@.str = [8 x i8] c"0x%08x\0A\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @crc32 to i32 (i8*, ...)*)(i8* %2)
%4 = xor i32 %3, -1
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x06() {
  Assert_real((isbdigit(6) == 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_isbdigit.c",
              35, ("isbdigit should be 0 for 0x06"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x06\00"
define void @t_isbdigit_0x06() {
%1 = tail call i64 @isbdigit(i32 6)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x90() {
  Assert_real((ispunct(144) == 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_ispunct.c",
              725, ("ispunct should be 0 for 0x90"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x90>:
push   %rax
mov    $0x90,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d5,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x90\00"
define void @t_ispunct_0x90() {
%1 = call i64 @ispunct(i32 144)
%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 725, i8* getelementptr inbounds ([29 x i8], [29 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x90\00"
define void @t_ispunct_0x90() {
%1 = tail call i64 @ispunct(i32 144)
%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 725, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dummyfunc(void) { printf("In dummyfunc() -- PASS\n"); }


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"In dummyfunc() -- PASS\00"
define void @dummyfunc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
void DOM_KeyEvent_initModifier(unsigned long modifier, int value) {}


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

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

LLVM IR (-O0):
define void @DOM_KeyEvent_initModifier(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @DOM_KeyEvent_initModifier(i64 %0, i32 %1) {
ret void
}
int __lngUnsignedLess(unsigned short a[2], unsigned short b[2]) {
  return (a[1] < b[1]) || ((a[1] == b[1]) && (*a < *b));
}


x86 assembly (clang, -O0):
<__lngUnsignedLess>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%ecx
mov    -0x10(%rbp),%rax
movzwl 0x2(%rax),%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jl     1162 <__lngUnsignedLess+0x62>
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%ecx
mov    -0x10(%rbp),%rax
movzwl 0x2(%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x12(%rbp)
jne    115c <__lngUnsignedLess+0x5c>
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
setl   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lngUnsignedLess>:
movzwl 0x2(%rdi),%ecx
movzwl 0x2(%rsi),%edx
mov    $0x1,%eax
cmp    %dx,%cx
jb     1124 <__lngUnsignedLess+0x24>
xor    %eax,%eax
cmp    %dx,%cx
jne    1124 <__lngUnsignedLess+0x24>
movzwl (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%cx
setb   %al
ret

LLVM IR (-O0):
define i32 @__lngUnsignedLess(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %3
%6 = getelementptr inbounds i16, i16* %5, i64 1
%7 = load i16, i16* %6
%8 = zext i16 %7 to i32
%9 = load i16*, i16** %4
%10 = getelementptr inbounds i16, i16* %9, i64 1
%11 = load i16, i16* %10
%12 = zext i16 %11 to i32
%13 = icmp slt i32 %8, %12
br i1 %13, label %34, label %14
14: ; preds = %2
%15 = load i16*, i16** %3
%16 = getelementptr inbounds i16, i16* %15, i64 1
%17 = load i16, i16* %16
%18 = zext i16 %17 to i32
%19 = load i16*, i16** %4
%20 = getelementptr inbounds i16, i16* %19, i64 1
%21 = load i16, i16* %20
%22 = zext i16 %21 to i32
%23 = icmp eq i32 %18, %22
br i1 %23, label %24, label %32
24: ; preds = %14
%25 = load i16*, i16** %3
%26 = load i16, i16* %25
%27 = zext i16 %26 to i32
%28 = load i16*, i16** %4
%29 = load i16, i16* %28
%30 = zext i16 %29 to i32
%31 = icmp slt i32 %27, %30
br label %32
32: ; preds = %24, %14
%33 = phi i1 [ false, %14 ], [ %31, %24 ]
br label %34
34: ; preds = %32, %2
%35 = phi i1 [ true, %2 ], [ %33, %32 ]
%36 = zext i1 %35 to i32
ret i32 %36
}

LLVM IR (-O2):
define i32 @__lngUnsignedLess(i16* nocapture %0, i16* nocapture %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %3
%5 = getelementptr inbounds i16, i16* %1, i64 1
%6 = load i16, i16* %5
%7 = icmp ult i16 %4, %6
br i1 %7, label %15, label %8
8: ; preds = %2
%9 = icmp eq i16 %4, %6
br i1 %9, label %10, label %15
10: ; preds = %8
%11 = load i16, i16* %0
%12 = load i16, i16* %1
%13 = icmp ult i16 %11, %12
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %8, %10, %2
%16 = phi i32 [ 1, %2 ], [ 0, %8 ], [ %14, %10 ]
ret i32 %16
}
/* Variables and functions */
void puts(int c) {}


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

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

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

LLVM IR (-O2):
define void @puts(i32 %0) {
ret void
}
signed short *range_sshort(signed short *val, signed short min,
                           signed short max) {
  if (*val < min || max < *val)
    __builtin_abort();
  return val;
}


x86 assembly (clang, -O0):
<range_sshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
movswl -0xa(%rbp),%ecx
cmp    %ecx,%eax
jl     1150 <range_sshort+0x40>
movswl -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jge    1155 <range_sshort+0x45>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_sshort>:
push   %rax
movzwl (%rdi),%eax
cmp    %si,%ax
jl     1123 <range_sshort+0x13>
cmp    %dx,%ax
jg     1123 <range_sshort+0x13>
mov    %rdi,%rax
pop    %rcx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i16* @range_sshort(i16* %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16*
%5 = alloca i16
%6 = alloca i16
store i16* %0, i16** %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16*, i16** %4
%8 = load i16, i16* %7
%9 = sext i16 %8 to i32
%10 = load i16, i16* %5
%11 = sext i16 %10 to i32
%12 = icmp slt i32 %9, %11
br i1 %12, label %20, label %13
13: ; preds = %3
%14 = load i16, i16* %6
%15 = sext i16 %14 to i32
%16 = load i16*, i16** %4
%17 = load i16, i16* %16
%18 = sext i16 %17 to i32
%19 = icmp slt i32 %15, %18
br i1 %19, label %20, label %21
20: ; preds = %13, %3
unreachable
21: ; preds = %13
%22 = load i16*, i16** %4
ret i16* %22
}

LLVM IR (-O2):
define i16* @range_sshort(i16* returned %0, i16 signext %1, i16 signext %2) {
%4 = load i16, i16* %0
%5 = icmp slt i16 %4, %1
%6 = icmp sgt i16 %4, %2
%7 = or i1 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %3
tail call void @abort()
unreachable
9: ; preds = %3
ret i16* %0
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, int);
void *xmalloc(ssize_t size) {
  void *mem;
  if (size <= 0)
    return NULL;
  mem = calloc((size_t)size, 1);
  if (!mem)
    abort();
  return mem;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     1144 <xmalloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1170 <xmalloc+0x50>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <xmalloc+0x48>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
test   %rdi,%rdi
jle    1137 <xmalloc+0x17>
mov    $0x1,%esi
call   1040 <calloc@plt>
test   %rax,%rax
je     113b <xmalloc+0x1b>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i8* @xmalloc(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @calloc(i64 %0, i32 1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %9
}
int feenableexcept(int excepts) {
  if (excepts != 0)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<feenableexcept>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <feenableexcept+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1124 <feenableexcept+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<feenableexcept>:
neg    %edi
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @feenableexcept(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @feenableexcept(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
void g_snprintf() {}


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

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

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

LLVM IR (-O2):
define void @g_snprintf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *toStr1();
char *toStr2();
void sample1() {
  char *s1 = toStr1();
  char *s2 = toStr2();
  printf("s1 =%s\n", s1);
  printf("s2 =%s\n", s2);
}


x86 assembly (clang, -O0):
<sample1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <toStr1@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <toStr2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample1>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <toStr1@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <toStr2@plt>
mov    %rax,%r14
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"s1 =%s\0A\00"
@.str.1 = [8 x i8] c"s2 =%s\0A\00"
define void @sample1() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @toStr1()
store i8* %3, i8** %1
%4 = call i8* (...) @toStr2()
store i8* %4, i8** %2
%5 = load i8*, i8** %1
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"s1 =%s\0A\00"
@.str.1 = [8 x i8] c"s2 =%s\0A\00"
define void @sample1() {
%1 = tail call i8* (...) @toStr1()
%2 = tail call i8* (...) @toStr2()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
void i2d_SXNETID(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_SXNETID() {
ret void
}
unsigned int convVccint(unsigned int pVccint) {
  return ((pVccint)*3 * 1000) >> 16;
}


x86 assembly (clang, -O0):
<convVccint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
imul   $0x3e8,%eax,%eax
shr    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convVccint>:
imul   $0xbb8,%edi,%eax
shr    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @convVccint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 3
%5 = mul i32 %4, 1000
%6 = lshr i32 %5, 16
ret i32 %6
}

LLVM IR (-O2):
define i32 @convVccint(i32 %0) {
%2 = mul i32 %0, 3000
%3 = lshr i32 %2, 16
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "Usage:  fix8bit {-7 | -8} < infile > outfile\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 = [46 x i8] c"Usage: fix8bit {-7 | -8} < infile > outfile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: fix8bit {-7 | -8} < infile > outfile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int modul(unsigned int num_clav, int times) {
  return num_clav % times;
}


x86 assembly (clang, -O0):
<modul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modul>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @modul(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 = urem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @modul(i32 %0, i32 %1) {
%3 = urem i32 %0, %1
ret i32 %3
}
void hgt() { asm volatile(".byte 0xd6" : : "a"(0)); }


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

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

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

LLVM IR (-O2):
define void @hgt() {
tail call void asm sideeffect ".byte 0xd6", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ USB_OTG1_DriverIRQHandler();
__attribute__((weak)) void USB_OTG1_IRQHandler(void) {
  USB_OTG1_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @USB_OTG1_IRQHandler() {
%1 = tail call i32 (...) @USB_OTG1_DriverIRQHandler()
ret void
}
float epr_interpolate2D(float wi, float wj, float x00, float x10, float x01,
                        float x11) {
  return x00 + wi * (x10 - x00) + wj * (x01 - x00) +
         wi * wj * (x11 + x00 - x01 - x10);
}


x86 assembly (clang, -O0):
<epr_interpolate2D>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
subss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
subss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
addss  -0xc(%rbp),%xmm2
subss  -0x14(%rbp),%xmm2
subss  -0x10(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<epr_interpolate2D>:
addss  %xmm2,%xmm5
subss  %xmm4,%xmm5
subss  %xmm3,%xmm5
subss  %xmm2,%xmm3
mulss  %xmm0,%xmm3
addss  %xmm2,%xmm3
subss  %xmm2,%xmm4
mulss  %xmm1,%xmm4
addss  %xmm3,%xmm4
mulss  %xmm1,%xmm0
mulss  %xmm5,%xmm0
addss  %xmm4,%xmm0
ret

LLVM IR (-O0):
define float @epr_interpolate2D(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %9
%14 = load float, float* %7
%15 = load float, float* %10
%16 = load float, float* %9
%17 = fsub float %15, %16
%18 = call float @llvm.fmuladd.f32(float %14, float %17, float %13)
%19 = load float, float* %8
%20 = load float, float* %11
%21 = load float, float* %9
%22 = fsub float %20, %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %18)
%24 = load float, float* %7
%25 = load float, float* %8
%26 = fmul float %24, %25
%27 = load float, float* %12
%28 = load float, float* %9
%29 = fadd float %27, %28
%30 = load float, float* %11
%31 = fsub float %29, %30
%32 = load float, float* %10
%33 = fsub float %31, %32
%34 = call float @llvm.fmuladd.f32(float %26, float %33, float %23)
ret float %34
}

LLVM IR (-O2):
define float @epr_interpolate2D(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fsub float %3, %2
%8 = tail call float @llvm.fmuladd.f32(float %0, float %7, float %2)
%9 = fsub float %4, %2
%10 = tail call float @llvm.fmuladd.f32(float %1, float %9, float %8)
%11 = fmul float %0, %1
%12 = fadd float %2, %5
%13 = fsub float %12, %4
%14 = fsub float %13, %3
%15 = tail call float @llvm.fmuladd.f32(float %11, float %14, float %10)
ret float %15
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t endian_fix16(uint16_t x) { return (x << 8) | (x >> 8); }


x86 assembly (clang, -O0):
<endian_fix16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_fix16>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @endian_fix16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @endian_fix16(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void multi(void) {
#pragma omp parallel
  { printf("Hello World!\n"); }
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @multi() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double getTime() {
  struct timeval tp;
  gettimeofday(&tp, NULL);
  return tp.tv_sec + tp.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @getTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %4, %7
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @getTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
void foo6() {
  switch (0) {}
}


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

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

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

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