xunge/DecIR huggingface dataset:
/* Type definitions */
struct sembuf {
  int sem_op;
  int /*<<< orphan*/ sem_flg;
  int /*<<< orphan*/ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ SEM_UNDO;
int semop(int, struct sembuf *, int);
int sem_v(int semid) {
  struct sembuf buf = {
      .sem_num = 0,
      .sem_op = 1,
      .sem_flg = SEM_UNDO,
  };
  return semop(semid, &buf, 1);
}


x86 assembly (clang, -O0):
<sem_v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_v>:
sub    $0x18,%rsp
movl   $0x1,0x8(%rsp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define i32 @sem_v(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sembuf
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 1
%6 = load i32, i32* @SEM_UNDO
store i32 %6, i32* %5
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 2
store i32 0, i32* %7
%8 = load i32, i32* %2
%9 = call i32 @semop(i32 %8, %struct.sembuf* %3, i32 1)
ret i32 %9
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define i32 @sem_v(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 1
%6 = load i32, i32* @SEM_UNDO
store i32 %6, i32* %5
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 2
store i32 0, i32* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
ret i32 %8
}
/* Type definitions */
struct flock {
  scalar_t__ l_len;
  scalar_t__ l_start;
  scalar_t__ l_whence;
  int /*<<< orphan*/ l_type;
};
typedef int /*<<< orphan*/ fl;

/* Variables and functions */
int /*<<< orphan*/ F_SETLK;
int /*<<< orphan*/ F_UNLCK;
int fcntl(int, int /*<<< orphan*/, struct flock *);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
int do_unlock(int fd) {
  struct flock fl;
  memset((void *)&fl, 0, sizeof(fl));
  fl.l_type = F_UNLCK;
  fl.l_whence = fl.l_start = 0;
  fl.l_len = 0;
  return fcntl(fd, F_SETLK, &fl);
}


x86 assembly (clang, -O0):
<do_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_unlock>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x18(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
mov    %r14,%rdx
call   1030 <fcntl@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.flock = type { i64, i64, i64, i32 }
@F_UNLCK = global i32 0
@F_SETLK = global i32 0
define i32 @do_unlock(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.flock
store i32 %0, i32* %2
%4 = bitcast %struct.flock* %3 to i8*
%5 = call i32 @memset(i8* %4, i32 0, i32 32)
%6 = load i32, i32* @F_UNLCK
%7 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 3
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 1
store i64 0, i64* %8
%9 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 2
store i64 0, i64* %9
%10 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 0
store i64 0, i64* %10
%11 = load i32, i32* %2
%12 = load i32, i32* @F_SETLK
%13 = call i32 @fcntl(i32 %11, i32 %12, %struct.flock* %3)
ret i32 %13
}

LLVM IR (-O2):
%struct.flock = type { i64, i64, i64, i32 }
@F_UNLCK = global i32 0
@F_SETLK = global i32 0
define i32 @do_unlock(i32 %0) {
%2 = alloca %struct.flock
%3 = bitcast %struct.flock* %2 to i8*
%4 = call i32 @memset(i8* %3, i32 0, i32 32)
%5 = load i32, i32* @F_UNLCK
%6 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 3
store i32 %5, i32* %6
%7 = bitcast %struct.flock* %2 to i8*
%8 = load i32, i32* @F_SETLK
%9 = call i32 @fcntl(i32 %0, i32 %8, %struct.flock* %2)
ret i32 %9
}
const char *get_basefile_from_header(void) {
  return "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/andreiw/tinycc/refs/heads/devel/tests/"
         "tcctest.h";
}


x86 assembly (clang, -O0):
<get_basefile_from_header>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_basefile_from_header>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/andreiw/tinycc/refs/heads/devel/tests/tcctest.h\00"
define i8* @get_basefile_from_header() {
ret i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/andreiw/tinycc/refs/heads/devel/tests/tcctest.h\00"
define i8* @get_basefile_from_header() {
ret i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0)
}
struct qstr *foo(const struct qstr *p) {
  return p;
}


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

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

LLVM IR (-O0):
%struct.qstr = type opaque
define %struct.qstr* @foo(%struct.qstr* %0) {
%2 = alloca %struct.qstr*
store %struct.qstr* %0, %struct.qstr** %2
%3 = load %struct.qstr*, %struct.qstr** %2
ret %struct.qstr* %3
}

LLVM IR (-O2):
%struct.qstr = type opaque
define %struct.qstr* @foo(%struct.qstr* readnone returned %0) {
ret %struct.qstr* %0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long long quot;
  long long rem;
};
typedef TYPE_1__ lldiv_t;

/* Variables and functions */
lldiv_t lldiv(long long numer, long long denom) {
  lldiv_t ret;
  ret.quot = numer / denom;
  ret.rem = numer % denom;
  return ret;
}


x86 assembly (clang, -O0):
<lldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<lldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <lldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @lldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = sdiv i64 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = srem i64 %10, %11
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i64 %12, i64* %13
%14 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%15 = load { i64, i64 }, { i64, i64 }* %14
ret { i64, i64 } %15
}

LLVM IR (-O2):
define { i64, i64 } @lldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = srem i64 %0, %1
%5 = insertvalue { i64, i64 } poison, i64 %3, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
void SSL_free(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @enable_servos() {
ret void
}
/* Variables and functions */
int rom_present(char *);
int vga_available(void) { return rom_present(L"roms/video/vga/ibm_vga.bin"); }


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

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

LLVM IR (-O0):
@.str = [27 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 118, i32 103, i32 97, i32 47, i32 105, i32 98, i32 109, i32 95, i32 118, i32 103, i32 97, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @vga_available() {
%1 = call i32 @rom_present(i8* bitcast ([27 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [27 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 118, i32 103, i32 97, i32 47, i32 105, i32 98, i32 109, i32 95, i32 118, i32 103, i32 97, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @vga_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([27 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
short **addrow_smatrix(short **m, long nrl, long nrh, long ncl, long nch,
                       long nr) {
  return NULL;
}


x86 assembly (clang, -O0):
<addrow_smatrix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i16** @addrow_smatrix(i16** %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i16**
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i16** %0, i16*** %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
ret i16** null
}

LLVM IR (-O2):
define noalias i16** @addrow_smatrix(i16** nocapture readnone %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
ret i16** null
}
int test_imm_51int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x51 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_51int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 347892350976
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ isprint(char);
char printable(char c) {
  if (isprint(c)) {
    return c;
  } else {
    return '.';
  }
}


x86 assembly (clang, -O0):
<printable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
je     113c <printable+0x2c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1140 <printable+0x30>
movb   $0x2e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printable>:
push   %rbx
mov    %edi,%ebx
call   1030 <isprint@plt>
test   %rax,%rax
mov    $0x2e,%eax
cmovne %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @printable(i8 signext %0) {
%2 = tail call i64 @isprint(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8 46, i8 %0
ret i8 %4
}
/* Variables and functions */
int OPER_I_16();
int m68ki_get_ccr();
int /*<<< orphan*/ m68ki_set_ccr(int);
void m68k_op_ori_16_toc(void) { m68ki_set_ccr(m68ki_get_ccr() | OPER_I_16()); }


x86 assembly (clang, -O0):
<m68k_op_ori_16_toc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <m68ki_get_ccr@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <OPER_I_16@plt>
mov    -0x4(%rbp),%edi
or     %eax,%edi
call   1030 <m68ki_set_ccr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_ori_16_toc>:
push   %rbx
xor    %eax,%eax
call   1050 <m68ki_get_ccr@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <OPER_I_16@plt>
or     %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <m68ki_set_ccr@plt>

LLVM IR (-O0):
define void @m68k_op_ori_16_toc() {
%1 = call i32 (...) @m68ki_get_ccr()
%2 = call i32 (...) @OPER_I_16()
%3 = or i32 %1, %2
%4 = call i32 @m68ki_set_ccr(i32 %3)
ret void
}

LLVM IR (-O2):
define void @m68k_op_ori_16_toc() {
%1 = tail call i32 (...) @m68ki_get_ccr()
%2 = tail call i32 (...) @OPER_I_16()
%3 = or i32 %2, %1
%4 = tail call i32 @m68ki_set_ccr(i32 %3)
ret void
}
/* Variables and functions */
char *fmt(char *, double);
char *fmtdbl(double x) { return fmt("%a", x); }


x86 assembly (clang, -O0):
<fmtdbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <fmt@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%a\00"
define i8* @fmtdbl(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i8* @fmt(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"%a\00"
define i8* @fmtdbl(double %0) {
%2 = tail call i8* @fmt(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* %2
}
void foo425() {}


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

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

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

LLVM IR (-O2):
define void @foo425() {
ret void
}
/* Variables and functions */
int libc_strlen(char *);
char libc_toupper(char);
char *libc_strtoupper(char *str) {
  int i = 0, n = libc_strlen(str);
  while (n < i) {
    str[i] = libc_toupper(str[i]);
    i++;
  }
  return str;
}


x86 assembly (clang, -O0):
<libc_strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <libc_strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <libc_strtoupper+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <libc_toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <libc_strtoupper+0x1f>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libc_strtoupper>:
push   %rbx
mov    %rdi,%rbx
call   1030 <libc_strlen@plt>
test   %eax,%eax
js     1140 <libc_strtoupper+0x20>
mov    %rbx,%rax
pop    %rbx
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rbx),%edi
call   1040 <libc_toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
jmp    1140 <libc_strtoupper+0x20>

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

LLVM IR (-O2):
define i8* @libc_strtoupper(i8* returned %0) {
%2 = tail call i32 @libc_strlen(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @libc_toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw i64 %5, 1
br label %4
10: ; preds = %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ CFunction();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world, from 64-bits\n");
  CFunction();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"Hello world, from 64-bits\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @CFunction()
ret i32 0
}
double pwmax(double x, double y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<pwmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <pwmax+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <pwmax+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwmax>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pwmax(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* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @pwmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void check_logfs_object_header(void) { ; }


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

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

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

LLVM IR (-O2):
define void @check_logfs_object_header() {
ret void
}
int foo(int v) { return v + 1; }


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

x86 assembly (clang, -O2):
<foo>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int getbo() {
  long i4;
  short *i2;
  i4 = 1;
  i2 = (short *)&i4;
  if (*i2 == 1 && *(i2 + 1) == 0)
    return (0);
  else if (*i2 == 0 && *(i2 + 1) == 1)
    return (1);
  else
    return (2);
}


x86 assembly (clang, -O0):
<getbo>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
cmp    $0x1,%eax
jne    1141 <getbo+0x41>
mov    -0x18(%rbp),%rax
movswl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    1141 <getbo+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1175 <getbo+0x75>
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
cmp    $0x0,%eax
jne    116e <getbo+0x6e>
mov    -0x18(%rbp),%rax
movswl 0x2(%rax),%eax
cmp    $0x1,%eax
jne    116e <getbo+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <getbo+0x75>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getbo() {
ret i32 0
}
int is_leap_year(int year) {
  return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <is_leap_year+0x34>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1148 <is_leap_year+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
test   $0x3,%dil
jne    112c <is_leap_year+0x2c>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%eax
sub    %ecx,%edx
je     112c <is_leap_year+0x2c>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}
void b43legacy_leds_exit(struct b43legacy_wldev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.b43legacy_wldev = type opaque
define void @b43legacy_leds_exit(%struct.b43legacy_wldev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max(int, int);
int min(int, int /*<<< orphan*/);
int test_03(int a) { return min(32767, max(-32768, a)); }


x86 assembly (clang, -O0):
<test_03>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xffff8000,%edi
call   1040 <max@plt>
mov    %eax,%esi
mov    $0x7fff,%edi
call   1030 <min@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_03>:
push   %rax
mov    %edi,%esi
mov    $0xffff8000,%edi
call   1040 <max@plt>
mov    $0x7fff,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <min@plt>

LLVM IR (-O0):
define i32 @test_03(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @max(i32 -32768, i32 %3)
%5 = call i32 @min(i32 32767, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_03(i32 %0) {
%2 = tail call i32 @max(i32 -32768, i32 %0)
%3 = tail call i32 @min(i32 32767, i32 %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ fs_exsists(char const *);
int /*<<< orphan*/ unlink(char const *);
int fs_rm(const char *filename) {
  if (fs_exsists(filename)) {
    unlink(filename);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fs_rm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fs_exsists@plt>
cmp    $0x0,%rax
je     1154 <fs_rm+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
movl   $0x1,-0x4(%rbp)
jmp    115b <fs_rm+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_rm>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fs_exsists@plt>
test   %rax,%rax
je     113d <fs_rm+0x1d>
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fs_rm(i8* %0) {
%2 = tail call i64 @fs_exsists(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @unlink(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
void curl_easy_init() {}


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

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

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

LLVM IR (-O2):
define void @curl_easy_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int i_bst_default_expire_handler(uint64_t key, void *ptr, size_t dataSize) {
  return 0;
}


x86 assembly (clang, -O0):
<i_bst_default_expire_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @i_bst_default_expire_handler(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @i_bst_default_expire_handler(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gx_device_finalize(void *);
void tiffsep_device_finalize(void *vpdev) { gx_device_finalize(vpdev); }


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

x86 assembly (clang, -O2):
<tiffsep_device_finalize>:
jmp    1030 <gx_device_finalize@plt>

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

LLVM IR (-O2):
define void @tiffsep_device_finalize(i8* %0) {
%2 = tail call i32 @gx_device_finalize(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ mget_spc(int, int);
int /*<<< orphan*/ nrerror(char *);
int *ivector(int nl, int nh) {
  int *v;
  v = (int *)mget_spc(nh - nl + 1, sizeof(int));
  if (!v)
    nrerror("allocation failure in ivector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x4(%rbp),%edi
add    $0x1,%edi
mov    $0x4,%esi
call   1040 <mget_spc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <ivector+0x3c>
lea    0xea9(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x1(%rsi),%edi
mov    $0x4,%esi
call   1040 <mget_spc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <ivector+0x28>
lea    0xebd(%rip),%rdi
call   1030 <nrerror@plt>
movslq %ebp,%rax
shl    $0x2,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = tail call i64 @mget_spc(i32 %4, i32 4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = inttoptr i64 %5 to i32*
%11 = sext i32 %0 to i64
%12 = sub nsw i64 0, %11
%13 = getelementptr inbounds i32, i32* %10, i64 %12
ret i32* %13
}
/* Variables and functions */
int BIT(int);
unsigned mcuio_funcs_per_dev(void) { return BIT(5); }


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

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

LLVM IR (-O0):
define i32 @mcuio_funcs_per_dev() {
%1 = call i32 @BIT(i32 5)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mcuio_funcs_per_dev() {
%1 = tail call i32 @BIT(i32 5)
ret i32 %1
}
void defCharProlog(c) unsigned char c;
{
  p1('\033');
  p1('&');
  p1(0);
  p1(c);
  p1(c);
  p1(2);
  p1(3 * 11);
  p1(2);
}


x86 assembly (clang, -O0):
<defCharProlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1b,%edi
mov    $0x0,%al
call   1030 <p1@plt>
mov    $0x26,%edi
mov    $0x0,%al
call   1030 <p1@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <p1@plt>
movzbl -0x1(%rbp),%edi
mov    $0x0,%al
call   1030 <p1@plt>
movzbl -0x1(%rbp),%edi
mov    $0x0,%al
call   1030 <p1@plt>
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <p1@plt>
mov    $0x21,%edi
mov    $0x0,%al
call   1030 <p1@plt>
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <p1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defCharProlog>:
push   %rbx
mov    %edi,%ebx
mov    $0x1b,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    $0x26,%edi
xor    %eax,%eax
call   1030 <p1@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1030 <p1@plt>
movzbl %bl,%ebx
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    $0x2,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    $0x21,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    $0x2,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <p1@plt>

LLVM IR (-O0):
define void @defCharProlog(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 27)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 38)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 0)
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %8)
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %11)
%13 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 2)
%14 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 33)
%15 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 2)
ret void
}

LLVM IR (-O2):
define void @defCharProlog(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 27)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 38)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 0)
%5 = and i32 %0, 255
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %5)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %5)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 2)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 33)
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 2)
ret void
}
void exchange_member(int *arr, int a, int b) {
  int temp = arr[a];
  arr[a] = arr[b];
  arr[b] = temp;
  return;
}


x86 assembly (clang, -O0):
<exchange_member>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exchange_member>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @exchange_member(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
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @exchange_member(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
__attribute__((no, cold)) int sum(int i) {
  int j, s;
  s = 0;
  for (j = 0; j < i; j++) {
    s += j * i;
  }
  return s;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113c <sum+0x3c>
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <sum+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %edi,%edi
jle    105a <sum+0x1a>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,1),%eax
dec    %eax
imul   %edi,%eax
ret
xor    %eax,%eax
ret
nopl   (%rax)

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = add i32 %10, %0
%12 = add i32 %11, -1
%13 = mul i32 %12, %0
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
int get_size(int address) { return ((int)address / 4); }


x86 assembly (clang, -O0):
<get_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_size>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @get_size(i32 %0) {
%2 = sdiv i32 %0, 4
ret i32 %2
}
/* Variables and functions */
void *memcpy(void *, void *, size_t);
void *unaligned_memcpy(void *dest, void *src, size_t n) {
  return memcpy(dest, src, n);
}


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

x86 assembly (clang, -O2):
<unaligned_memcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @unaligned_memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
int is_zero_pfn(unsigned long pfn) {
  extern unsigned long zero_pfn;
  return pfn == zero_pfn;
}


x86 assembly (clang, -O0):
<is_zero_pfn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ed5(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_zero_pfn>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
cmp    %rdi,(%rcx)
sete   %al
ret

LLVM IR (-O0):
@zero_pfn = external global i64
define i32 @is_zero_pfn(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @zero_pfn
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@zero_pfn = external global i64
define i32 @is_zero_pfn(i64 %0) {
%2 = load i64, i64* @zero_pfn
%3 = icmp eq i64 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
void pt_decoder_fini(struct pt_decoder *decoder) {}


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

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

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

LLVM IR (-O2):
%struct.pt_decoder = type opaque
define void @pt_decoder_fini(%struct.pt_decoder* nocapture %0) {
ret void
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
ssize_t preadv(int fd, const struct iovec *vector, int count, off_t offset) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<preadv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preadv>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
@ENOSYS = global i32 0
define i32 @preadv(i32 %0, %struct.iovec* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.iovec*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.iovec* %1, %struct.iovec** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @ENOSYS
%10 = call i32 @__set_errno(i32 %9)
ret i32 -1
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
@ENOSYS = global i32 0
define i32 @preadv(i32 %0, %struct.iovec* nocapture readnone %1, i32 %2, i32 %3) {
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  short x;
};
typedef TYPE_1__ XTimeCoord;

/* Variables and functions */
void set_XTimeCoord_x(void *_p, short _v) { ((XTimeCoord *)_p)->x = (short)_v; }


x86 assembly (clang, -O0):
<set_XTimeCoord_x>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XTimeCoord_x>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i16 }
define void @set_XTimeCoord_x(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i16 %5, i16* %8
ret void
}

LLVM IR (-O2):
define void @set_XTimeCoord_x(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
void f2(int *restrict xp, int *restrict yp) { *xp = *xp + (2 * (*yp)); }


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

x86 assembly (clang, -O2):
<f2>:
mov    (%rsi),%eax
add    %eax,%eax
add    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @f2(i32* noalias %0, i32* noalias %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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = mul nsw i32 2, %8
%10 = add nsw i32 %6, %9
%11 = load i32*, i32** %3
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @f2(i32* noalias nocapture %0, i32* noalias nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = shl nsw i32 %4, 1
%6 = add nsw i32 %5, %3
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x81() {
  Assert_real((iscntrl(129) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              650, ("iscntrl should be 0 for 0x81"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x81>:
push   %rax
mov    $0x81,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x81\00"
define void @t_iscntrl_0x81() {
%1 = tail call i64 @iscntrl(i32 129)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 650, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}