xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 5, j = 0;
  int k = i / j;
  printf("%d", k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xebf(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 poison)
ret i32 0
}
/* Variables and functions */
void *qe_malloc_bytes(int);
void *my_malloc(__attribute__((unused)) void *opaque, int size) {
  return qe_malloc_bytes(size);
}


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

x86 assembly (clang, -O2):
<my_malloc>:
mov    %esi,%edi
jmp    1030 <qe_malloc_bytes@plt>

LLVM IR (-O0):
define i8* @my_malloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i8* @qe_malloc_bytes(i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @my_malloc(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i8* @qe_malloc_bytes(i32 %1)
ret i8* %3
}
void ipa_debugfs_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ipa_debugfs_init() {
ret void
}
double missing_value() { return 99999999; }


x86 assembly (clang, -O0):
<missing_value>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<missing_value>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @missing_value() {
ret double 0x4197D783FC000000
}

LLVM IR (-O2):
define double @missing_value() {
ret double 0x4197D783FC000000
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello world!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fill_region_from_other(char *, int, char *,
                                          int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void fill_region_from_string(char *region, int region_length_in_bytes,
                             char *string) {
  fill_region_from_other(region, region_length_in_bytes, string,
                         strlen(string));
}


x86 assembly (clang, -O0):
<fill_region_from_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1040 <fill_region_from_other@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_region_from_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fill_region_from_other@plt>

LLVM IR (-O0):
define void @fill_region_from_string(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @fill_region_from_other(i8* %7, i32 %8, i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @fill_region_from_string(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @fill_region_from_other(i8* %0, i32 %1, i8* %2, i32 %4)
ret void
}
void setval_426(unsigned *p) { *p = 2428995912U; }


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

x86 assembly (clang, -O2):
<setval_426>:
movl   $0x90c78948,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_426(i32* nocapture writeonly %0) {
store i32 -1865971384, i32* %0
ret void
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number, result;
  scanf("%d", &number);
  result = is_prime(number);
  printf("%d", result);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <is_prime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int tcsetattr(int fd, int optional_actions, const struct termios *termios_p) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<tcsetattr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsetattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @tcsetattr(i32 %0, i32 %1, %struct.termios* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.termios*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.termios* %2, %struct.termios** %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @tcsetattr(i32 %0, i32 %1, %struct.termios* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Type definitions */
struct dns_rr_a4 {
  int dummy;
};
struct dns_ctx {
  int dummy;
};

/* Variables and functions */
scalar_t__ dns_resolve(struct dns_ctx *, int /*<<< orphan*/);
int /*<<< orphan*/ dns_submit_rhsbl(struct dns_ctx *, char const *,
                                    char const *, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
struct dns_rr_a4 *dns_resolve_rhsbl(struct dns_ctx *ctx, const char *name,
                                    const char *rhsbl) {
  return (struct dns_rr_a4 *)dns_resolve(
      ctx, dns_submit_rhsbl(ctx, name, rhsbl, 0, 0));
}


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

x86 assembly (clang, -O2):
<dns_resolve_rhsbl>:
push   %rbx
mov    %rdi,%rbx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <dns_submit_rhsbl@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <dns_resolve@plt>

LLVM IR (-O0):
%struct.dns_rr_a4 = type { i32 }
%struct.dns_ctx = type { i32 }
define %struct.dns_rr_a4* @dns_resolve_rhsbl(%struct.dns_ctx* %0, i8* %1, i8* %2) {
%4 = alloca %struct.dns_ctx*
%5 = alloca i8*
%6 = alloca i8*
store %struct.dns_ctx* %0, %struct.dns_ctx** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.dns_ctx*, %struct.dns_ctx** %4
%8 = load %struct.dns_ctx*, %struct.dns_ctx** %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @dns_submit_rhsbl(%struct.dns_ctx* %8, i8* %9, i8* %10, i32 0, i32 0)
%12 = call i64 @dns_resolve(%struct.dns_ctx* %7, i32 %11)
%13 = inttoptr i64 %12 to %struct.dns_rr_a4*
ret %struct.dns_rr_a4* %13
}

LLVM IR (-O2):
%struct.dns_rr_a4 = type { i32 }
%struct.dns_ctx = type { i32 }
define %struct.dns_rr_a4* @dns_resolve_rhsbl(%struct.dns_ctx* %0, i8* %1, i8* %2) {
%4 = tail call i32 @dns_submit_rhsbl(%struct.dns_ctx* %0, i8* %1, i8* %2, i32 0, i32 0)
%5 = tail call i64 @dns_resolve(%struct.dns_ctx* %0, i32 %4)
%6 = inttoptr i64 %5 to %struct.dns_rr_a4*
ret %struct.dns_rr_a4* %6
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void usage(void) {
  die("relocs [--abs-syms|--abs-relocs|--text|--realmode] vmlinux\n");
}


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

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

LLVM IR (-O0):
@.str = [60 x i8] c"relocs [--abs-syms|--abs-relocs|--text|--realmode] vmlinux\0A\00"
define void @usage() {
%1 = call i32 @die(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"relocs [--abs-syms|--abs-relocs|--text|--realmode] vmlinux\0A\00"
define void @usage() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_C8int8_mem(signed char *val) {
  return ((*val) & (0xC8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C8int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 200
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_C8int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -56
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int pres_co(int co, int i) {
  double tmp = co;
  tmp = tmp / 100;
  return (i) ? (int)(tmp + 0.49) : (int)(tmp - 0.49);
}


x86 assembly (clang, -O0):
<pres_co>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114d <pres_co+0x4d>
movsd  0xecc(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
jmp    1165 <pres_co+0x65>
movsd  -0x10(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pres_co>:
xor    %eax,%eax
test   %esi,%esi
cvtsi2sd %edi,%xmm0
sete   %al
divsd  0xeed(%rip),%xmm0
lea    0xeee(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @pres_co(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
store double %7, double* %5
%8 = load double, double* %5
%9 = fdiv double %8, 1.000000e+02
store double %9, double* %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load double, double* %5
%14 = fadd double %13, 4.900000e-01
%15 = fptosi double %14 to i32
br label %20
16: ; preds = %2
%17 = load double, double* %5
%18 = fsub double %17, 4.900000e-01
%19 = fptosi double %18 to i32
br label %20
20: ; preds = %16, %12
%21 = phi i32 [ %15, %12 ], [ %19, %16 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @pres_co(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = fdiv double %3, 1.000000e+02
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, double -4.900000e-01, double 4.900000e-01
%7 = fadd double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
void what_did_you_say() {
  char buff[64];
  gets(buff);
  printf("You said: %s\n", buff);
}


x86 assembly (clang, -O0):
<what_did_you_say>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x40(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<what_did_you_say>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"You said: %s\0A\00"
define void @what_did_you_say() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"You said: %s\0A\00"
define void @what_did_you_say() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
void gdk_colormap_get_screen() {}


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

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

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

LLVM IR (-O2):
define void @gdk_colormap_get_screen() {
ret void
}
/* Variables and functions */
float *malloc(int);
float rand_float();
float *get_random(int nums) {
  int i;
  float *arr = malloc(sizeof(float) * nums * 1);
  for (i = 0; i < nums * 1; i++) {
    arr[i] = rand_float();
  }
  return arr;
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x0,%ecx
cmp    %ecx,%eax
jge    117c <get_random+0x5c>
mov    $0x0,%al
call   1030 <rand_float@plt>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <get_random+0x29>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%r14d
lea    0x0(,%r14,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
test   %r14d,%r14d
jle    1166 <get_random+0x46>
mov    %r14d,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand_float@plt>
movss  %xmm0,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1150 <get_random+0x30>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float* @get_random(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 4, %6
%8 = mul i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call float* @malloc(i32 %9)
store float* %10, float** %4
store i32 0, i32* %3
br label %11
11: ; preds = %22, %1
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = mul nsw i32 %13, 1
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %25
16: ; preds = %11
%17 = call float (...) @rand_float()
%18 = load float*, float** %4
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %18, i64 %20
store float %17, float* %21
br label %22
22: ; preds = %16
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %11
25: ; preds = %11
%26 = load float*, float** %4
ret float* %26
}

LLVM IR (-O2):
define noalias float* @get_random(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call float* @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = tail call float (...) @rand_float()
%10 = getelementptr inbounds float, float* %3, i64 %8
store float %9, float* %10
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %1
ret float* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void move(char getone, char putone) { printf("%c--->%c\n", getone, putone); }


x86 assembly (clang, -O0):
<move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xed2(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%c--->%c\0A\00"
define void @move(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clean_exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int system(char *);
void hand_to_smtpd(char *smtpd_line) {
  if (system(smtpd_line) == -1) {
    fprintf(stderr, "could not execute next stage %s , ", smtpd_line);
  }
  clean_exit(0);
  return;
}


x86 assembly (clang, -O0):
<hand_to_smtpd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
cmp    $0xffffffff,%eax
jne    1167 <hand_to_smtpd+0x37>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9e(%rip),%rsi
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1040 <clean_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hand_to_smtpd>:
push   %rbx
mov    %rdi,%rbx
call   1030 <system@plt>
cmp    $0xffffffff,%eax
jne    1156 <hand_to_smtpd+0x26>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <clean_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"could not execute next stage %s , \00"
define void @hand_to_smtpd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @system(i8* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %2
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %1
%11 = call i32 @clean_exit(i32 0)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"could not execute next stage %s , \00"
define void @hand_to_smtpd(i8* %0) {
%2 = tail call i32 @system(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %4, %1
%8 = tail call i32 @clean_exit(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ speak(char *);
int main(void) {
  int i = 42;
  (i) ? speak("Hello") : speak("World");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <speak@plt>
jmp    114d <main+0x3d>
lea    0xebe(%rip),%rdi
call   1030 <speak@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @speak(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char *, int);
void memcmp0() {
  char a[] = {1, 2, 3, 4};
  char b[4] = {0};
  memcmp(a, b, 4);
}


x86 assembly (clang, -O0):
<memcmp0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcmp0>:
push   %rax
movl   $0x4030201,0x4(%rsp)
04
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.memcmp0.a = [4 x i8] c"\01\02\03\04"
define void @memcmp0() {
%1 = alloca [4 x i8]
%2 = alloca [4 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = bitcast [4 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = call i32 @memcmp(i8* %5, i8* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @memcmp0() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @memcmp(i8* %3, i8* %4, i32 4)
ret void
}
/* Variables and functions */
unsigned int get_phys_address(int, unsigned short, unsigned short);
char peek(unsigned int, unsigned short *);
char get_raw(int bank, unsigned short as, unsigned short address,
             unsigned short *value) {
  unsigned int phys_address = get_phys_address(bank, as, address);
  return peek(phys_address, value);
}


x86 assembly (clang, -O0):
<get_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %si,%dx
mov    %edi,-0x4(%rbp)
mov    %dx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %rcx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x6(%rbp),%ax
movzwl %ax,%esi
movzwl -0x8(%rbp),%edx
call   1040 <get_phys_address@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <peek@plt>
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_raw>:
push   %rbx
mov    %rcx,%rbx
call   1040 <get_phys_address@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <peek@plt>

LLVM IR (-O0):
define signext i8 @get_raw(i32 %0, i16 zeroext %1, i16 zeroext %2, i16* %3) {
%5 = alloca i32
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16*
%9 = alloca i32
store i32 %0, i32* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16* %3, i16** %8
%10 = load i32, i32* %5
%11 = load i16, i16* %6
%12 = load i16, i16* %7
%13 = call i32 @get_phys_address(i32 %10, i16 zeroext %11, i16 zeroext %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = load i16*, i16** %8
%16 = call signext i8 @peek(i32 %14, i16* %15)
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @get_raw(i32 %0, i16 zeroext %1, i16 zeroext %2, i16* %3) {
%5 = tail call i32 @get_phys_address(i32 %0, i16 zeroext %1, i16 zeroext %2)
%6 = tail call signext i8 @peek(i32 %5, i16* %3)
ret i8 %6
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISLNK(int /*<<< orphan*/);
int lstat(char const *, struct stat *);
int is_link(const char *path) {
  struct stat st;
  if (lstat(path, &st) == -1)
    return 0;
  return S_ISLNK(st.st_mode);
}


x86 assembly (clang, -O0):
<is_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lstat@plt>
cmp    $0xffffffff,%eax
jne    114e <is_link+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1159 <is_link+0x39>
mov    -0x18(%rbp),%edi
call   1030 <S_ISLNK@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_link>:
push   %rax
mov    %rsp,%rsi
call   1040 <lstat@plt>
cmp    $0xffffffff,%eax
je     1137 <is_link+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISLNK@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_link(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @lstat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISLNK(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_link(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISLNK(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
short cdrom_installed(void) { return (0); }


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

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

LLVM IR (-O0):
define signext i16 @cdrom_installed() {
ret i16 0
}

LLVM IR (-O2):
define signext i16 @cdrom_installed() {
ret i16 0
}
/* Variables and functions */
scalar_t__ malloc(long);
int /*<<< orphan*/ nrerror(char *);
unsigned long *lvector(long nl, long nh) {
  unsigned long *v;
  v = (unsigned long *)malloc(((nh - nl + 1 + 1) * sizeof(long)));
  if (!v)
    nrerror("Error(lvector): allocation failure\n");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<lvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <lvector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <lvector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Error(lvector): allocation failure\0A\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i64*
store i64* %13, i64** %5
%14 = load i64*, i64** %5
%15 = icmp ne i64* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i64*, i64** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i64, i64* %19, i64 %21
%23 = getelementptr inbounds i64, i64* %22, i64 1
ret i64* %23
}

LLVM IR (-O2):
@.str = [36 x i8] c"Error(lvector): allocation failure\0A\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i64*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = getelementptr inbounds i64, i64* %13, i64 1
ret i64* %14
}
/* Variables and functions */
int /*<<< orphan*/ pn_init();
__attribute__((constructor)) void init(void) { pn_init(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = call i32 (...) @pn_init()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = tail call i32 (...) @pn_init()
ret void
}
int emac1_etherstatspkts1519toxoctets_set(
    unsigned int dev_id, union emac1_etherstatspkts1519toxoctets_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac1_etherstatspkts1519toxoctets_u = type opaque
define i32 @emac1_etherstatspkts1519toxoctets_set(i32 %0, %union.emac1_etherstatspkts1519toxoctets_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_etherstatspkts1519toxoctets_u*
store i32 %0, i32* %3
store %union.emac1_etherstatspkts1519toxoctets_u* %1, %union.emac1_etherstatspkts1519toxoctets_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_etherstatspkts1519toxoctets_u = type opaque
define i32 @emac1_etherstatspkts1519toxoctets_set(i32 %0, %union.emac1_etherstatspkts1519toxoctets_u* nocapture readnone %1) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_setr_pi8(char, char, char, char, char, char, char, char);
__m64 test_mm_setr_pi8(char a, char b, char c, char d, char e, char f, char g,
                       char h) {
  return _mm_setr_pi8(a, b, c, d, e, f, g, h);
}


x86 assembly (clang, -O0):
<test_mm_setr_pi8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8d,-0x18(%rbp)
mov    %ecx,%eax
mov    -0x18(%rbp),%ecx
mov    %eax,-0x14(%rbp)
mov    %edx,%eax
mov    -0x14(%rbp),%edx
mov    %eax,-0x10(%rbp)
mov    %esi,%eax
mov    -0x10(%rbp),%esi
mov    %eax,-0xc(%rbp)
mov    %edi,%r8d
mov    -0xc(%rbp),%edi
mov    %r9b,%al
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9b
mov    %r8b,-0x1(%rbp)
mov    %dil,-0x2(%rbp)
mov    %sil,-0x3(%rbp)
mov    %dl,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x1(%rbp),%dil
mov    -0x2(%rbp),%sil
mov    -0x3(%rbp),%dl
mov    -0x4(%rbp),%cl
mov    -0x5(%rbp),%r8b
mov    -0x6(%rbp),%r9b
mov    0x10(%rbp),%al
movsbl %dil,%edi
movsbl %sil,%esi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %al,%eax
mov    %eax,(%rsp)
movsbl 0x18(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <_mm_setr_pi8@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_setr_pi8>:
jmp    1030 <_mm_setr_pi8@plt>

LLVM IR (-O0):
define i32 @test_mm_setr_pi8(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8
store i8 %0, i8* %9
store i8 %1, i8* %10
store i8 %2, i8* %11
store i8 %3, i8* %12
store i8 %4, i8* %13
store i8 %5, i8* %14
store i8 %6, i8* %15
store i8 %7, i8* %16
%17 = load i8, i8* %9
%18 = load i8, i8* %10
%19 = load i8, i8* %11
%20 = load i8, i8* %12
%21 = load i8, i8* %13
%22 = load i8, i8* %14
%23 = load i8, i8* %15
%24 = load i8, i8* %16
%25 = call i32 @_mm_setr_pi8(i8 signext %17, i8 signext %18, i8 signext %19, i8 signext %20, i8 signext %21, i8 signext %22, i8 signext %23, i8 signext %24)
ret i32 %25
}

LLVM IR (-O2):
define i32 @test_mm_setr_pi8(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = tail call i32 @_mm_setr_pi8(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5, i8 signext %6, i8 signext %7)
ret i32 %9
}
int is_number(const double x) {
  if (!(x == x))
    return 0;
  if (x > (1E+37) || x < -(1E+37))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_number>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1124 <is_number+0x24>
jp     1124 <is_number+0x24>
jmp    1130 <is_number+0x30>
movl   $0x0,-0x4(%rbp)
jmp    116d <is_number+0x6d>
movsd  -0x10(%rbp),%xmm0
movsd  0xec3(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     115a <is_number+0x5a>
movsd  0xeb9(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1166 <is_number+0x66>
movl   $0x0,-0x4(%rbp)
jmp    116d <is_number+0x6d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number>:
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xef1(%rip),%xmm0
setbe  %cl
movsd  0xeee(%rip),%xmm1
ucomisd %xmm0,%xmm1
setbe  %dl
and    %cl,%dl
and    %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @is_number(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = load double, double* %3
%6 = fcmp oeq double %4, %5
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %16
8: ; preds = %1
%9 = load double, double* %3
%10 = fcmp ogt double %9, 0x479E17B84357691B
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load double, double* %3
%13 = fcmp olt double %12, 0xC79E17B84357691B
br i1 %13, label %14, label %15
14: ; preds = %11, %8
store i32 0, i32* %2
br label %16
15: ; preds = %11
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_number(double %0) {
%2 = fcmp ord double %0, 0.000000e+00
%3 = fcmp ule double %0, 0x479E17B84357691B
%4 = fcmp uge double %0, 0xC79E17B84357691B
%5 = and i1 %3, %4
%6 = and i1 %2, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void test() {
#pragma omp target
#pragma omp teams
  ;
}


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*/ func(int, int, int);
main() { func(1., 2., 3.); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <func@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @func(i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: gpmigmdet [-diff1/-diff2/-diff1c] [-op d/s]\n");
  fprintf(stderr, "\t\t    [-silent] [-v] [-l/-h] groupname\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: gpmigmdet [-diff1/-diff2/-diff1c] [-op d/s]\0A\00"
@.str.1 = [40 x i8] c"\09\09 [-silent] [-v] [-l/-h] groupname\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: gpmigmdet [-diff1/-diff2/-diff1c] [-op d/s]\0A\00"
@.str.1 = [40 x i8] c"\09\09 [-silent] [-v] [-l/-h] groupname\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x87() {
  Assert_real((isbdigit(135) == 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",
              680, ("isbdigit should be 0 for 0x87"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x87>:
push   %rax
mov    $0x87,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2a8,%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 0x87\00"
define void @t_isbdigit_0x87() {
%1 = call i64 @isbdigit(i32 135)
%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 680, 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 0x87\00"
define void @t_isbdigit_0x87() {
%1 = tail call i64 @isbdigit(i32 135)
%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 680, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BitTest_instr(int);
void BIT(void) { BitTest_instr(64); }


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

x86 assembly (clang, -O2):
<BIT>:
mov    $0x40,%edi
jmp    1030 <BitTest_instr@plt>

LLVM IR (-O0):
define void @BIT() {
%1 = call i32 @BitTest_instr(i32 64)
ret void
}

LLVM IR (-O2):
define void @BIT() {
%1 = tail call i32 @BitTest_instr(i32 64)
ret void
}
void RasterDMAConfig(unsigned int baseAddr, unsigned int frmMode,
                     unsigned int bustSz, unsigned int fifoTh,
                     unsigned int endian) {
  (*((volatile unsigned int *)(baseAddr + (0x40)))) =
      frmMode | bustSz | fifoTh | endian;
}


x86 assembly (clang, -O0):
<RasterDMAConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
or     -0xc(%rbp),%ecx
or     -0x10(%rbp),%ecx
or     -0x14(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterDMAConfig>:
or     %edx,%esi
or     %r8d,%ecx
or     %esi,%ecx
add    $0x40,%edi
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @RasterDMAConfig(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = or i32 %11, %12
%14 = load i32, i32* %9
%15 = or i32 %13, %14
%16 = load i32, i32* %10
%17 = or i32 %15, %16
%18 = load i32, i32* %6
%19 = add i32 %18, 64
%20 = zext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store volatile i32 %17, i32* %21
ret void
}

LLVM IR (-O2):
define void @RasterDMAConfig(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = or i32 %2, %1
%7 = or i32 %6, %3
%8 = or i32 %7, %4
%9 = add i32 %0, 64
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %8, i32* %11
ret void
}
/* Variables and functions */
int test_rr(int, int, int);
int test_rr_5_7_5(int argc, const char **argv) { return test_rr(5, 7, 5); }


x86 assembly (clang, -O0):
<test_rr_5_7_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edx
mov    $0x7,%esi
mov    %edx,%edi
call   1030 <test_rr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rr_5_7_5>:
mov    $0x5,%edi
mov    $0x7,%esi
mov    $0x5,%edx
jmp    1030 <test_rr@plt>

LLVM IR (-O0):
define i32 @test_rr_5_7_5(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @test_rr(i32 5, i32 7, i32 5)
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_rr_5_7_5(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_rr(i32 5, i32 7, i32 5)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ spaces;

/* Variables and functions */
int in2(int, int *, int);
int u8isbasespacei(int n) {
  static int spaces[] = {0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x20, 0xA0};
  return in2(n, spaces, sizeof(spaces) / sizeof(int));
}


x86 assembly (clang, -O0):
<u8isbasespacei>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f0b(%rip),%rsi
mov    $0x7,%edx
call   1030 <in2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isbasespacei>:
lea    0x2f19(%rip),%rsi
mov    $0x7,%edx
jmp    1030 <in2@plt>

LLVM IR (-O0):
@u8isbasespacei.spaces = internal global [7 x i32] [i32 9, i32 10, i32 11, i32 12, i32 13, i32 32, i32 160]
define i32 @u8isbasespacei(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @in2(i32 %3, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @u8isbasespacei.spaces, i64 0, i64 0), i32 7)
ret i32 %4
}

LLVM IR (-O2):
@u8isbasespacei.spaces = internal global [7 x i32] [i32 9, i32 10, i32 11, i32 12, i32 13, i32 32, i32 160]
define i32 @u8isbasespacei(i32 %0) {
%2 = tail call i32 @in2(i32 %0, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @u8isbasespacei.spaces, i64 0, i64 0), i32 7)
ret i32 %2
}
int test_imm_57int32_mem(int *val) {
  return ((*val) & (0x57 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_57int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 87
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_57int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 87
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}