xunge/DecIR huggingface dataset:
AX0RX1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((((unsigned char *)10000000)[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movzbl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jg     114b <AX0RX1+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <AX0RX1+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0RX1>:
movslq %edx,%rax
mov    0x989680(%rax),%dl
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,1),%dl
setbe  %al
ret

LLVM IR (-O0):
define i32 @AX0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = load i8*, i8** %13
%22 = load i32, i32* %11
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = icmp sle i32 %20, %26
br i1 %27, label %28, label %29
28: ; preds = %6
store i32 1, i32* %7
br label %30
29: ; preds = %6
store i32 0, i32* %7
br label %30
30: ; preds = %29, %28
%31 = load i32, i32* %7
ret i32 %31
}

LLVM IR (-O2):
define i32 @AX0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %7
%9 = load i8, i8* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i8, i8* %5, i64 %10
%12 = load i8, i8* %11
%13 = icmp ule i8 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int syscall(int, char const *, unsigned int);
int memfd_create(const char *name, unsigned flags) {
  return syscall(385, name, flags);
}


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

x86 assembly (clang, -O2):
<memfd_create>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x181,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @memfd_create(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 i32, i32* %4
%7 = call i32 @syscall(i32 385, i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @memfd_create(i8* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 385, i8* %0, i32 %1)
ret i32 %3
}
int isupper(int ch) { return ch >= 'A' && ch <= 'Z'; }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_faceids(char *);
void fgmvwrite_faceids_(char *faceids) { gmvwrite_faceids(faceids); }


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

x86 assembly (clang, -O2):
<fgmvwrite_faceids_>:
jmp    1030 <gmvwrite_faceids@plt>

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

LLVM IR (-O2):
define void @fgmvwrite_faceids_(i8* %0) {
%2 = tail call i32 @gmvwrite_faceids(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fs_path_op(void *, void *, void *, int);
int dir_del(unsigned char *dir) {
  int retval;
  fs_path_op((void *)dir, (void *)0, (void *)&retval, 2);
  return retval;
}


x86 assembly (clang, -O0):
<dir_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%ecx
call   1030 <fs_path_op@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_del>:
push   %rax
lea    0x4(%rsp),%rdx
xor    %esi,%esi
mov    $0x2,%ecx
call   1030 <fs_path_op@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @dir_del(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fs_path_op(i8* %0, i8* null, i8* %3, i32 2)
%5 = load i32, i32* %2
ret i32 %5
}
int _spawnvp(int pmode, const char *path, const char *const argv[]) {
  int pid;
  if (pid = fork()) {
    return pid;
  }
  execvp(path, (char *const *const)argv);
  exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<_spawnvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     115f <_spawnvp+0x2f>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <execvp@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_spawnvp>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
je     114d <_spawnvp+0x1d>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <execvp@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @_spawnvp(i32 %0, i8* %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%8 = call i32 (...) @fork()
store i32 %8, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %7
ret i32 %11
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i8**, i8*** %6
%15 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @execvp to i32 (i8*, i8**, ...)*)(i8* %13, i8** %14)
unreachable
}

LLVM IR (-O2):
define i32 @_spawnvp(i32 %0, i8* %1, i8** %2) {
%4 = tail call i32 (...) @fork()
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3
ret i32 %4
7: ; preds = %3
%8 = tail call i32 (i8*, i8**, ...) bitcast (i32 (...)* @execvp to i32 (i8*, i8**, ...)*)(i8* %1, i8** %2)
tail call void @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool utf8_check_1(uint8_t *data) {
  if ((data[0] == 0x09) || (data[0] == 0x0A) || (data[0] == 0x0D) ||
      (data[0] <= 0x7F)) {
    return (true);
  }
  return (false);
}


x86 assembly (clang, -O0):
<utf8_check_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x9,(%rax)
je     113c <utf8_check_1+0x3c>
mov    -0x10(%rbp),%rax
cmpl   $0xa,(%rax)
je     113c <utf8_check_1+0x3c>
mov    -0x10(%rbp),%rax
cmpl   $0xd,(%rax)
je     113c <utf8_check_1+0x3c>
mov    -0x10(%rbp),%rax
cmpl   $0x7f,(%rax)
jg     1148 <utf8_check_1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <utf8_check_1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_check_1>:
mov    (%rdi),%ecx
cmp    $0xd,%ecx
ja     1117 <utf8_check_1+0x17>
mov    $0x1,%eax
mov    $0x2600,%edx
bt     %ecx,%edx
jae    1117 <utf8_check_1+0x17>
ret
xor    %eax,%eax
cmp    $0x80,%ecx
setl   %al
ret

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

LLVM IR (-O2):
define i32 @utf8_check_1(i32* nocapture %0) {
%2 = load i32, i32* %0
switch i32 %2, label %3 [
i32 9, label %6
i32 10, label %6
i32 13, label %6
]
3: ; preds = %1
%4 = icmp slt i32 %2, 128
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %3, %1, %1, %1
%7 = phi i32 [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ %5, %3 ]
ret i32 %7
}
/* Variables and functions */
int vmemAllocString(char *, int);
int /*<<< orphan*/ vmemPush(int);
void sysCtoa(int c) {
  unsigned char res[1];
  res[0] = c;
  vmemPush((1 + ((vmemAllocString((char *)res, 1)) << 1)));
}


x86 assembly (clang, -O0):
<sysCtoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
lea    -0x5(%rbp),%rdi
mov    $0x1,%esi
call   1030 <vmemAllocString@plt>
mov    %eax,%edi
shl    $0x1,%edi
add    $0x1,%edi
call   1040 <vmemPush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysCtoa>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <vmemAllocString@plt>
lea    (%rax,%rax,1),%edi
add    $0x1,%edi
call   1040 <vmemPush@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @sysCtoa(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 %5, i8* %6
%7 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%8 = call i32 @vmemAllocString(i8* %7, i32 1)
%9 = shl i32 %8, 1
%10 = add nsw i32 1, %9
%11 = call i32 @vmemPush(i32 %10)
ret void
}

LLVM IR (-O2):
define void @sysCtoa(i32 %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = call i32 @vmemAllocString(i8* %3, i32 1)
%6 = shl i32 %5, 1
%7 = or i32 %6, 1
%8 = call i32 @vmemPush(i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cork;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_CORK;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
void _nxweb_batch_write_end(int fd) {
  int cork = 0;
  setsockopt(fd, IPPROTO_TCP, TCP_CORK, &cork, sizeof(cork));
}


x86 assembly (clang, -O0):
<_nxweb_batch_write_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nxweb_batch_write_end>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_CORK = global i32 0
define void @_nxweb_batch_write_end(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_TCP
%6 = load i32, i32* @TCP_CORK
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_CORK = global i32 0
define void @_nxweb_batch_write_end(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @IPPROTO_TCP
%5 = load i32, i32* @TCP_CORK
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isodigit(int);
void t_isodigit_0x32() {
  Assert_real((isodigit(50)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              255, ("isodigit should be 1 for 2"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x32>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
call   1040 <isodigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xff,%edx
lea    0xf66(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x32>:
push   %rax
mov    $0x32,%edi
call   1040 <isodigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0xff,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 1 for 2\00"
define void @t_isodigit_0x32() {
%1 = call i32 @isodigit(i32 50)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 255, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 1 for 2\00"
define void @t_isodigit_0x32() {
%1 = tail call i32 @isodigit(i32 50)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 255, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void cutils_cout_int_print(int number) { fprintf(stdout, "%d\n", number); }


x86 assembly (clang, -O0):
<cutils_cout_int_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cout_int_print>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @cutils_cout_int_print(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char *gets(char *);
int /*<<< orphan*/ printf(char *);
main() {
  char *c = NULL;
  char texto[80];
  printf("Introducir líneas de texto.\n");
  printf("Para finalizar introducir la marca EOF\n\n");
  c = gets(texto);
  while (c != NULL) {
    c = gets(texto);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1040 <gets@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1179 <main+0x59>
lea    -0x60(%rbp),%rdi
call   1040 <gets@plt>
mov    %rax,-0x10(%rbp)
jmp    115c <main+0x3c>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1040 <gets@plt>
test   %rax,%rax
je     115d <main+0x3d>
mov    %rsp,%rbx
nopl   (%rax)
mov    %rbx,%rdi
call   1040 <gets@plt>
test   %rax,%rax
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Introducir l\C3\ADneas de texto.\0A\00"
@.str.1 = [41 x i8] c"Para finalizar introducir la marca EOF\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [80 x i8]
store i32 0, i32* %1
store i8* null, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%7 = call i8* @gets(i8* %6)
store i8* %7, i8** %2
br label %8
8: ; preds = %11, %0
%9 = load i8*, i8** %2
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%13 = call i8* @gets(i8* %12)
store i8* %13, i8** %2
br label %8
14: ; preds = %8
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@str = [29 x i8] c"Introducir l\C3\ADneas de texto.\00"
@str.2 = [40 x i8] c"Para finalizar introducir la marca EOF\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.2, i64 0, i64 0))
%5 = call i8* @gets(i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %0, %7
%8 = call i8* @gets(i8* %2)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %7
10: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ halt3();
scalar_t__ unknown();
int test11() { (void)(unknown() && halt3()); }


x86 assembly (clang, -O0):
<test11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <unknown@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1152 <test11+0x32>
mov    $0x0,%al
call   1030 <halt3@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test11>:
push   %rax
xor    %eax,%eax
call   1040 <unknown@plt>
test   %rax,%rax
je     1134 <test11+0x14>
xor    %eax,%eax
call   1030 <halt3@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test11() {
%1 = alloca i32
%2 = call i64 (...) @unknown()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i64 (...) @halt3()
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %4, %0
%8 = phi i1 [ false, %0 ], [ %6, %4 ]
%9 = zext i1 %8 to i32
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @test11() {
%1 = tail call i64 (...) @unknown()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 (...) @halt3()
br label %5
5: ; preds = %3, %0
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ IoWrite8(int, int);
void testReboot(void) {
  IoWrite8(0x0381, 0xf4);
  IoWrite8(0x0382, 0xec);
  IoWrite8(0x0383, 0x01);
}


x86 assembly (clang, -O0):
<testReboot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x381,%edi
mov    $0xf4,%esi
call   1030 <IoWrite8@plt>
mov    $0x382,%edi
mov    $0xec,%esi
call   1030 <IoWrite8@plt>
mov    $0x383,%edi
mov    $0x1,%esi
call   1030 <IoWrite8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testReboot>:
push   %rax
mov    $0x381,%edi
mov    $0xf4,%esi
call   1030 <IoWrite8@plt>
mov    $0x382,%edi
mov    $0xec,%esi
call   1030 <IoWrite8@plt>
mov    $0x383,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <IoWrite8@plt>

LLVM IR (-O0):
define void @testReboot() {
%1 = call i32 @IoWrite8(i32 897, i32 244)
%2 = call i32 @IoWrite8(i32 898, i32 236)
%3 = call i32 @IoWrite8(i32 899, i32 1)
ret void
}

LLVM IR (-O2):
define void @testReboot() {
%1 = tail call i32 @IoWrite8(i32 897, i32 244)
%2 = tail call i32 @IoWrite8(i32 898, i32 236)
%3 = tail call i32 @IoWrite8(i32 899, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ti_op16();
int /*<<< orphan*/ ti_show_abs_xy(int /*<<< orphan*/);
void ti_show_abs(void) { ti_show_abs_xy(ti_op16()); }


x86 assembly (clang, -O0):
<ti_show_abs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ti_op16@plt>
mov    %eax,%edi
call   1040 <ti_show_abs_xy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_show_abs>:
push   %rax
xor    %eax,%eax
call   1030 <ti_op16@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ti_show_abs_xy@plt>

LLVM IR (-O0):
define void @ti_show_abs() {
%1 = call i32 (...) @ti_op16()
%2 = call i32 @ti_show_abs_xy(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ti_show_abs() {
%1 = tail call i32 (...) @ti_op16()
%2 = tail call i32 @ti_show_abs_xy(i32 %1)
ret void
}
/* Variables and functions */
unsigned char galois_mult_by_two(unsigned char);
unsigned char galois_mult_by_fourteen(unsigned char val) {
  return galois_mult_by_two(galois_mult_by_two(galois_mult_by_two(val) ^ val) ^
                            val);
}


x86 assembly (clang, -O0):
<galois_mult_by_fourteen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <galois_mult_by_two@plt>
movzbl %al,%eax
movzbl -0x1(%rbp),%ecx
xor    %ecx,%eax
movzbl %al,%edi
call   1030 <galois_mult_by_two@plt>
movzbl %al,%eax
movzbl -0x1(%rbp),%ecx
xor    %ecx,%eax
movzbl %al,%edi
call   1030 <galois_mult_by_two@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<galois_mult_by_fourteen>:
push   %rbx
mov    %edi,%ebx
call   1030 <galois_mult_by_two@plt>
xor    %bl,%al
movzbl %al,%edi
call   1030 <galois_mult_by_two@plt>
xor    %bl,%al
movzbl %al,%edi
pop    %rbx
jmp    1030 <galois_mult_by_two@plt>

LLVM IR (-O0):
define zeroext i8 @galois_mult_by_fourteen(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @galois_mult_by_two(i8 zeroext %3)
%5 = zext i8 %4 to i32
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = xor i32 %5, %7
%9 = trunc i32 %8 to i8
%10 = call zeroext i8 @galois_mult_by_two(i8 zeroext %9)
%11 = zext i8 %10 to i32
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
%16 = call zeroext i8 @galois_mult_by_two(i8 zeroext %15)
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @galois_mult_by_fourteen(i8 zeroext %0) {
%2 = tail call zeroext i8 @galois_mult_by_two(i8 zeroext %0)
%3 = xor i8 %2, %0
%4 = tail call zeroext i8 @galois_mult_by_two(i8 zeroext %3)
%5 = xor i8 %4, %0
%6 = tail call zeroext i8 @galois_mult_by_two(i8 zeroext %5)
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ str2;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *func2();
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *func1(void) {
  char *str1 = func2();
  const char str2[] = "bar";
  char *str = malloc(strlen(str1) + sizeof(str2));
  strcat(strcpy(str, str1), str2);
  free(str1);
  return str;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1060 <func2@plt>
mov    %rax,-0x8(%rbp)
mov    0xe87(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x4,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    %eax,%edi
lea    -0xc(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <func2@plt>
mov    %rax,%rbx
movl   $0x726162,0x4(%rsp)
mov    %rax,%rdi
call   1050 <strlen@plt>
lea    0x4(%rax),%rdi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
lea    0x4(%rsp),%rsi
mov    %eax,%edi
call   1080 <strcat@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.func1.str2 = [4 x i8] c"bar\00"
define i8* @func1() {
%1 = alloca i8*
%2 = alloca [4 x i8]
%3 = alloca i8*
%4 = call i8* (...) @func2()
store i8* %4, i8** %1
%5 = bitcast [4 x i8]* %2 to i8*
%6 = load i8*, i8** %1
%7 = call i64 @strlen(i8* %6)
%8 = add i64 %7, 4
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%14 = call i32 @strcat(i32 %12, i8* %13)
%15 = load i8*, i8** %1
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @func1() {
%1 = alloca i32
%2 = tail call i8* (...) @func2()
%3 = bitcast i32* %1 to i8*
store i32 7496034, i32* %1
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = add i64 %4, 4
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 @strcpy(i8* %6, i8* %2)
%8 = call i32 @strcat(i32 %7, i8* %3)
%9 = call i32 @free(i8* %2)
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ XEnterWindowEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XEnterWindowEvent(void) {
  XEnterWindowEvent *_p =
      (XEnterWindowEvent *)malloc(sizeof(XEnterWindowEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XEnterWindowEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XEnterWindowEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XEnterWindowEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XEnterWindowEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i8* @alloc_XEnterWindowEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ stderr_putchar(int /*<<< orphan*/);
void stderr_putstr(char *str) {
  while (*str != '\0')
    stderr_putchar(*str++);
}


x86 assembly (clang, -O0):
<stderr_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <stderr_putstr+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <stderr_putchar@plt>
jmp    111c <stderr_putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stderr_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <stderr_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <stderr_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <stderr_putstr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @stderr_putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 @stderr_putchar(i32 %12)
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @stderr_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @stderr_putchar(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Close_Stream();
scalar_t__ Next_Text_Token_Obtained();
void Close_Text(void) {
  while (Next_Text_Token_Obtained()) {
  }
  Close_Stream();
}


x86 assembly (clang, -O0):
<Close_Text>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <Close_Text+0x9>
mov    $0x0,%al
call   1030 <Next_Text_Token_Obtained@plt>
cmp    $0x0,%rax
je     113f <Close_Text+0x1f>
jmp    1129 <Close_Text+0x9>
mov    $0x0,%al
call   1040 <Close_Stream@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close_Text>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <Next_Text_Token_Obtained@plt>
test   %rax,%rax
jne    1130 <Close_Text+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Close_Stream@plt>

LLVM IR (-O0):
define void @Close_Text() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @Next_Text_Token_Obtained()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
%6 = call i32 (...) @Close_Stream()
ret void
}

LLVM IR (-O2):
define void @Close_Text() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @Next_Text_Token_Obtained()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call i32 (...) @Close_Stream()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atomic_dec(int *);
void release(int *c) { atomic_dec(c); }


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

x86 assembly (clang, -O2):
<release>:
jmp    1030 <atomic_dec@plt>

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

LLVM IR (-O2):
define void @release(i32* %0) {
%2 = tail call i32 @atomic_dec(i32* %0)
ret void
}
/* Variables and functions */
bool zsub_is_oor(size_t a, size_t b) { return (a - b > a); }


x86 assembly (clang, -O0):
<zsub_is_oor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zsub_is_oor>:
xor    %eax,%eax
cmp    %rdi,%rsi
seta   %al
ret

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

LLVM IR (-O2):
define i32 @zsub_is_oor(i64 %0, i64 %1) {
%3 = icmp ugt i64 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
bool load_library(void) { return true; }


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

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

LLVM IR (-O0):
define i32 @load_library() {
ret i32 1
}

LLVM IR (-O2):
define i32 @load_library() {
ret i32 1
}
char *_strupr(char *__s) {
  char *t = __s;
  while (*__s) {
    *__s = ((((*__s) >= 'a' && (*__s) <= 'z')) ? ((*__s) - 'a' + 'A') : (*__s));
    ++__s;
  }
  return t;
}


x86 assembly (clang, -O0):
<_strupr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1178 <_strupr+0x78>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1152 <_strupr+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1152 <_strupr+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x14(%rbp)
jmp    115c <_strupr+0x5c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <_strupr+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strupr>:
mov    %rdi,%rax
mov    (%rdi),%dl
test   %dl,%dl
je     1133 <_strupr+0x33>
lea    0x1(%rax),%rcx
nopl   (%rax)
lea    -0x61(%rdx),%esi
lea    -0x20(%rdx),%edi
cmp    $0x1a,%sil
movzbl %dl,%edx
movzbl %dil,%esi
cmovae %edx,%esi
mov    %sil,-0x1(%rcx)
movzbl (%rcx),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <_strupr+0x10>
ret

LLVM IR (-O0):
define i8* @_strupr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %29, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %35
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i8*, i8** %2
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 97
%24 = add nsw i32 %23, 65
br label %29
25: ; preds = %14, %9
%26 = load i8*, i8** %2
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
br label %29
29: ; preds = %25, %19
%30 = phi i32 [ %24, %19 ], [ %28, %25 ]
%31 = trunc i32 %30 to i8
%32 = load i8*, i8** %2
store i8 %31, i8* %32
%33 = load i8*, i8** %2
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %2
br label %5
35: ; preds = %5
%36 = load i8*, i8** %3
ret i8* %36
}

LLVM IR (-O2):
define i8* @_strupr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
%9 = add nsw i8 %5, -32
%10 = select i1 %8, i8 %9, i8 %5
store i8 %10, i8* %6
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void led_fini(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<led_fini>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @led_fini(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
unsigned int SEGGER_RTT_ReadNoLock(unsigned int, void *, unsigned int);
unsigned SEGGER_RTT_Read(unsigned BufferIndex, void *pBuffer,
                         unsigned BufferSize) {
  unsigned NumBytesRead;
  ;
  NumBytesRead = SEGGER_RTT_ReadNoLock(BufferIndex, pBuffer, BufferSize);
  ;
  return NumBytesRead;
}


x86 assembly (clang, -O0):
<SEGGER_RTT_Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <SEGGER_RTT_ReadNoLock@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SEGGER_RTT_Read>:
jmp    1030 <SEGGER_RTT_ReadNoLock@plt>

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

LLVM IR (-O2):
define i32 @SEGGER_RTT_Read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @SEGGER_RTT_ReadNoLock(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ nan(char *);
int /*<<< orphan*/ nanf(char *);
int /*<<< orphan*/ nanl(char *);
void uninitvar_nan(void) {
  char *tagp;
  (void)nanf(tagp);
  (void)nan(tagp);
  (void)nanl(tagp);
}


x86 assembly (clang, -O0):
<uninitvar_nan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
call   1040 <nanf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <nan@plt>
mov    -0x8(%rbp),%rdi
call   1050 <nanl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_nan>:
push   %rax
call   1040 <nanf@plt>
call   1030 <nan@plt>
pop    %rax
jmp    1050 <nanl@plt>

LLVM IR (-O0):
define void @uninitvar_nan() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @nanf(i8* %2)
%4 = load i8*, i8** %1
%5 = call i32 @nan(i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @nanl(i8* %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_nan() {
%1 = tail call i32 @nanf(i8* undef)
%2 = tail call i32 @nan(i8* undef)
%3 = tail call i32 @nanl(i8* undef)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ data_offset_from_whence(int, size_t);
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ xwrite(int, void const *, size_t);
ssize_t write_whence_data(int fd, const void *buffer, size_t len, int whence) {
  off_t offset = data_offset_from_whence(whence, len);
  lseek(fd, offset, SEEK_SET);
  return xwrite(fd, buffer, len);
}


x86 assembly (clang, -O0):
<write_whence_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1050 <data_offset_from_whence@plt>
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
call   1040 <lseek@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <xwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_whence_data>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %ecx,%edi
mov    %rdx,%rsi
call   1050 <data_offset_from_whence@plt>
mov    0x2e93(%rip),%rcx
mov    (%rcx),%edx
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <lseek@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <xwrite@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @write_whence_data(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = load i64, i64* %7
%12 = call i32 @data_offset_from_whence(i32 %10, i64 %11)
store i32 %12, i32* %9
%13 = load i32, i32* %5
%14 = load i32, i32* %9
%15 = load i32, i32* @SEEK_SET
%16 = call i32 @lseek(i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* %5
%18 = load i8*, i8** %6
%19 = load i64, i64* %7
%20 = call i32 @xwrite(i32 %17, i8* %18, i64 %19)
ret i32 %20
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @write_whence_data(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @data_offset_from_whence(i32 %3, i64 %2)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @lseek(i32 %0, i32 %5, i32 %6)
%8 = tail call i32 @xwrite(i32 %0, i8* %1, i64 %2)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int j;
  int k;
  int n;
  assume((j == n) && (k == n) && (n > 0));
  while (j > 0 && n > 0) {
    j--;
    k--;
  }
  assert((k == 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x11(%rbp)
jne    115b <main+0x3b>
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x11(%rbp)
jne    115b <main+0x3b>
cmpl   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x12(%rbp)
jle    1181 <main+0x61>
cmpl   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1191 <main+0x71>
jmp    11a8 <main+0x88>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1168 <main+0x48>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
int __clog_noop(const char *fmt, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__clog_noop(i8* nocapture readnone %0, ...) {
ret i32 0
}
double distance(double a, double b) { return (a * a + b * b); }


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @distance(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
ret double %10
}

LLVM IR (-O2):
define double @distance(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ gpanel_rect(int, int, int, int, int);
void rect(int color, int x, int y, int w, int h) {
  gpanel_rect(color, x, y, x + w - 1, y + h - 1);
}


x86 assembly (clang, -O0):
<rect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    -0xc(%rbp),%r8d
add    -0x14(%rbp),%r8d
sub    $0x1,%r8d
call   1030 <gpanel_rect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rect>:
add    %esi,%ecx
add    $0xffffffff,%ecx
add    %edx,%r8d
add    $0xffffffff,%r8d
jmp    1030 <gpanel_rect@plt>

LLVM IR (-O0):
define void @rect(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* %7
%15 = load i32, i32* %9
%16 = add nsw i32 %14, %15
%17 = sub nsw i32 %16, 1
%18 = load i32, i32* %8
%19 = load i32, i32* %10
%20 = add nsw i32 %18, %19
%21 = sub nsw i32 %20, 1
%22 = call i32 @gpanel_rect(i32 %11, i32 %12, i32 %13, i32 %17, i32 %21)
ret void
}

LLVM IR (-O2):
define void @rect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = add i32 %1, -1
%7 = add i32 %6, %3
%8 = add i32 %2, -1
%9 = add i32 %8, %4
%10 = tail call i32 @gpanel_rect(i32 %0, i32 %1, i32 %2, i32 %7, i32 %9)
ret void
}