xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ COND_LS();
int /*<<< orphan*/ EA_AW_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sls_8_aw(void) { m68ki_write_8(EA_AW_8(), COND_LS() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_sls_8_aw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AW_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_LS@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sls_8_aw>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AW_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_LS@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sls_8_aw() {
%1 = call i32 (...) @EA_AW_8()
%2 = call i64 (...) @COND_LS()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sls_8_aw() {
%1 = tail call i32 (...) @EA_AW_8()
%2 = tail call i64 (...) @COND_LS()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int S_IRWXG;
int S_IRWXO;
int S_IRWXU;
int /*<<< orphan*/ _mkdir(char const *, int);
void cfilesystem_create_directories(const char *filepath) {
  _mkdir(filepath, S_IRWXU | S_IRWXG | S_IRWXO);
}


x86 assembly (clang, -O0):
<cfilesystem_create_directories>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
mov    0x2eb7(%rip),%rax
or     (%rax),%esi
call   1030 <_mkdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfilesystem_create_directories>:
mov    0x2ec9(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ec7(%rip),%rax
or     (%rax),%esi
jmp    1030 <_mkdir@plt>

LLVM IR (-O0):
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IRWXO = global i32 0
define void @cfilesystem_create_directories(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @S_IRWXU
%5 = load i32, i32* @S_IRWXG
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IRWXO
%8 = or i32 %6, %7
%9 = call i32 @_mkdir(i8* %3, i32 %8)
ret void
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IRWXO = global i32 0
define void @cfilesystem_create_directories(i8* %0) {
%2 = load i32, i32* @S_IRWXU
%3 = load i32, i32* @S_IRWXG
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IRWXO
%6 = or i32 %4, %5
%7 = tail call i32 @_mkdir(i8* %0, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ errno;
int __attribute__((weak)) _close(int fd) {
  switch (fd) {
  case 0:
  case 1:
  case 2:
    return 0;
  }
  errno = EBADF;
  return -1;
}


x86 assembly (clang, -O0):
<_close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
ja     1124 <_close+0x24>
jmp    1118 <_close+0x18>
movl   $0x0,-0x4(%rbp)
jmp    113d <_close+0x3d>
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
mov    0x2eac(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_close>:
xor    %eax,%eax
cmp    $0x3,%edi
jb     111e <_close+0x1e>
mov    0x2eca(%rip),%rax
mov    (%rax),%eax
mov    0x2ec9(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define weak i32 @_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
i32 1, label %5
i32 2, label %5
]
5: ; preds = %1, %1, %1
store i32 0, i32* %2
br label %8
6: ; preds = %1
%7 = load i32, i32* @EBADF
store i32 %7, i32* @errno
store i32 -1, i32* %2
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define weak i32 @_close(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* @EBADF
store i32 %4, i32* @errno
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ -1, %3 ], [ 0, %1 ]
ret i32 %6
}
void err(char *s, ...) {}


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

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

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

LLVM IR (-O2):
define void @err(i8* nocapture %0, ...) {
ret void
}
int long_float_equal_xxxx(long a, long b) {
  if (a < 0) {
    a = 0x8000000000000000lu - a;
  }
  if (b < 0) {
    b = 0x8000000000000000lu - b;
  }
  return a == b;
}


x86 assembly (clang, -O0):
<long_float_equal_xxxx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1129 <long_float_equal_xxxx+0x29>
movabs $0x8000000000000000,%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1146 <long_float_equal_xxxx+0x46>
movabs $0x8000000000000000,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_float_equal_xxxx>:
movabs $0x8000000000000000,%rcx
mov    %rcx,%rdx
sub    %rdi,%rdx
test   %rdi,%rdi
cmovns %rdi,%rdx
sub    %rsi,%rcx
test   %rsi,%rsi
cmovns %rsi,%rcx
xor    %eax,%eax
cmp    %rcx,%rdx
sete   %al
ret

LLVM IR (-O0):
define i32 @long_float_equal_xxxx(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 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %3
%9 = sub i64 -9223372036854775808, %8
store i64 %9, i64* %3
br label %10
10: ; preds = %7, %2
%11 = load i64, i64* %4
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i64, i64* %4
%15 = sub i64 -9223372036854775808, %14
store i64 %15, i64* %4
br label %16
16: ; preds = %13, %10
%17 = load i64, i64* %3
%18 = load i64, i64* %4
%19 = icmp eq i64 %17, %18
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @long_float_equal_xxxx(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, 0
%4 = sub i64 -9223372036854775808, %0
%5 = select i1 %3, i64 %4, i64 %0
%6 = icmp slt i64 %1, 0
%7 = sub i64 -9223372036854775808, %1
%8 = select i1 %6, i64 %7, i64 %1
%9 = icmp eq i64 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ cria_jogadores(int);
int get_quantidade_jogadores();
void inicializa_jogo() {
  int quantidade_de_jogadores = get_quantidade_jogadores();
  cria_jogadores(quantidade_de_jogadores);
}


x86 assembly (clang, -O0):
<inicializa_jogo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_quantidade_jogadores@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <cria_jogadores@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @inicializa_jogo() {
%1 = alloca i32
%2 = call i32 (...) @get_quantidade_jogadores()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @cria_jogadores(i32 %3)
ret void
}

LLVM IR (-O2):
define void @inicializa_jogo() {
%1 = tail call i32 (...) @get_quantidade_jogadores()
%2 = tail call i32 @cria_jogadores(i32 %1)
ret void
}
/* Variables and functions */
size_t const getpagesize();
size_t getmaplen(const size_t s) {
  return ((s / getpagesize()) + 1) * getpagesize();
}


x86 assembly (clang, -O0):
<getmaplen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpagesize@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
xor    %edx,%edx
div    %rcx
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpagesize@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
imul   %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmaplen>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpagesize@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     1134 <getmaplen+0x24>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
mov    %rax,%rbx
jmp    113c <getmaplen+0x2c>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
mov    %eax,%ebx
add    $0x1,%rbx
xor    %eax,%eax
call   1030 <getpagesize@plt>
imul   %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @getmaplen(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 (...) @getpagesize()
%5 = udiv i64 %3, %4
%6 = add i64 %5, 1
%7 = call i64 (...) @getpagesize()
%8 = mul i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @getmaplen(i64 %0) {
%2 = tail call i64 (...) @getpagesize()
%3 = udiv i64 %0, %2
%4 = add i64 %3, 1
%5 = tail call i64 (...) @getpagesize()
%6 = mul i64 %4, %5
ret i64 %6
}
int test_imm_31int64_highword_reg(long long val) {
  return ((val >> 32) & (0x31 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_31int64_highword_reg>:
movabs $0x3100000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_31int64_highword_reg(i64 %0) {
%2 = and i64 %0, 210453397504
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int SortCompareProc(first, second) const void *first, *second;
{ return strcmp(*((char **)first), *((char **)second)); }


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

x86 assembly (clang, -O2):
<SortCompareProc>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @SortCompareProc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @SortCompareProc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
unsigned long long *add1(unsigned long long *p, unsigned x) { return p + x; }


x86 assembly (clang, -O0):
<add1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x3,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add1>:
mov    %esi,%eax
lea    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define i64* @add1(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %5, i64 %7
ret i64* %8
}

LLVM IR (-O2):
define i64* @add1(i64* readnone %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i64, i64* %0, i64 %3
ret i64* %4
}
/* Variables and functions */
int /*<<< orphan*/ toupper(char);
char *strupr(char *p) {
  char *x = p;
  while (*p)
    *p++ = toupper(*p);
  return x;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <strupr+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1124 <strupr+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strupr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
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 = %9, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = call i32 @toupper(i8 signext %11)
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
store i8 %13, i8* %14
br label %5
16: ; preds = %5
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @strupr(i8* returned %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* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i32 @toupper(i8 signext %5)
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %8, i8* %6
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i8* %0
}
unsigned put_byte(unsigned x, unsigned char b, int i) {
  unsigned mark = 0xFFFFFFFF << ((i + 1) * 8);
  unsigned as1 = x & mark;
  mark = 0xFFFFFFFF << (i * 8);
  unsigned as2 = x ^ (x & mark);
  unsigned place = b << (i * 8);
  unsigned result = as1 | as2 | place;
  return result;
}


x86 assembly (clang, -O0):
<put_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    $0x3,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0x10(%rbp),%ecx
xor    %ecx,%eax
mov    %eax,-0x18(%rbp)
movzbl -0x5(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_byte>:
lea    0x0(,%rdx,8),%r8d
lea    0x8(%r8),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    $0xffffffff,%eax
mov    %r8d,%ecx
shl    %cl,%eax
shl    %cl,%esi
not    %eax
or     %edx,%eax
and    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @put_byte(i32 %0, i8 zeroext %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
%14 = mul nsw i32 %13, 8
%15 = shl i32 -1, %14
store i32 %15, i32* %7
%16 = load i32, i32* %4
%17 = load i32, i32* %7
%18 = and i32 %16, %17
store i32 %18, i32* %8
%19 = load i32, i32* %6
%20 = mul nsw i32 %19, 8
%21 = shl i32 -1, %20
store i32 %21, i32* %7
%22 = load i32, i32* %4
%23 = load i32, i32* %4
%24 = load i32, i32* %7
%25 = and i32 %23, %24
%26 = xor i32 %22, %25
store i32 %26, i32* %9
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = load i32, i32* %6
%30 = mul nsw i32 %29, 8
%31 = shl i32 %28, %30
store i32 %31, i32* %10
%32 = load i32, i32* %8
%33 = load i32, i32* %9
%34 = or i32 %32, %33
%35 = load i32, i32* %10
%36 = or i32 %34, %35
store i32 %36, i32* %11
%37 = load i32, i32* %11
ret i32 %37
}

LLVM IR (-O2):
define i32 @put_byte(i32 %0, i8 zeroext %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = add i32 %4, 8
%6 = shl nsw i32 -1, %5
%7 = shl nsw i32 -1, %4
%8 = xor i32 %7, -1
%9 = zext i8 %1 to i32
%10 = shl i32 %9, %4
%11 = or i32 %6, %8
%12 = and i32 %11, %0
%13 = or i32 %12, %10
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ PrintOutPut(char *);
void PrintDash(int level) {
  int i;
  for (i = 0; i < level; i++) {
    PrintOutPut("-");
  }
}


x86 assembly (clang, -O0):
<PrintDash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <PrintDash+0x38>
lea    0xecb(%rip),%rdi
call   1030 <PrintOutPut@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <PrintDash+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintDash>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <PrintDash+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <PrintOutPut@plt>
add    $0xffffffff,%ebx
jne    1130 <PrintDash+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
define void @PrintDash(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @PrintOutPut(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
define void @PrintDash(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @PrintOutPut(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x68() {
  Assert_real((iscntrl(104) == 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",
              525, ("iscntrl should be 0 for h"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x68>:
push   %rax
mov    $0x68,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x20d,%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 = [26 x i8] c"iscntrl should be 0 for h\00"
define void @t_iscntrl_0x68() {
%1 = call i64 @iscntrl(i32 104)
%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 525, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"iscntrl should be 0 for h\00"
define void @t_iscntrl_0x68() {
%1 = tail call i64 @iscntrl(i32 104)
%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 525, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int alignof_long() {
  struct s {
    char x;
    long int y;
  };
  return sizeof(char) + (sizeof(struct s) - (sizeof(char) + sizeof(long int)));
}


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

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

LLVM IR (-O0):
define i32 @alignof_long() {
ret i32 8
}

LLVM IR (-O2):
define i32 @alignof_long() {
ret i32 8
}
/* Type definitions */
struct st_queue {
  int dummy;
};

/* Variables and functions */
int queue_top(struct st_queue *qu) {
  if (NULL == qu) {
    return -1;
  }
}


x86 assembly (clang, -O0):
<queue_top>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    111b <queue_top+0x1b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.st_queue = type { i32 }
define i32 @queue_top(%struct.st_queue* %0) {
%2 = alloca i32
%3 = alloca %struct.st_queue*
store %struct.st_queue* %0, %struct.st_queue** %3
%4 = load %struct.st_queue*, %struct.st_queue** %3
%5 = icmp eq %struct.st_queue* null, %4
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
%struct.st_queue = type { i32 }
define i32 @queue_top(%struct.st_queue* readnone %0) {
ret i32 -1
}
int do_rand(unsigned long *ctx) {
  long hi, lo, x;
  x = (*ctx % 0x7ffffffe) + 1;
  hi = x / 127773;
  lo = x % 127773;
  x = 16807 * lo - 2836 * hi;
  if (x < 0)
    x += 0x7fffffff;
  x--;
  *ctx = x;
  return (x);
}


x86 assembly (clang, -O0):
<do_rand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    $0x7ffffffe,%ecx
xor    %edx,%edx
div    %rcx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x1f31d,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x1f31d,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x18(%rbp)
imul   $0x41a7,-0x18(%rbp),%rax
imul   $0xb14,-0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1175 <do_rand+0x75>
mov    -0x20(%rbp),%rax
add    $0x7fffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_rand>:
mov    (%rdi),%rcx
mov    %rcx,%rax
shr    %rax
movabs $0x8000000200000009,%rdx
mul    %rdx
shr    $0x1d,%rdx
mov    %edx,%eax
shl    $0x1f,%eax
mov    %edx,%esi
sub    %eax,%esi
add    %edx,%esi
lea    (%rcx,%rsi,1),%eax
add    $0x1,%eax
imul   $0x69c16bd,%rax,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x10,%edx
imul   $0x1f31d,%edx,%ecx
sub    %ecx,%eax
imul   $0x41a7,%eax,%ecx
imul   $0xfffffffffffff4ec,%rdx,%rdx
lea    (%rdx,%rcx,1),%rax
add    $0x7fffffff,%rax
add    %rcx,%rdx
cmovns %rdx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define i32 @do_rand(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %2
%6 = load i64*, i64** %2
%7 = load i64, i64* %6
%8 = urem i64 %7, 2147483646
%9 = add i64 %8, 1
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = sdiv i64 %10, 127773
store i64 %11, i64* %3
%12 = load i64, i64* %5
%13 = srem i64 %12, 127773
store i64 %13, i64* %4
%14 = load i64, i64* %4
%15 = mul nsw i64 16807, %14
%16 = load i64, i64* %3
%17 = mul nsw i64 2836, %16
%18 = sub nsw i64 %15, %17
store i64 %18, i64* %5
%19 = load i64, i64* %5
%20 = icmp slt i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %1
%22 = load i64, i64* %5
%23 = add nsw i64 %22, 2147483647
store i64 %23, i64* %5
br label %24
24: ; preds = %21, %1
%25 = load i64, i64* %5
%26 = add nsw i64 %25, -1
store i64 %26, i64* %5
%27 = load i64, i64* %5
%28 = load i64*, i64** %2
store i64 %27, i64* %28
%29 = load i64, i64* %5
%30 = trunc i64 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @do_rand(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = urem i64 %2, 2147483646
%4 = trunc i64 %3 to i32
%5 = add nuw nsw i32 %4, 1
%6 = udiv i32 %5, 127773
%7 = zext i32 %6 to i64
%8 = urem i32 %5, 127773
%9 = mul nuw nsw i32 %8, 16807
%10 = zext i32 %9 to i64
%11 = mul nsw i64 %7, -2836
%12 = add nsw i64 %11, %10
%13 = icmp slt i64 %12, 0
%14 = add nsw i64 %12, 2147483647
%15 = select i1 %13, i64 %14, i64 %12
%16 = add nsw i64 %15, -1
store i64 %16, i64* %0
%17 = trunc i64 %16 to i32
ret i32 %17
}
double tsi2ts(isec)
int isec;
{ return ((double)isec + 946684800.0); }


x86 assembly (clang, -O0):
<tsi2ts>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsi2ts>:
cvtsi2sd %edi,%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @tsi2ts(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fadd double %4, 0x41CC36A1C0000000
ret double %5
}

LLVM IR (-O2):
define double @tsi2ts(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, 0x41CC36A1C0000000
ret double %3
}
long double test_tanl(long double x) { return __builtin_tanl(x); }


x86 assembly (clang, -O0):
<test_tanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <tanl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tanl>:
jmp    1030 <tanl@plt>

LLVM IR (-O0):
define x86_fp80 @test_tanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @tanl(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @test_tanl(x86_fp80 %0) {
%2 = tail call x86_fp80 @tanl(x86_fp80 %0)
ret x86_fp80 %2
}
long long triangular(int n) { return (n * (n + 1)) / 2; }


x86 assembly (clang, -O0):
<triangular>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangular>:
lea    0x1(%rdi),%eax
imul   %edi,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
ret

LLVM IR (-O0):
define i64 @triangular(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %3, %5
%7 = sdiv i32 %6, 2
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @triangular(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS7_ENVELOPE;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS7_ENVELOPE_it;
PKCS7_ENVELOPE *PKCS7_ENVELOPE_new(void) {
  return (PKCS7_ENVELOPE *)ASN1_item_new(&PKCS7_ENVELOPE_it);
}


x86 assembly (clang, -O0):
<PKCS7_ENVELOPE_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PKCS7_ENVELOPE_new>:
mov    0x2ed1(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@PKCS7_ENVELOPE_it = global i32 0
define i32* @PKCS7_ENVELOPE_new() {
%1 = call i64 @ASN1_item_new(i32* @PKCS7_ENVELOPE_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@PKCS7_ENVELOPE_it = global i32 0
define i32* @PKCS7_ENVELOPE_new() {
%1 = tail call i64 @ASN1_item_new(i32* @PKCS7_ENVELOPE_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
int config_clock_frequency_read(void) { return 12000000; }


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

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

LLVM IR (-O0):
define i32 @config_clock_frequency_read() {
ret i32 12000000
}

LLVM IR (-O2):
define i32 @config_clock_frequency_read() {
ret i32 12000000
}
unsigned long roundDiv(unsigned long q, unsigned long r) {
  unsigned long ret, doubleMod;
  if (q < r)
    return 0;
  ret = q / r;
  doubleMod = 2 * (q % r);
  if (doubleMod >= r)
    return (ret + 1);
  else
    return ret;
}


x86 assembly (clang, -O0):
<roundDiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1127 <roundDiv+0x27>
movq   $0x0,-0x8(%rbp)
jmp    1172 <roundDiv+0x72>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
shl    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     116a <roundDiv+0x6a>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <roundDiv+0x72>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundDiv>:
cmp    %rsi,%rdi
jae    1108 <roundDiv+0x8>
xor    %eax,%eax
ret
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     111e <roundDiv+0x1e>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    1124 <roundDiv+0x24>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
add    %rdx,%rdx
cmp    %rsi,%rdx
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @roundDiv(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i64 0, i64* %3
br label %28
12: ; preds = %2
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = udiv i64 %13, %14
store i64 %15, i64* %6
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = urem i64 %16, %17
%19 = mul i64 2, %18
store i64 %19, i64* %7
%20 = load i64, i64* %7
%21 = load i64, i64* %5
%22 = icmp uge i64 %20, %21
br i1 %22, label %23, label %26
23: ; preds = %12
%24 = load i64, i64* %6
%25 = add i64 %24, 1
store i64 %25, i64* %3
br label %28
26: ; preds = %12
%27 = load i64, i64* %6
store i64 %27, i64* %3
br label %28
28: ; preds = %26, %23, %11
%29 = load i64, i64* %3
ret i64 %29
}

LLVM IR (-O2):
define i64 @roundDiv(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = udiv i64 %0, %1
%6 = urem i64 %0, %1
%7 = shl i64 %6, 1
%8 = icmp uge i64 %7, %1
%9 = zext i1 %8 to i64
%10 = add i64 %5, %9
br label %11
11: ; preds = %4, %2
%12 = phi i64 [ 0, %2 ], [ %10, %4 ]
ret i64 %12
}
/* Type definitions */
typedef int sig_atomic_t;

/* Variables and functions */
int SIGWINCH;
void signal_sigwinch(int signo) {
  extern sig_atomic_t dirty_term_flag;
  if (signo != SIGWINCH)
    return;
  dirty_term_flag = 1;
}


x86 assembly (clang, -O0):
<signal_sigwinch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ecf(%rip),%rcx
cmp    (%rcx),%eax
je     111e <signal_sigwinch+0x1e>
jmp    112b <signal_sigwinch+0x2b>
mov    0x2ecb(%rip),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_sigwinch>:
mov    0x2ed9(%rip),%rax
cmp    %edi,(%rax)
jne    1118 <signal_sigwinch+0x18>
mov    0x2ede(%rip),%rax
movl   $0x1,(%rax)
ret

LLVM IR (-O0):
@SIGWINCH = global i32 0
@dirty_term_flag = external global i32
define void @signal_sigwinch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGWINCH
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
store i32 1, i32* @dirty_term_flag
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@SIGWINCH = global i32 0
@dirty_term_flag = external global i32
define void @signal_sigwinch(i32 %0) {
%2 = load i32, i32* @SIGWINCH
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 1, i32* @dirty_term_flag
br label %5
5: ; preds = %1, %4
ret void
}
/* Variables and functions */
int e_debug_map(unsigned int, void **, unsigned int *);
int /*<<< orphan*/ e_debug_unmap(char *);
int e_debug_write(unsigned addr, unsigned data) {
  int ret;
  unsigned offset;
  char *ptr;
  ret = e_debug_map(addr, (void **)&ptr, &offset);
  *((unsigned *)(ptr + offset)) = data;
  e_debug_unmap(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<e_debug_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <e_debug_map@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
call   1030 <e_debug_unmap@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_debug_write>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <e_debug_map@plt>
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%eax
mov    %ebx,(%rdi,%rax,1)
call   1030 <e_debug_unmap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @e_debug_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @e_debug_map(i32 %8, i8** %7, i32* %6)
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i8*, i8** %7
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = bitcast i8* %14 to i32*
store i32 %10, i32* %15
%16 = load i8*, i8** %7
%17 = call i32 @e_debug_unmap(i8* %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @e_debug_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = bitcast i32* %3 to i8*
%6 = bitcast i8** %4 to i8*
%7 = call i32 @e_debug_map(i32 %0, i8** %4, i32* %3)
%8 = load i8*, i8** %4
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = bitcast i8* %11 to i32*
store i32 %1, i32* %12
%13 = call i32 @e_debug_unmap(i8* %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ preload_seq(int);
void main(void) { preload_seq(452); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1c4,%edi
jmp    1030 <preload_seq@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @preload_seq(i32 452)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @preload_seq(i32 452)
ret void
}
int cairo_code_draw_casEnvelopeLabel_get_width() { return 57; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casEnvelopeLabel_get_width() {
ret i32 57
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casEnvelopeLabel_get_width() {
ret i32 57
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
scalar_t__ realloc(char *, int);
int /*<<< orphan*/ stdin;
char *readReference() {
  int size = 0;
  char *reference = NULL;
  do {
    size += 32;
    reference = (char *)realloc(reference, size);
  } while (!fgets(reference, size, stdin));
  return reference;
}


x86 assembly (clang, -O0):
<readReference>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    0x2e8a(%rip),%rax
mov    (%rax),%edx
call   1030 <fgets@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1137 <readReference+0x17>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readReference>:
push   %r15
push   %r14
push   %rbx
mov    $0x20,%ebx
xor    %r14d,%r14d
mov    0x2eb4(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <realloc@plt>
mov    %rax,%r14
mov    (%r15),%edx
mov    %rax,%rdi
mov    %ebx,%esi
call   1030 <fgets@plt>
add    $0x20,%ebx
test   %eax,%eax
je     1140 <readReference+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
define i8* @readReference() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 32
store i32 %5, i32* %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %1
%8 = call i64 @realloc(i8* %6, i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %2
br label %10
10: ; preds = %3
%11 = load i8*, i8** %2
%12 = load i32, i32* %1
%13 = load i32, i32* @stdin
%14 = call i32 @fgets(i8* %11, i32 %12, i32 %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %3, label %17
17: ; preds = %10
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@stdin = global i32 0
define i8* @readReference() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = phi i8* [ null, %0 ], [ %6, %1 ]
%4 = add nuw nsw i32 %2, 32
%5 = tail call i64 @realloc(i8* %3, i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = load i32, i32* @stdin
%8 = tail call i32 @fgets(i8* %6, i32 %4, i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %1, label %10
10: ; preds = %1
%11 = inttoptr i64 %5 to i8*
ret i8* %11
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, scalar_t__);
scalar_t__ strlen(char *);
void flu_zero_and_free(char *s, ssize_t n) {
  memset(s, 0, n < 0 ? strlen(s) : n);
  free(s);
}


x86 assembly (clang, -O0):
<flu_zero_and_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1165 <flu_zero_and_free+0x35>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
jmp    116d <flu_zero_and_free+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flu_zero_and_free>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
test   %rsi,%rsi
jns    1147 <flu_zero_and_free+0x17>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rax,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @flu_zero_and_free(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
br label %13
11: ; preds = %2
%12 = load i64, i64* %4
br label %13
13: ; preds = %11, %8
%14 = phi i64 [ %10, %8 ], [ %12, %11 ]
%15 = call i32 @memset(i8* %5, i32 0, i64 %14)
%16 = load i8*, i8** %3
%17 = call i32 @free(i8* %16)
ret void
}

LLVM IR (-O2):
define void @flu_zero_and_free(i8* %0, i64 %1) {
%3 = icmp slt i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ %1, %2 ]
%8 = tail call i32 @memset(i8* %0, i32 0, i64 %7)
%9 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int do_ping_pong(int, char *, int);
int sprintf(char *, char *);
int set_data(int fd) {
  int rc;
  char buff[1024];
  rc = sprintf(buff, "DATA\n");
  rc = do_ping_pong(fd, buff, rc);
  if (rc == -3)
    rc = 0;
  return rc;
}


x86 assembly (clang, -O0):
<set_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
lea    0xec4(%rip),%rsi
call   1040 <sprintf@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1030 <do_ping_pong@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xfffffffd,-0x8(%rbp)
jne    116a <set_data+0x4a>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_data>:
sub    $0x408,%rsp
movw   $0xa,0x4(%rsp)
movl   $0x41544144,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edx
call   1030 <do_ping_pong@plt>
xor    %ecx,%ecx
cmp    $0xfffffffd,%eax
cmove  %ecx,%eax
add    $0x408,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"DATA\0A\00"
define i32 @set_data(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1024 x i8]
store i32 %0, i32* %2
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @do_ping_pong(i32 %7, i8* %8, i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, -3
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 0, i32* %3
br label %14
14: ; preds = %13, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"DATA\0A\00"
define i32 @set_data(i32 %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @do_ping_pong(i32 %0, i8* %3, i32 5)
%5 = icmp eq i32 %4, -3
%6 = select i1 %5, i32 0, i32 %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("%d\n%d\n", a * a, a * a * a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
imul   %esi,%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
const char *hpgs_i18n(const char *msg) { return msg; }


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

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

LLVM IR (-O0):
define i8* @hpgs_i18n(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @hpgs_i18n(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char **argv) {
  system("ls -a");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"ls -a\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"ls -a\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}