xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Open Source SW Project\n");
  printf("2015244033 2학년 장세영\n");
  printf("2015244074");
  printf("정세원 왔다감");
  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>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Open Source SW Project\0A\00"
@.str.1 = [30 x i8] c"2015244033 2\ED\95\99\EB\85\84 \EC\9E\A5\EC\84\B8\EC\98\81\0A\00"
@.str.2 = [11 x i8] c"2015244074\00"
@.str.3 = [20 x i8] c"\EC\A0\95\EC\84\B8\EC\9B\90 \EC\99\94\EB\8B\A4\EA\B0\90\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [11 x i8] c"2015244074\00"
@.str.3 = [20 x i8] c"\EC\A0\95\EC\84\B8\EC\9B\90 \EC\99\94\EB\8B\A4\EA\B0\90\00"
@str = [23 x i8] c"Open Source SW Project\00"
@str.4 = [29 x i8] c"2015244033 2\ED\95\99\EB\85\84 \EC\9E\A5\EC\84\B8\EC\98\81\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, int /*<<< orphan*/ *, int);
u_int64_t rdmsr(u_int32_t msr) {
  u_int64_t result;
  int fd;
  fd = open("/dev/cpu/0/msr", O_RDONLY);
  lseek(fd, msr, SEEK_SET);
  read(fd, &result, 8);
  close(fd);
  return result;
}


