xunge/DecIR huggingface dataset:
/* Variables and functions */
int minDistance(char const *, char const *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  const char *p1 = "intention";
  const char *p2 = "execution";
  printf("minDistance = %d\n", minDistance(p1, p2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <minDistance@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <minDistance@plt>
lea    0xed9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"intention\00"
@.str.1 = [10 x i8] c"execution\00"
@.str.2 = [18 x i8] c"minDistance = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @minDistance(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int hash32_partial_unicode(int const *, size_t);
uint32_t hash32_partial_unicode_prefix(const uint32_t *p, size_t len,
                                       size_t prefix_len, size_t min_stem) {
  if (min_stem + prefix_len > len)
    return 0x719986aa;
  return hash32_partial_unicode(p, prefix_len);
}


x86 assembly (clang, -O0):
<hash32_partial_unicode_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1146 <hash32_partial_unicode_prefix+0x36>
movl   $0x719986aa,-0x4(%rbp)
jmp    1156 <hash32_partial_unicode_prefix+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <hash32_partial_unicode@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash32_partial_unicode_prefix>:
add    %rdx,%rcx
cmp    %rsi,%rcx
jbe    111e <hash32_partial_unicode_prefix+0xe>
mov    $0x719986aa,%eax
ret
mov    %rdx,%rsi
jmp    1030 <hash32_partial_unicode@plt>

LLVM IR (-O0):
define i32 @hash32_partial_unicode_prefix(i32* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i32* %0, i32** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
%10 = load i64, i64* %9
%11 = load i64, i64* %8
%12 = add i64 %10, %11
%13 = load i64, i64* %7
%14 = icmp ugt i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %4
store i32 1905886890, i32* %5
br label %20
16: ; preds = %4
%17 = load i32*, i32** %6
%18 = load i64, i64* %8
%19 = call i32 @hash32_partial_unicode(i32* %17, i64 %18)
store i32 %19, i32* %5
br label %20
20: ; preds = %16, %15
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @hash32_partial_unicode_prefix(i32* %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %3, %2
%6 = icmp ugt i64 %5, %1
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @hash32_partial_unicode(i32* %0, i64 %2)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ 1905886890, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ perror(char const *);
void *xmalloc(size_t size, const char *caller) {
  void *thing;
  thing = malloc(size);
  if (!thing) {
    perror(caller);
    exit(-1);
  }
  return thing;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116b <xmalloc+0x3b>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rsi,%rbx
call   1030 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0, i8* nocapture %1) {
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* %1)
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int func();
int callfunc() { return func(); }


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

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

LLVM IR (-O0):
define i32 @callfunc() {
%1 = call i32 (...) @func()
ret i32 %1
}

LLVM IR (-O2):
define i32 @callfunc() {
%1 = tail call i32 (...) @func()
ret i32 %1
}
unsigned char *file_cache(int len) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @file_cache(i32 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ O_CREAT;
int /*<<< orphan*/ S_IRWXU;
int open(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ read(int, char *, int);
int call_read() {
  int fd = open("/dev/mdev", O_CREAT, S_IRWXU);
  char buf[10] = {0};
  read(fd, buf, 10);
  printf("read [%s]\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<call_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
lea    0xe9f(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0xe(%rbp),%rsi
mov    $0xa,%edx
call   1050 <read@plt>
lea    -0xe(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_read>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    0xeb2(%rip),%rdi
call   1050 <open@plt>
movw   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
mov    %rsp,%rbx
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1040 <read@plt>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/mdev\00"
@O_CREAT = global i32 0
@S_IRWXU = global i32 0
@.str.1 = [11 x i8] c"read [%s]\0A\00"
define i32 @call_read() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = load i32, i32* @O_CREAT
%4 = load i32, i32* @S_IRWXU
%5 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
store i32 %5, i32* %1
%6 = bitcast [10 x i8]* %2 to i8*
%7 = load i32, i32* %1
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = call i32 @read(i32 %7, i8* %8, i32 10)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/mdev\00"
@O_CREAT = global i32 0
@S_IRWXU = global i32 0
@.str.1 = [11 x i8] c"read [%s]\0A\00"
define i32 @call_read() {
%1 = alloca [10 x i8]
%2 = load i32, i32* @O_CREAT
%3 = load i32, i32* @S_IRWXU
%4 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%6 = call i32 @read(i32 %4, i8* %5, i32 10)
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
double fabs(double);
int doubleeq(double a, double b) {
  if (fabs(a - b) < 0.000000001) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<doubleeq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movaps 0xef1(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1141 <doubleeq+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <doubleeq+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleeq>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
movsd  0xefc(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @doubleeq(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fsub double %6, %7
%9 = call double @llvm.fabs.f64(double %8)
%10 = fcmp olt double %9, 1.000000e-09
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @doubleeq(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = fcmp olt double %4, 1.000000e-09
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct qcow_header {
  int dummy;
};
struct qcow2_header {
  int dummy;
};
struct bdev {
  int dummy;
};

/* Variables and functions */
int qcow_setup_backing_file(struct bdev *, struct qcow_header *);
int qcow2_setup_backing_file(struct bdev *bdev, struct qcow2_header *header) {
  return qcow_setup_backing_file(bdev, (struct qcow_header *)header);
}


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

x86 assembly (clang, -O2):
<qcow2_setup_backing_file>:
jmp    1030 <qcow_setup_backing_file@plt>

LLVM IR (-O0):
%struct.bdev = type { i32 }
%struct.qcow2_header = type { i32 }
%struct.qcow_header = type { i32 }
define i32 @qcow2_setup_backing_file(%struct.bdev* %0, %struct.qcow2_header* %1) {
%3 = alloca %struct.bdev*
%4 = alloca %struct.qcow2_header*
store %struct.bdev* %0, %struct.bdev** %3
store %struct.qcow2_header* %1, %struct.qcow2_header** %4
%5 = load %struct.bdev*, %struct.bdev** %3
%6 = load %struct.qcow2_header*, %struct.qcow2_header** %4
%7 = bitcast %struct.qcow2_header* %6 to %struct.qcow_header*
%8 = call i32 @qcow_setup_backing_file(%struct.bdev* %5, %struct.qcow_header* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.bdev = type { i32 }
%struct.qcow2_header = type { i32 }
%struct.qcow_header = type { i32 }
define i32 @qcow2_setup_backing_file(%struct.bdev* %0, %struct.qcow2_header* %1) {
%3 = bitcast %struct.qcow2_header* %1 to %struct.qcow_header*
%4 = tail call i32 @qcow_setup_backing_file(%struct.bdev* %0, %struct.qcow_header* %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ cpuid_exec_gcc_x86_64(int /*<<< orphan*/,
                                         int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ *);
void cpuid_exec(uint32_t val, uint32_t *eax, uint32_t *ebx, uint32_t *ecx,
                uint32_t *edx) {
  cpuid_exec_gcc_x86_64(val, eax, ebx, ecx, edx);
}


x86 assembly (clang, -O0):
<cpuid_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <cpuid_exec_gcc_x86_64@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_exec>:
jmp    1030 <cpuid_exec_gcc_x86_64@plt>

LLVM IR (-O0):
define void @cpuid_exec(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* %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @cpuid_exec_gcc_x86_64(i32 %11, i32* %12, i32* %13, i32* %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @cpuid_exec(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @cpuid_exec_gcc_x86_64(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int open(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int open_X(const char *pathname, int flags, mode_t mode) {
  int fd = open(pathname, flags, mode);
  if (fd == -1) {
    do {
      perror("open");
      exit(EXIT_FAILURE);
    } while (0);
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_X>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    117d <open_X+0x4d>
jmp    1163 <open_X+0x33>
lea    0xe96(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_X>:
push   %rax
call   1030 <open@plt>
cmp    $0xffffffff,%eax
je     113d <open_X+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"open\00"
@EXIT_FAILURE = global i32 0
define i32 @open_X(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @open(i8* %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %20
14: ; preds = %3
br label %15
15: ; preds = %14
%16 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; No predecessors!
br label %20
20: ; preds = %19, %3
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
@.str = [5 x i8] c"open\00"
@EXIT_FAILURE = global i32 0
define i32 @open_X(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *ret;
  if ((ret = malloc(size)) == 0) {
    fprintf(stderr, "make: can't allocate %u bytes\n", size);
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1176 <xmalloc+0x46>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"make: can't allocate %u bytes\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i64, i64* %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"make: can't allocate %u bytes\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
void verticesQuadrado(int COORDQuadrado[9], int ladoQuadrado,
                      int espacoEntreQuadrado) {
  int i;
  for (i = 0; i < 9; i++) {
    COORDQuadrado[i] = (i * ladoQuadrado) + espacoEntreQuadrado;
  }
}


x86 assembly (clang, -O0):
<verticesQuadrado>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jge    1142 <verticesQuadrado+0x42>
mov    -0x14(%rbp),%edx
imul   -0xc(%rbp),%edx
add    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <verticesQuadrado+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<verticesQuadrado>:
mov    %edx,(%rdi)
lea    (%rsi,%rdx,1),%eax
mov    %eax,0x4(%rdi)
lea    (%rdx,%rsi,2),%eax
mov    %eax,0x8(%rdi)
lea    (%rsi,%rsi,2),%eax
lea    (%rax,%rdx,1),%ecx
mov    %ecx,0xc(%rdi)
lea    (%rdx,%rsi,4),%ecx
mov    %ecx,0x10(%rdi)
lea    (%rsi,%rsi,4),%ecx
add    %edx,%ecx
mov    %ecx,0x14(%rdi)
lea    (%rdx,%rax,2),%eax
mov    %eax,0x18(%rdi)
lea    0x0(,%rsi,8),%eax
sub    %esi,%eax
add    %edx,%eax
mov    %eax,0x1c(%rdi)
lea    (%rdx,%rsi,8),%eax
mov    %eax,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @verticesQuadrado(i32* nocapture writeonly %0, i32 %1, i32 %2) {
store i32 %2, i32* %0
%4 = add nsw i32 %1, %2
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
%6 = shl nsw i32 %1, 1
%7 = add nsw i32 %6, %2
%8 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %7, i32* %8
%9 = mul nsw i32 %1, 3
%10 = add nsw i32 %9, %2
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
%12 = shl nsw i32 %1, 2
%13 = add nsw i32 %12, %2
%14 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %13, i32* %14
%15 = mul nsw i32 %1, 5
%16 = add nsw i32 %15, %2
%17 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %16, i32* %17
%18 = mul nsw i32 %1, 6
%19 = add nsw i32 %18, %2
%20 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %19, i32* %20
%21 = mul nsw i32 %1, 7
%22 = add nsw i32 %21, %2
%23 = getelementptr inbounds i32, i32* %0, i64 7
store i32 %22, i32* %23
%24 = shl nsw i32 %1, 3
%25 = add nsw i32 %24, %2
%26 = getelementptr inbounds i32, i32* %0, i64 8
store i32 %25, i32* %26
ret void
}
int f14(int x, int y) {
  if (y < -1)
    return x % -y;
  return 34;
}


x86 assembly (clang, -O0):
<f14>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jge    1127 <f14+0x27>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    112e <f14+0x2e>
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f14>:
mov    $0x22,%eax
cmp    $0xfffffffe,%esi
jg     1113 <f14+0x13>
neg    %esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f14(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = sub nsw i32 0, %10
%12 = srem i32 %9, %11
store i32 %12, i32* %3
br label %14
13: ; preds = %2
store i32 34, i32* %3
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @f14(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, -1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = sub nsw i32 0, %1
%6 = srem i32 %0, %5
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 34, %2 ]
ret i32 %8
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
long xstrtoll_range_sfx(char const *, int, long, long,
                        struct suffix_mult const *);
long xstrtol_range_sfx(const char *str, int b, long l, long u,
                       const struct suffix_mult *sfx) {
  return xstrtoll_range_sfx(str, b, l, u, sfx);
}


x86 assembly (clang, -O0):
<xstrtol_range_sfx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <xstrtoll_range_sfx@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrtol_range_sfx>:
jmp    1030 <xstrtoll_range_sfx@plt>

LLVM IR (-O0):
%struct.suffix_mult = type { i32 }
define i64 @xstrtol_range_sfx(i8* %0, i32 %1, i64 %2, i64 %3, %struct.suffix_mult* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca %struct.suffix_mult*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store %struct.suffix_mult* %4, %struct.suffix_mult** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load %struct.suffix_mult*, %struct.suffix_mult** %10
%16 = call i64 @xstrtoll_range_sfx(i8* %11, i32 %12, i64 %13, i64 %14, %struct.suffix_mult* %15)
ret i64 %16
}

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i64 @xstrtol_range_sfx(i8* %0, i32 %1, i64 %2, i64 %3, %struct.suffix_mult* %4) {
%6 = tail call i64 @xstrtoll_range_sfx(i8* %0, i32 %1, i64 %2, i64 %3, %struct.suffix_mult* %4)
ret i64 %6
}
void ima_inode_post_setattr(struct dentry *dentry) { return; }


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

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

LLVM IR (-O0):
%struct.dentry = type opaque
define void @ima_inode_post_setattr(%struct.dentry* %0) {
%2 = alloca %struct.dentry*
store %struct.dentry* %0, %struct.dentry** %2
ret void
}

LLVM IR (-O2):
%struct.dentry = type opaque
define void @ima_inode_post_setattr(%struct.dentry* nocapture %0) {
ret void
}
unsigned xrop3_255_0_0(unsigned char s, unsigned char t) {
  unsigned stk1;
  stk1 = 0xffff;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_255_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xrop3_255_0_0(i8 zeroext %0, i8 zeroext %1) {
ret i32 65535
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void die_errno(int err, const char *fmt, ...) { __coverity_panic__(); }


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

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

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

LLVM IR (-O2):
define void @die_errno(i32 %0, i8* nocapture readnone %1, ...) {
%3 = tail call i32 (...) @__coverity_panic__()
ret void
}
int main(void) {
  int *i = (int *)"not a number";
  *i = 0xdead;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xdead,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"not a number\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* bitcast ([13 x i8]* @.str to i32*), i32** %2
%3 = load i32*, i32** %2
store i32 57005, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int lockd_init_vg(struct cmd_context *cmd, struct volume_group *vg,
                  const char *lock_type, int lv_lock_count) {
  return 1;
}


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

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

LLVM IR (-O0):
%struct.cmd_context = type opaque
%struct.volume_group = type opaque
define i32 @lockd_init_vg(%struct.cmd_context* %0, %struct.volume_group* %1, i8* %2, i32 %3) {
%5 = alloca %struct.cmd_context*
%6 = alloca %struct.volume_group*
%7 = alloca i8*
%8 = alloca i32
store %struct.cmd_context* %0, %struct.cmd_context** %5
store %struct.volume_group* %1, %struct.volume_group** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 1
}

LLVM IR (-O2):
%struct.cmd_context = type opaque
%struct.volume_group = type opaque
define i32 @lockd_init_vg(%struct.cmd_context* nocapture readnone %0, %struct.volume_group* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 1
}
/* Variables and functions */
int yogrt_remaining();
int iyogrt_remaining__(void) { return yogrt_remaining(); }


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

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

LLVM IR (-O0):
define i32 @iyogrt_remaining__() {
%1 = call i32 (...) @yogrt_remaining()
ret i32 %1
}

LLVM IR (-O2):
define i32 @iyogrt_remaining__() {
%1 = tail call i32 (...) @yogrt_remaining()
ret i32 %1
}
int w2t(float f) { return f; }


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

x86 assembly (clang, -O2):
<w2t>:
cvttss2si %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @w2t(float %0) {
%2 = fptosi float %0 to i32
ret i32 %2
}
void __attribute__((visibility("default"))) test2(void) {}


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

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

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

LLVM IR (-O2):
define void @test2() {
ret void
}
/* Variables and functions */
float log2f(float);
void __hv_log2_f(float bIn, float *bOut) {
  *bOut = (bIn > 0.0f) ? log2f(bIn) : 0.0f;
}


x86 assembly (clang, -O0):
<__hv_log2_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1146 <__hv_log2_f+0x36>
movss  -0x4(%rbp),%xmm0
call   1030 <log2f@plt>
movss  %xmm0,-0x14(%rbp)
jmp    1153 <__hv_log2_f+0x43>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1153 <__hv_log2_f+0x43>
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_log2_f>:
push   %rbx
mov    %rdi,%rbx
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jbe    1127 <__hv_log2_f+0x17>
movaps %xmm1,%xmm0
call   1030 <log2f@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @__hv_log2_f(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = fcmp ogt float %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load float, float* %3
%9 = call float @log2f(float %8)
br label %11
10: ; preds = %2
br label %11
11: ; preds = %10, %7
%12 = phi float [ %9, %7 ], [ 0.000000e+00, %10 ]
%13 = load float*, float** %4
store float %12, float* %13
ret void
}

LLVM IR (-O2):
define void @__hv_log2_f(float %0, float* nocapture writeonly %1) {
%3 = fcmp ogt float %0, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call float @log2f(float %0)
br label %6
6: ; preds = %2, %4
%7 = phi float [ %5, %4 ], [ 0.000000e+00, %2 ]
store float %7, float* %1
ret void
}
/* Type definitions */
struct timex {
  long tai;
};

/* Variables and functions */
long getter_tai(const struct timex *txc) { return txc->tai; }


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

x86 assembly (clang, -O2):
<getter_tai>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.timex = type { i64 }
define i64 @getter_tai(%struct.timex* %0) {
%2 = alloca %struct.timex*
store %struct.timex* %0, %struct.timex** %2
%3 = load %struct.timex*, %struct.timex** %2
%4 = getelementptr inbounds %struct.timex, %struct.timex* %3, i32 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
%struct.timex = type { i64 }
define i64 @getter_tai(%struct.timex* nocapture %0) {
%2 = getelementptr inbounds %struct.timex, %struct.timex* %0, i64 0, i32 0
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(int **);
void stable_sort_delete_buffer(int **pointer) { free(pointer); }


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

x86 assembly (clang, -O2):
<stable_sort_delete_buffer>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @stable_sort_delete_buffer(i32** nocapture %0) {
%2 = tail call i32 @free(i32** %0)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int eq_cstr(const char *a, const char *b) { return 0 == strcmp(a, b); }


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

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

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

LLVM IR (-O2):
define i32 @eq_cstr(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
void make_socket_nonblocking(int sockfd) {
  int flag;
  flag = fcntl(sockfd, F_GETFL, 0);
  fcntl(sockfd, F_SETFL, flag | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<make_socket_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_socket_nonblocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @make_socket_nonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %9, %10
%12 = call i32 @fcntl(i32 %7, i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @make_socket_nonblocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ creat_IDT(int, int, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ int_keyboard;
int /*<<< orphan*/ open_8259(int);
void init_keyboard(void) {
  extern int_keyboard;
  creat_IDT(0x21, 8, (&int_keyboard), 0x600 + 0x800 + 0x00 + 0x8000);
  open_8259(1);
}


x86 assembly (clang, -O0):
<init_keyboard>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
mov    $0x8,%esi
mov    0x2ec3(%rip),%rdx
mov    $0x8e00,%ecx
call   1040 <creat_IDT@plt>
mov    $0x1,%edi
call   1030 <open_8259@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_keyboard>:
push   %rax
mov    0x2ed0(%rip),%rdx
mov    $0x21,%edi
mov    $0x8,%esi
mov    $0x8e00,%ecx
call   1040 <creat_IDT@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <open_8259@plt>

LLVM IR (-O0):
@int_keyboard = global i32 0
define void @init_keyboard() {
%1 = call i32 @creat_IDT(i32 33, i32 8, i32* @int_keyboard, i32 36352)
%2 = call i32 @open_8259(i32 1)
ret void
}

LLVM IR (-O2):
@int_keyboard = global i32 0
define void @init_keyboard() {
%1 = tail call i32 @creat_IDT(i32 33, i32 8, i32* @int_keyboard, i32 36352)
%2 = tail call i32 @open_8259(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgpushlit(int n) { ngen("%s\t$%d", "pushq", n); }


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

x86 assembly (clang, -O2):
<cgpushlit>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s\09$%d\00"
@.str.1 = [6 x i8] c"pushq\00"
define void @cgpushlit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s\09$%d\00"
@.str.1 = [6 x i8] c"pushq\00"
define void @cgpushlit(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct ble_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void sky_ble_endian_swap(struct ble_t *p) {
  assert(p != NULL);
  ;
  ;
}


x86 assembly (clang, -O0):
<sky_ble_endian_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sky_ble_endian_swap>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.ble_t = type { i32 }
define void @sky_ble_endian_swap(%struct.ble_t* %0) {
%2 = alloca %struct.ble_t*
store %struct.ble_t* %0, %struct.ble_t** %2
%3 = load %struct.ble_t*, %struct.ble_t** %2
%4 = icmp ne %struct.ble_t* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.ble_t = type { i32 }
define void @sky_ble_endian_swap(%struct.ble_t* readnone %0) {
%2 = icmp ne %struct.ble_t* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
void file4() { printf("Control in function %s\n", __func__); }


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

x86 assembly (clang, -O2):
<file4>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file4 = [6 x i8] c"file4\00"
define void @file4() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file4 = [6 x i8] c"file4\00"
define void @file4() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file4, i64 0, i64 0))
ret void
}
__typeof__(vfprintf(1, (void *)1)) test_vfprintf_266(void) {
  return vfprintf(1, (void *)1);
}


x86 assembly (clang, -O0):
<test_vfprintf_266>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <vfprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vfprintf_266>:
mov    $0x1,%esi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <vfprintf@plt>

LLVM IR (-O0):
define i32 @test_vfprintf_266() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @vfprintf to i32 (i32, i8*, ...)*)(i32 1, i8* inttoptr (i64 1 to i8*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_vfprintf_266() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @vfprintf to i32 (i32, i8*, ...)*)(i32 1, i8* inttoptr (i64 1 to i8*))
ret i32 %1
}
int main(void) {
  static int i;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@main.i = internal global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void SysCtlDeepSleepClockSet(unsigned long ulConfig) {
  (*((volatile unsigned long *)(0x400FE144))) = ulConfig;
}


x86 assembly (clang, -O0):
<SysCtlDeepSleepClockSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fe144,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlDeepSleepClockSet>:
mov    %rdi,0x400fe144
40
ret

LLVM IR (-O0):
define void @SysCtlDeepSleepClockSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074782532 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlDeepSleepClockSet(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074782532 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_storel_pi(int /*<<< orphan*/ *, int /*<<< orphan*/);
void test_mm_storel_pi(__m64 *x, __m128 y) { _mm_storel_pi(x, y); }


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

x86 assembly (clang, -O2):
<test_mm_storel_pi>:
jmp    1030 <_mm_storel_pi@plt>

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

LLVM IR (-O2):
define void @test_mm_storel_pi(i32* %0, i32 %1) {
%3 = tail call i32 @_mm_storel_pi(i32* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ const *);
char *ctime(const time_t *timep) { return asctime(localtime(timep)); }


x86 assembly (clang, -O0):
<ctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime>:
push   %rax
call   1030 <localtime@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <asctime@plt>

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

LLVM IR (-O2):
define i8* @ctime(i32* %0) {
%2 = tail call i32 @localtime(i32* %0)
%3 = tail call i8* @asctime(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UARTFIFODisable(unsigned long ulBase) {
  DEBUG_ASSERT(UARTBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) &= ~(0x00000010);
}


x86 assembly (clang, -O0):
<UARTFIFODisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rcx
and    $0xffffffffffffffef,%rcx
mov    %rcx,0x2c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFODisable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
andq   $0xffffffffffffffef,0x2c(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @UARTFIFODisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @UARTBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 44
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, -17
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @UARTFIFODisable(i64 %0) {
%2 = tail call i32 @UARTBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 44
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -17
store volatile i64 %7, i64* %5
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ mem_write_ramw(int, int /*<<< orphan*/, void *);
void ps2_write_shadow_ramw(uint32_t addr, uint16_t val, void *priv) {
  addr = (addr & 0x1ffff) + 0xe0000;
  mem_write_ramw(addr, val, priv);
}


x86 assembly (clang, -O0):
<ps2_write_shadow_ramw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1ffff,%eax
add    $0xe0000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <mem_write_ramw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps2_write_shadow_ramw>:
and    $0x1ffff,%edi
or     $0xe0000,%edi
jmp    1030 <mem_write_ramw@plt>

LLVM IR (-O0):
define void @ps2_write_shadow_ramw(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = and i32 %7, 131071
%9 = add nsw i32 %8, 917504
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i8*, i8** %6
%13 = call i32 @mem_write_ramw(i32 %10, i32 %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @ps2_write_shadow_ramw(i32 %0, i32 %1, i8* %2) {
%4 = and i32 %0, 131071
%5 = or i32 %4, 917504
%6 = tail call i32 @mem_write_ramw(i32 %5, i32 %1, i8* %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
uint8_t sub8(uint8_t i, uint8_t j) {
  int16_t t = i - j;
  return t;
}


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

x86 assembly (clang, -O2):
<sub8>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @sub8(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* %3
%7 = load i64, i64* %4
%8 = sub nsw i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @sub8(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}