x86 assembly (clang, -O0):
<rdmsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
lea    0xea5(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    0x2e68(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1050 <read@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdmsr>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeab(%rip),%rdi
call   1060 <open@plt>
mov    %eax,%ebp
mov    0x2e75(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <lseek@plt>
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
mov    $0x8,%edx
call   1050 <read@plt>
mov    %ebp,%edi
call   1040 <close@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/dev/cpu/0/msr\00"
@O_RDONLY = global i32 0
@SEEK_SET = global i32 0
define i32 @rdmsr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @O_RDONLY
%6 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* @SEEK_SET
%10 = call i32 @lseek(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @read(i32 %11, i32* %3, i32 8)
%13 = load i32, i32* %4
%14 = call i32 @close(i32 %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [15 x i8] c"/dev/cpu/0/msr\00"
@O_RDONLY = global i32 0
@SEEK_SET = global i32 0
define i32 @rdmsr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @lseek(i32 %5, i32 %0, i32 %6)
%8 = call i32 @read(i32 %5, i32* %2, i32 8)
%9 = tail call i32 @close(i32 %5)
%10 = load i32, i32* %2
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ usage(int /*<<< orphan*/ *);
void help(FILE *stream) { usage(stream); }


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

x86 assembly (clang, -O2):
<help>:
jmp    1030 <usage@plt>

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

LLVM IR (-O2):
define void @help(i32* %0) {
%2 = tail call i32 @usage(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("nop\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"nop\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char const *);
void linkname_from_resource_name(char *linkname, const char *name) {
  sprintf(linkname, "%s/drbd-resource-%s.conf", "/var/run/drbd", name);
}


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

x86 assembly (clang, -O2):
<linkname_from_resource_name>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rsi
lea    0xef8(%rip),%rdx
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%s/drbd-resource-%s.conf\00"
@.str.1 = [14 x i8] c"/var/run/drbd\00"
define void @linkname_from_resource_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s/drbd-resource-%s.conf\00"
@.str.1 = [14 x i8] c"/var/run/drbd\00"
define void @linkname_from_resource_name(i8* nocapture writeonly %0, i8* %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help(void) {
  puts("Usage:");
  puts("  vfioctl command device-ids");
  puts("  command :: bind, unbind");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Usage:\00"
@.str.1 = [29 x i8] c" vfioctl command device-ids\00"
@.str.2 = [26 x i8] c" command :: bind, unbind\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Usage:\00"
@.str.1 = [29 x i8] c" vfioctl command device-ids\00"
@.str.2 = [26 x i8] c" command :: bind, unbind\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ twi_send(int /*<<< orphan*/ *, int /*<<< orphan*/);
void twi_send_char(char *data) { twi_send((uint8_t *)data, strlen(data)); }


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

x86 assembly (clang, -O2):
<twi_send_char>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <twi_send@plt>

LLVM IR (-O0):
define void @twi_send_char(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @twi_send(i32* %4, i32 %6)
ret void
}

LLVM IR (-O2):
define void @twi_send_char(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @twi_send(i32* %2, i32 %3)
ret void
}
void addjob(int pid) {}


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

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

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

LLVM IR (-O2):
define void @addjob(i32 %0) {
ret void
}
void map_boot() { (*(unsigned int *)(0x400fc040)) = 0; }


x86 assembly (clang, -O0):
<map_boot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc040,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_boot>:
movl   $0x0,0x400fc040
ret

LLVM IR (-O0):
define void @map_boot() {
store i32 0, i32* inttoptr (i64 1074774080 to i32*)
ret void
}

LLVM IR (-O2):
define void @map_boot() {
store i32 0, i32* inttoptr (i64 1074774080 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Say(char *, int);
void hit(void) { Say("Stop laughing at me, bed!", 1); }


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <Say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <Say@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Stop laughing at me, bed!\00"
define void @hit() {
%1 = call i32 @Say(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Stop laughing at me, bed!\00"
define void @hit() {
%1 = tail call i32 @Say(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
void handler(int siganl) { return; }


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
foo8() {}


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

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

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

LLVM IR (-O2):
define i32 @foo8() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ native_error(char *);
void perform_call(double *args, int num_args) {
  const int NUM_ARGS = -1;
  if (num_args != NUM_ARGS) {
    native_error("Wrong number of generated inputs for {TEST_OBJECT_NAME}");
  }
}


x86 assembly (clang, -O0):
<perform_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
je     113c <perform_call+0x2c>
lea    0xec9(%rip),%rdi
call   1030 <native_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perform_call>:
cmp    $0xffffffff,%esi
je     1121 <perform_call+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <native_error@plt>
ret

LLVM IR (-O0):
@.str = [56 x i8] c"Wrong number of generated inputs for {TEST_OBJECT_NAME}\00"
define void @perform_call(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 -1, i32* %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @native_error(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"Wrong number of generated inputs for {TEST_OBJECT_NAME}\00"
define void @perform_call(double* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, -1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @native_error(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
double fatorial(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double n;
  printf("Digite um número para ser lido o fatorial:");
  scanf("%lf", &n);
  double f = fatorial(n);
  printf("N=%.0lf, F=%.0lf\n", n, f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <fatorial@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeb3(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <fatorial@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
lea    0xec9(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Digite um n\C3\BAmero para ser lido o fatorial:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [18 x i8] c"N=%.0lf, F=%.0lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @fatorial(double %6)
store double %7, double* %3
%8 = load double, double* %2
%9 = load double, double* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %8, double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"Digite um n\C3\BAmero para ser lido o fatorial:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [18 x i8] c"N=%.0lf, F=%.0lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call double @fatorial(double %5)
%7 = load double, double* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %7, double %6)
ret i32 0
}
int test_imm_E2int64_lowword_reg(long long val) {
  return ((val) & (0xE2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E2int64_lowword_reg>:
test   $0xe2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E2int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 226
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dumpdataa(char *, scalar_t__, int /*<<< orphan*/ *);
scalar_t__ strlen(char *);
void dumpstring(char *str, FILE *f) { dumpdataa(str, strlen(str) + 1, f); }


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

x86 assembly (clang, -O2):
<dumpstring>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <dumpdataa@plt>

LLVM IR (-O0):
define void @dumpstring(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = load i32*, i32** %4
%10 = call i32 @dumpdataa(i8* %5, i64 %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @dumpstring(i8* %0, i32* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @dumpdataa(i8* %0, i64 %4, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _tar_error(char const *message, int ret) {
  fputs("tar"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_tar_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tar_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"tar: \00"
@stderr = global i32 0
define i32 @_tar_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rtp2435r_set_last(uint8_t *header) { header[2] |= 0x2; }


x86 assembly (clang, -O0):
<rtp2435r_set_last>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
or     $0x2,%ecx
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp2435r_set_last>:
orb    $0x2,0x8(%rdi)
ret

LLVM IR (-O0):
define void @rtp2435r_set_last(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = or i32 %5, 2
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @rtp2435r_set_last(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = or i32 %3, 2
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *_xmalloc(size_t len) {
  if (len == 0)
    return NULL;
  return malloc(len);
}


x86 assembly (clang, -O0):
<_xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <_xmalloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <_xmalloc+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xmalloc>:
test   %rdi,%rdi
je     111a <_xmalloc+0xa>
jmp    1030 <malloc@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @_xmalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %3
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @_xmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
int /*<<< orphan*/ pmemobj_tx_add_range_direct(void *, size_t);
void *TX_MEMCPY(void *dest, const void *src, size_t num) {
  pmemobj_tx_add_range_direct(dest, num);
  return memcpy(dest, src, num);
}


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

x86 assembly (clang, -O2):
<TX_MEMCPY>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rsi
call   1040 <pmemobj_tx_add_range_direct@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @TX_MEMCPY(i8* returned %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @pmemobj_tx_add_range_direct(i8* %0, i64 %2)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
void __attribute__((transaction_pure, no)) delay(int i) {
  for (volatile int v = 0; v < i; v++)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <delay+0x2d>
jmp    111f <delay+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp),%eax
cmp    %edi,%eax
jge    111f <delay+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store volatile i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load volatile i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load volatile i32, i32* %3
%11 = add nsw i32 %10, 1
store volatile i32 %11, i32* %3
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp slt i32 %4, %0
br i1 %5, label %7, label %6
6: ; preds = %7, %1
ret void
7: ; preds = %1, %7
%8 = load volatile i32, i32* %2
%9 = add nsw i32 %8, 1
store volatile i32 %9, i32* %2
%10 = load volatile i32, i32* %2
%11 = icmp slt i32 %10, %0
br i1 %11, label %7, label %6
}
void X509_get_subject_name(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_get_subject_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ with_system(int, char **);
int main(int argc, char **argv) { with_system(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <with_system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @with_system(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
double *Double_array(int size) {
  return ((double *)malloc((unsigned)(size * sizeof(double))));
}


x86 assembly (clang, -O0):
<Double_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Double_array>:
shl    $0x3,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define double* @Double_array(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 8
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to double*
ret double* %8
}

LLVM IR (-O2):
define double* @Double_array(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to double*
ret double* %4
}
/* Variables and functions */
int /*<<< orphan*/ voronoi(float, float, float, float *, float *, int,
                           int /*<<< orphan*/);
float voronoi_F1S(float x, float y, float z) {
  float da[4], pa[12];
  voronoi(x, y, z, da, pa, 1, 0);
  return (2.0f * da[0] - 1.0f);
}


x86 assembly (clang, -O0):
<voronoi_F1S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    -0x20(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <voronoi@plt>
movss  -0x20(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xea5(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voronoi_F1S>:
sub    $0x48,%rsp
mov    %rsp,%rdi
lea    0x10(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <voronoi@plt>
movss  (%rsp),%xmm0
addss  %xmm0,%xmm0
addss  0xec7(%rip),%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define float @voronoi_F1S(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca [4 x float]
%8 = alloca [12 x float]
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %4
%10 = load float, float* %5
%11 = load float, float* %6
%12 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
%13 = getelementptr inbounds [12 x float], [12 x float]* %8, i64 0, i64 0
%14 = call i32 @voronoi(float %9, float %10, float %11, float* %12, float* %13, i32 1, i32 0)
%15 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
%16 = load float, float* %15
%17 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %16, float -1.000000e+00)
ret float %17
}

LLVM IR (-O2):
define float @voronoi_F1S(float %0, float %1, float %2) {
%4 = alloca [4 x float]
%5 = alloca [12 x float]
%6 = bitcast [4 x float]* %4 to i8*
%7 = bitcast [12 x float]* %5 to i8*
%8 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 0
%9 = getelementptr inbounds [12 x float], [12 x float]* %5, i64 0, i64 0
%10 = call i32 @voronoi(float %0, float %1, float %2, float* %8, float* %9, i32 1, i32 0)
%11 = load float, float* %8
%12 = call float @llvm.fmuladd.f32(float %11, float 2.000000e+00, float -1.000000e+00)
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) { printf("Usage: mkdir [ -m MODE ] DIR ...\n"); }


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"Usage: mkdir [ -m MODE ] DIR ...\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int,
                                          struct wl_resource *);
void wl_surface_send_leave(struct wl_resource *resource_,
                           struct wl_resource *output) {
  wl_resource_post_event(resource_, 1, output);
}


x86 assembly (clang, -O0):
<wl_surface_send_leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1030 <wl_resource_post_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_surface_send_leave>:
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_surface_send_leave(%struct.wl_resource* %0, %struct.wl_resource* %1) {
%3 = alloca %struct.wl_resource*
%4 = alloca %struct.wl_resource*
store %struct.wl_resource* %0, %struct.wl_resource** %3
store %struct.wl_resource* %1, %struct.wl_resource** %4
%5 = load %struct.wl_resource*, %struct.wl_resource** %3
%6 = load %struct.wl_resource*, %struct.wl_resource** %4
%7 = call i32 @wl_resource_post_event(%struct.wl_resource* %5, i32 1, %struct.wl_resource* %6)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_surface_send_leave(%struct.wl_resource* %0, %struct.wl_resource* %1) {
%3 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 1, %struct.wl_resource* %1)
ret void
}
int main() {
  int a[1048];
  while (a[1 + 2] >= 0) {
    a[3] = a[2 + 1] - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xff0,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x1064(%rbp)
jl     1133 <main+0x33>
mov    -0x1064(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1064(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
add    $0xff0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1048 x i32]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [1048 x i32], [1048 x i32]* %2, i64 0, i64 3
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = getelementptr inbounds [1048 x i32], [1048 x i32]* %2, i64 0, i64 3
%9 = load i32, i32* %8
%10 = sub nsw i32 %9, 1
%11 = getelementptr inbounds [1048 x i32], [1048 x i32]* %2, i64 0, i64 3
store i32 %10, i32* %11
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func1(double);
int func3();
void func2() {
  double g = 3.2;
  float f;
  int t = g;
  int p;
  p = f;
  func1(g);
  char c = f;
  size_t s;
  p = s;
  int q;
  q = func3();
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movabs $0x400999999999999a,%rax
99 09 40
mov    %rax,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <func1@plt>
movss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x15(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <func3@plt>
mov    %eax,-0x24(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <func1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <func3@plt>

LLVM IR (-O0):
define void @func2() {
%1 = alloca double
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i64
%7 = alloca i32
store double 3.200000e+00, double* %1
%8 = load double, double* %1
%9 = fptosi double %8 to i32
store i32 %9, i32* %3
%10 = load float, float* %2
%11 = fptosi float %10 to i32
store i32 %11, i32* %4
%12 = load double, double* %1
%13 = call i32 @func1(double %12)
%14 = load float, float* %2
%15 = fptosi float %14 to i8
store i8 %15, i8* %5
%16 = load i64, i64* %6
%17 = trunc i64 %16 to i32
store i32 %17, i32* %4
%18 = call i32 (...) @func3()
store i32 %18, i32* %7
ret void
}

LLVM IR (-O2):
define void @func2() {
%1 = tail call i32 @func1(double 3.200000e+00)
%2 = tail call i32 (...) @func3()
ret void
}
int read_entry(int fd, char *buf, int len) {
  int ret;
  do {
  } while (0);
  ret = read(fd, buf, len);
  if (ret < 0) {
    printf("ERROR: %s: read returned %i\n", __func__, ret);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<read_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
jmp    1137 <read_entry+0x17>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1040 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1179 <read_entry+0x59>
mov    -0x18(%rbp),%edx
lea    0xea1(%rip),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <read_entry+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_entry>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <read@plt>
test   %eax,%eax
jns    114a <read_entry+0x2a>
lea    0xecb(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"ERROR: %s: read returned %i\0A\00"
@__func__.read_entry = [11 x i8] c"read_entry\00"
define i32 @read_entry(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
br label %9
9: ; preds = %3
br label %10
10: ; preds = %9
%11 = load i32, i32* %5
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 %11, i8* %12, i32 %13)
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = load i32, i32* %8
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.read_entry, i64 0, i64 0), i32 %18)
store i32 -1, i32* %4
br label %21
20: ; preds = %10
store i32 0, i32* %4
br label %21
21: ; preds = %20, %17
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@.str = [29 x i8] c"ERROR: %s: read returned %i\0A\00"
@__func__.read_entry = [11 x i8] c"read_entry\00"
define i32 @read_entry(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.read_entry, i64 0, i64 0), i32 %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ -1, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void sighandler(__attribute__((unused)) int signal) { _exit(0); }


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sighandler(i32 %0) {
%2 = tail call i32 @_exit(i32 0)
unreachable
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
int /*<<< orphan*/ addch(char);
void rep(char c, int8_t n) {
  for (int8_t i = 0; i < n; ++i)
    addch(c);
}


x86 assembly (clang, -O0):
<rep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1152 <rep+0x42>
movsbl -0x1(%rbp),%edi
call   1030 <addch@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112a <rep+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rep>:
push   %rbp
push   %rbx
push   %rax
test   %rsi,%rsi
jle    112d <rep+0x1d>
mov    %rsi,%rbx
movsbl %dil,%ebp
nop
mov    %ebp,%edi
call   1030 <addch@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <rep+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @rep(i8 signext %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @addch(i8 signext %0)
%8 = add nuw nsw i64 %6, 1
%9 = icmp eq i64 %8, %1
br i1 %9, label %4, label %5
}
int test_imm_25uint16_mem(unsigned short *val) {
  return ((*val) & (0x25 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_25uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 37
%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_25uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 37
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ types;

/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int is_c_type(char *t, char *types[]) {
  int type_len = sizeof(types) / sizeof(char *);
  int i;
  for (i = 0; i < type_len; i++) {
    if (strcmp(t, types[i]) == 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_c_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1178 <is_c_type+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1165 <is_c_type+0x55>
movl   $0x1,-0x4(%rbp)
jmp    117f <is_c_type+0x6f>
jmp    116a <is_c_type+0x5a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112e <is_c_type+0x1e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_c_type(i8* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @strcmp(i8* %0, i8* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int DL_BeginDownload(char *localName, const char *remoteName) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @DL_BeginDownload(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
int cmp_llu(const void *a, const void *b) {
  if (*(unsigned long long *)a < *(unsigned long long *)b)
    return -1;
  if (*(unsigned long long *)a > *(unsigned long long *)b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_llu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jae    112c <cmp_llu+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <cmp_llu+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jbe    114c <cmp_llu+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <cmp_llu+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_llu>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_llu(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp ult i64 %4, %6
%8 = icmp ugt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void arm_mrrc() {}


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

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

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

LLVM IR (-O2):
define void @arm_mrrc() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int Command_IsCdOut(char *command) { return strcmp(command, "cd..") == 0; }


x86 assembly (clang, -O0):
<Command_IsCdOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Command_IsCdOut>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"cd..\00"
define i32 @Command_IsCdOut(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"cd..\00"
define i32 @Command_IsCdOut(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}