xunge/DecIR huggingface dataset:
/* Variables and functions */
int fork();
int /*<<< orphan*/ pi_shutdown_blocking(int);
void pi_shutdown(int delay) {
  int pid = fork();
  if (pid == 0) {
    pi_shutdown_blocking(delay);
  }
}


x86 assembly (clang, -O0):
<pi_shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1147 <pi_shutdown+0x27>
mov    -0x4(%rbp),%edi
call   1030 <pi_shutdown_blocking@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pi_shutdown>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
je     1130 <pi_shutdown+0x10>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <pi_shutdown_blocking@plt>

LLVM IR (-O0):
define void @pi_shutdown(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @fork()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @pi_shutdown_blocking(i32 %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @pi_shutdown(i32 %0) {
%2 = tail call i32 (...) @fork()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pi_shutdown_blocking(i32 %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_pdmatrix(double **m) {
  free((char *)(m[0]));
  free((char *)(m));
}


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

x86 assembly (clang, -O2):
<free_pdmatrix>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_pdmatrix(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = getelementptr inbounds double*, double** %3, i64 0
%5 = load double*, double** %4
%6 = bitcast double* %5 to i8*
%7 = call i32 @free(i8* %6)
%8 = load double**, double*** %2
%9 = bitcast double** %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @free_pdmatrix(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
%5 = bitcast double** %0 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
void byte_zero(void *yv, long long ylen) {
  char *y = yv;
  while (ylen > 0) {
    *y++ = 0;
    --ylen;
  }
}


x86 assembly (clang, -O0):
<byte_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1142 <byte_zero+0x42>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <byte_zero+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_zero>:
test   %rsi,%rsi
jle    1124 <byte_zero+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @byte_zero(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int spi_comms(int *, int, int *, int);
int write_byte(uint8_t reg, uint8_t value) {
  uint8_t tx_buf[2] = {0};
  uint8_t rx_buf[2] = {0};
  uint8_t shift_reg = reg & ~0x80;
  tx_buf[0] = shift_reg;
  tx_buf[1] = value;
  return spi_comms(tx_buf, 2, rx_buf, 2);
}


x86 assembly (clang, -O0):
<write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x4(%rbp),%eax
and    $0xffffff7f,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rdx
mov    $0x2,%ecx
mov    %ecx,%esi
call   1040 <spi_comms@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_byte>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
and    $0xffffff7f,%edi
mov    %edi,0x8(%rsp)
mov    %esi,0xc(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rdx
mov    $0x2,%esi
mov    $0x2,%ecx
call   1030 <spi_comms@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @write_byte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
%6 = alloca [2 x i32]
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = bitcast [2 x i32]* %5 to i8*
%9 = bitcast [2 x i32]* %6 to i8*
%10 = load i32, i32* %3
%11 = and i32 %10, -129
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %12, i32* %13
%14 = load i32, i32* %4
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %14, i32* %15
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%18 = call i32 @spi_comms(i32* %16, i32 2, i32* %17, i32 2)
ret i32 %18
}

LLVM IR (-O2):
define i32 @write_byte(i32 %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to [2 x i32]*
%5 = alloca i64
%6 = bitcast i64* %3 to i8*
%7 = bitcast i64* %5 to i8*
store i64 0, i64* %5
%8 = and i32 %0, -129
%9 = bitcast i64* %3 to i32*
store i32 %8, i32* %9
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %1, i32* %10
%11 = bitcast i64* %5 to i32*
%12 = call i32 @spi_comms(i32* %9, i32 2, i32* %11, i32 2)
ret i32 %12
}
unsigned long USB_ETH_DrvSetHostAssembleParam(unsigned long ulHostOutTimeout) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @USB_ETH_DrvSetHostAssembleParam(i64 %0) {
ret i64 0
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ write(int, unsigned char const *, size_t);
void write_n(const unsigned char *buf, size_t count) {
  while (count) {
    ssize_t wrote = write(1, buf, count);
    if (wrote <= 0)
      abort();
    count -= wrote;
    buf += wrote;
  }
}


x86 assembly (clang, -O0):
<write_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1183 <write_n+0x63>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1040 <write@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jg     1163 <write_n+0x43>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <write_n+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_n>:
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
je     114d <write_n+0x2d>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <write@plt>
test   %rax,%rax
jle    1155 <write_n+0x35>
add    %rax,%rbx
sub    %rax,%r14
jne    1130 <write_n+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @write_n(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %4
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i64 @write(i32 1, i8* %10, i64 %11)
store i64 %12, i64* %5
%13 = load i64, i64* %5
%14 = icmp sle i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %9
%18 = load i64, i64* %5
%19 = load i64, i64* %4
%20 = sub i64 %19, %18
store i64 %20, i64* %4
%21 = load i64, i64* %5
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 %21
store i8* %23, i8** %3
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @write_n(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %11
%5 = phi i8* [ %13, %11 ], [ %0, %2 ]
%6 = phi i64 [ %12, %11 ], [ %1, %2 ]
%7 = tail call i64 @write(i32 1, i8* %5, i64 %6)
%8 = icmp slt i64 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %4
%12 = sub i64 %6, %7
%13 = getelementptr inbounds i8, i8* %5, i64 %7
%14 = icmp eq i64 %12, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run();
int main(int c, char **v) {
  run();
  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)
mov    $0x0,%al
call   1030 <run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 (...) @run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @run()
ret i32 0
}
int block_cli_if_desc_update_post_fault_lock_component_free() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @block_cli_if_desc_update_post_fault_lock_component_free() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ dwt_write8bitoffsetreg(int, int, int);
void _dwt_aonarrayupload(void) {
  dwt_write8bitoffsetreg(0x2C, 0x02, 0x00);
  dwt_write8bitoffsetreg(0x2C, 0x02, 0x02);
}


x86 assembly (clang, -O0):
<_dwt_aonarrayupload>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2c,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <dwt_write8bitoffsetreg@plt>
mov    $0x2c,%edi
mov    $0x2,%edx
mov    %edx,%esi
call   1030 <dwt_write8bitoffsetreg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dwt_aonarrayupload>:
push   %rax
mov    $0x2c,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <dwt_write8bitoffsetreg@plt>
mov    $0x2c,%edi
mov    $0x2,%esi
mov    $0x2,%edx
pop    %rax
jmp    1030 <dwt_write8bitoffsetreg@plt>

LLVM IR (-O0):
define void @_dwt_aonarrayupload() {
%1 = call i32 @dwt_write8bitoffsetreg(i32 44, i32 2, i32 0)
%2 = call i32 @dwt_write8bitoffsetreg(i32 44, i32 2, i32 2)
ret void
}

LLVM IR (-O2):
define void @_dwt_aonarrayupload() {
%1 = tail call i32 @dwt_write8bitoffsetreg(i32 44, i32 2, i32 0)
%2 = tail call i32 @dwt_write8bitoffsetreg(i32 44, i32 2, i32 2)
ret void
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *gethostbyname(char *);
struct hostent *resolvehost(char *name) {
  static struct hostent *he = 0;
  he = gethostbyname(name);
  return he;
}


x86 assembly (clang, -O0):
<resolvehost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gethostbyname@plt>
mov    %rax,0x2f04(%rip)
mov    0x2efd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resolvehost>:
push   %rax
call   1030 <gethostbyname@plt>
mov    %rax,0x2f13(%rip)
pop    %rcx
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
@resolvehost.he = internal global %struct.hostent* null
define %struct.hostent* @resolvehost(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.hostent* @gethostbyname(i8* %3)
store %struct.hostent* %4, %struct.hostent** @resolvehost.he
%5 = load %struct.hostent*, %struct.hostent** @resolvehost.he
ret %struct.hostent* %5
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@resolvehost.he = internal unnamed_addr global %struct.hostent* null
define %struct.hostent* @resolvehost(i8* %0) {
%2 = tail call %struct.hostent* @gethostbyname(i8* %0)
store %struct.hostent* %2, %struct.hostent** @resolvehost.he
ret %struct.hostent* %2
}
/* Variables and functions */
int /*<<< orphan*/ m1Impl();
int main(int argc, char *argv[]) {
#pragma omp parallel sections
  {
#pragma omp section
    { m1Impl(); }
  }
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @m1Impl()
ret i32 0
}
int test_imm_A2int16_mem(short *val) {
  return ((*val) & (-0xA2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A2int16_mem>:
movzwl (%rdi),%eax
test   $0xff5e,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A2int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -162
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int foo(int a, int b, int c, int d) {
  unsigned int s = 0;
  s += a;
  s += b;
  s += c;
  s += d;
  return s;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %5
%11 = load i32, i32* %9
%12 = add i32 %11, %10
store i32 %12, i32* %9
%13 = load i32, i32* %6
%14 = load i32, i32* %9
%15 = add i32 %14, %13
store i32 %15, i32* %9
%16 = load i32, i32* %7
%17 = load i32, i32* %9
%18 = add i32 %17, %16
store i32 %18, i32* %9
%19 = load i32, i32* %8
%20 = load i32, i32* %9
%21 = add i32 %20, %19
store i32 %21, i32* %9
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %1, %0
%6 = add i32 %5, %2
%7 = add i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("\nUsage: crackpkcs12 -d <dictionary_file> [ -v ] [ -s "
         "<message_interval> ] <file_to_crack>\n"
         "\n"
         "  -d <dictionary_file>     Specify dictionary file path\n"
         "  -v                       Verbose mode\n"
         "  -s <message_inteval>     Number of attemps between messages "
         "(implied -v)\n\n");
  exit(100);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [264 x i8] c"\0AUsage: crackpkcs12 -d <dictionary_file> [ -v ] [ -s <message_interval> ] <file_to_crack>\0A\0A -d <dictionary_file> Specify dictionary file path\0A -v Verbose mode\0A -s <message_inteval> Number of attemps between messages (implied -v)\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([264 x i8], [264 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 100)
unreachable
}

LLVM IR (-O2):
@str = [263 x i8] c"\0AUsage: crackpkcs12 -d <dictionary_file> [ -v ] [ -s <message_interval> ] <file_to_crack>\0A\0A -d <dictionary_file> Specify dictionary file path\0A -v Verbose mode\0A -s <message_inteval> Number of attemps between messages (implied -v)\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([263 x i8], [263 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 100)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar(void) { printf("hello bar\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"hello bar\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ port_byte_out(int, unsigned char);
void set_cursor_offset(int offset) {
  offset /= 2;
  port_byte_out(0x3d4, 14);
  port_byte_out(0x3d5, (unsigned char)(offset >> 8));
  port_byte_out(0x3d4, 15);
  port_byte_out(0x3d5, (unsigned char)(offset & 0xff));
}


x86 assembly (clang, -O0):
<set_cursor_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <port_byte_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cursor_offset>:
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%ebx
add    %edi,%ebx
sar    %ebx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
call   1030 <port_byte_out@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <port_byte_out@plt>

LLVM IR (-O0):
define void @set_cursor_offset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
store i32 %4, i32* %2
%5 = call i32 @port_byte_out(i32 980, i8 zeroext 14)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = trunc i32 %7 to i8
%9 = call i32 @port_byte_out(i32 981, i8 zeroext %8)
%10 = call i32 @port_byte_out(i32 980, i8 zeroext 15)
%11 = load i32, i32* %2
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = call i32 @port_byte_out(i32 981, i8 zeroext %13)
ret void
}

LLVM IR (-O2):
define void @set_cursor_offset(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = tail call i32 @port_byte_out(i32 980, i8 zeroext 14)
%4 = lshr i32 %2, 8
%5 = trunc i32 %4 to i8
%6 = tail call i32 @port_byte_out(i32 981, i8 zeroext %5)
%7 = tail call i32 @port_byte_out(i32 980, i8 zeroext 15)
%8 = trunc i32 %2 to i8
%9 = tail call i32 @port_byte_out(i32 981, i8 zeroext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void function_empty_name() { write("csv-task.csv", ",", NULL); }


x86 assembly (clang, -O0):
<function_empty_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeeb(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_empty_name>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [2 x i8] c",\00"
define void @function_empty_name() {
%1 = call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [2 x i8] c",\00"
define void @function_empty_name() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
void gtk_false() {}


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

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

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

LLVM IR (-O2):
define void @gtk_false() {
ret void
}
int main() {
  __asm__("next: jmp next");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "next: jmp next", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
void *k_request_memory_block(void) { return (void *)0; }


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

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

LLVM IR (-O0):
define i8* @k_request_memory_block() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @k_request_memory_block() {
ret i8* null
}
int shlibfunc() { return 42; }


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

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

LLVM IR (-O0):
define i32 @shlibfunc() {
ret i32 42
}

LLVM IR (-O2):
define i32 @shlibfunc() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_48(void) { DeinitFields(); }


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

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

LLVM IR (-O0):
define void @SwitchFrom_48() {
%1 = call i32 (...) @DeinitFields()
ret void
}

LLVM IR (-O2):
define void @SwitchFrom_48() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
unsigned long foo(unsigned long n) { return (~n >> 3) & 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
shr    $0x3,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rax
not    %eax
shr    $0x3,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = lshr i64 %4, 3
%6 = and i64 %5, 1
ret i64 %6
}

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = xor i64 %0, -1
%3 = lshr i64 %2, 3
%4 = and i64 %3, 1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ Atm128GpioInterruptC__2__Interrupt__default__fired();
void Atm128GpioInterruptC__2__Interrupt__fired(void) {
  Atm128GpioInterruptC__2__Interrupt__default__fired();
}


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

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

LLVM IR (-O0):
define void @Atm128GpioInterruptC__2__Interrupt__fired() {
%1 = call i32 (...) @Atm128GpioInterruptC__2__Interrupt__default__fired()
ret void
}

LLVM IR (-O2):
define void @Atm128GpioInterruptC__2__Interrupt__fired() {
%1 = tail call i32 (...) @Atm128GpioInterruptC__2__Interrupt__default__fired()
ret void
}
int trace_seq_path(struct trace_seq *s, struct path *path) { return 0; }


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

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

LLVM IR (-O0):
%struct.trace_seq = type opaque
%struct.path = type opaque
define i32 @trace_seq_path(%struct.trace_seq* %0, %struct.path* %1) {
%3 = alloca %struct.trace_seq*
%4 = alloca %struct.path*
store %struct.trace_seq* %0, %struct.trace_seq** %3
store %struct.path* %1, %struct.path** %4
ret i32 0
}

LLVM IR (-O2):
%struct.trace_seq = type opaque
%struct.path = type opaque
define i32 @trace_seq_path(%struct.trace_seq* nocapture readnone %0, %struct.path* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
scalar_t__ strlen(char const *);
void replMessageCallback(const char *ptr) {
  if (ptr && strlen(ptr) > 0) {
    printf("%s\n", ptr);
  }
}


x86 assembly (clang, -O0):
<replMessageCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115a <replMessageCallback+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    115a <replMessageCallback+0x3a>
mov    -0x8(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replMessageCallback>:
push   %rbx
test   %rdi,%rdi
je     1143 <replMessageCallback+0x23>
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
jle    1143 <replMessageCallback+0x23>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @replMessageCallback(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %5, %1
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @replMessageCallback(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %3, %1
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
size_t get_number_of_digits(int64_t value) {
  size_t result = 0U;
  value = (value < 0) ? (-value) : (value);
  while (value > 0) {
    result++;
    value /= 10;
  }
  return result;
}


x86 assembly (clang, -O0):
<get_number_of_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1126 <get_number_of_digits+0x26>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112c <get_number_of_digits+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    115b <get_number_of_digits+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1132 <get_number_of_digits+0x32>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number_of_digits>:
test   %edi,%edi
je     1136 <get_number_of_digits+0x36>
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
xor    %eax,%eax
mov    $0xcccccccd,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rax
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
cmp    $0x9,%ecx
mov    %esi,%ecx
ja     1120 <get_number_of_digits+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @get_number_of_digits(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 0, i64* %3
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
store i32 %12, i32* %2
br label %13
13: ; preds = %16, %11
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i64, i64* %3
%18 = add i64 %17, 1
store i64 %18, i64* %3
%19 = load i32, i32* %2
%20 = sdiv i32 %19, 10
store i32 %20, i32* %2
br label %13
21: ; preds = %13
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @get_number_of_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %8, %5 ], [ 0, %3 ]
%7 = phi i32 [ %9, %5 ], [ %4, %3 ]
%8 = add i64 %6, 1
%9 = udiv i32 %7, 10
%10 = icmp ult i32 %7, 10
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i64 [ 0, %1 ], [ %8, %5 ]
ret i64 %12
}
void XGetWindowProperty() {}


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

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

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

LLVM IR (-O2):
define void @XGetWindowProperty() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pow(int, int);
int round(int /*<<< orphan*/);
int square(int value) { return round(pow(value, 2)); }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %eax,%edi
call   1040 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
push   %rax
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <round@plt>

LLVM IR (-O0):
define i32 @square(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @pow(i32 %3, i32 2)
%5 = call i32 @round(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @square(i32 %0) {
%2 = tail call i32 @pow(i32 %0, i32 2)
%3 = tail call i32 @round(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_110() {
  Assert_real((isqrt(110) == 10),
              "/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/stdlib/isqrt.c",
              555, ("Integer square root of 110 should be 10"));
}


x86 assembly (clang, -O0):
<t_sqrt_110>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6e,%edi
call   1030 <isqrt@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x22b,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_110>:
push   %rax
mov    $0x6e,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x22b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 110 should be 10\00"
define void @t_sqrt_110() {
%1 = call i32 @isqrt(i32 110)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 555, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 110 should be 10\00"
define void @t_sqrt_110() {
%1 = tail call i32 @isqrt(i32 110)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 555, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int exp(float);
float sigmoid(float x) { return 1 / (1 + exp(-x)); }


x86 assembly (clang, -O0):
<sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <exp@plt>
lea    0x1(%rax),%ecx
add    $0x2,%eax
xor    %edx,%edx
cmp    $0x3,%eax
cmovb  %ecx,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sigmoid(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call i32 @exp(float %4)
%6 = add nsw i32 1, %5
%7 = sdiv i32 1, %6
%8 = sitofp i32 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @sigmoid(float %0) {
%2 = fneg float %0
%3 = tail call i32 @exp(float %2)
%4 = add nsw i32 %3, 1
%5 = add i32 %3, 2
%6 = icmp ult i32 %5, 3
%7 = select i1 %6, i32 %4, i32 0
%8 = sitofp i32 %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x13() {
  Assert_real((isprint(19) == 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_isprint.c",
              100, ("isprint should be 0 for 0x13"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x13>:
push   %rax
mov    $0x13,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x64,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x13\00"
define void @t_isprint_0x13() {
%1 = call i64 @isprint(i32 19)
%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 100, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x13\00"
define void @t_isprint_0x13() {
%1 = tail call i64 @isprint(i32 19)
%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 100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void X509V3_EXT_add_conf(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_EXT_add_conf() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_replace_standard_solution(int n, int k, int m, double *sol) {
  int b[2], fail;
  b[0] = n;
  b[1] = m;
  fail = _ada_use_c2phc(35, &k, b, sol);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_replace_standard_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x23,%edi
lea    -0x8(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_replace_standard_solution>:
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
mov    %edi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    $0x23,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @solcon_replace_standard_solution(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca [2 x i32]
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double* %3, double** %8
%11 = load i32, i32* %5
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %7
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%16 = load double*, double** %8
%17 = call i32 @_ada_use_c2phc(i32 35, i32* %6, i32* %15, double* %16)
store i32 %17, i32* %10
%18 = load i32, i32* %10
ret i32 %18
}

LLVM IR (-O2):
define i32 @solcon_replace_standard_solution(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %1, i32* %5
%7 = bitcast [2 x i32]* %6 to i8*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 %0, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 %2, i32* %9
%10 = call i32 @_ada_use_c2phc(i32 35, i32* %5, i32* %8, double* %3)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *strstr(char *, char *);
extern int str_rm_and_before(char *s, char *t) {
  char *p = strstr(s, t);
  if (!p)
    return 0;
  strcpy(s, p + strlen(t));
  return 1;
}


x86 assembly (clang, -O0):
<str_rm_and_before>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1168 <str_rm_and_before+0x38>
movl   $0x0,-0x4(%rbp)
jmp    119a <str_rm_and_before+0x6a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdi
cltq
add    %rax,%rsi
call   1030 <strcpy@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_rm_and_before>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
call   1050 <strstr@plt>
test   %rax,%rax
je     1167 <str_rm_and_before+0x37>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
add    %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    $0x1,%eax
jmp    1169 <str_rm_and_before+0x39>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @str_rm_and_before(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i8* @strstr(i8* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 0, i32* %3
br label %21
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = load i8*, i8** %6
%16 = load i8*, i8** %5
%17 = call i32 @strlen(i8* %16)
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
%20 = call i32 @strcpy(i8* %14, i8* %19)
store i32 1, i32* %3
br label %21
21: ; preds = %13, %12
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @str_rm_and_before(i8* %0, i8* %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %1)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = tail call i32 @strcpy(i8* %0, i8* %8)
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ f();
int g(int /*<<< orphan*/);
int main(void) { return g(f()); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = call i32 @g(i32 %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @g(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ param;

/* Variables and functions */
int fill_normal_config_req(unsigned char *, int, int, int, unsigned char *);
int fill_network_list_req(unsigned char *buf) {
  unsigned char param[0x2] = {0x00, 0x00};
  return fill_normal_config_req(buf, 0x24, 0x1, sizeof(param), param);
}


x86 assembly (clang, -O0):
<fill_network_list_req>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xa(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0xa(%rbp),%r8
mov    $0x24,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <fill_normal_config_req@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_network_list_req>:
push   %rax
movw   $0x0,0x6(%rsp)
lea    0x6(%rsp),%r8
mov    $0x24,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <fill_normal_config_req@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fill_network_list_req(i8* %0) {
%2 = alloca i8*
%3 = alloca [2 x i8]
store i8* %0, i8** %2
%4 = bitcast [2 x i8]* %3 to i8*
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%7 = call i32 @fill_normal_config_req(i8* %5, i32 36, i32 1, i32 2, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @fill_network_list_req(i8* %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
store i16 0, i16* %2
%4 = call i32 @fill_normal_config_req(i8* %0, i32 36, i32 1, i32 2, i8* %3)
ret i32 %4
}
unsigned isPressed(unsigned bitfield) {
  return ((~*(unsigned *)0x10146000) & 0xFFF) == (bitfield & 0xFFF) ? 1 : 0;
}


x86 assembly (clang, -O0):
<isPressed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x10146000,%eax
mov    (%rax),%edx
xor    $0xffffffff,%edx
and    $0xfff,%edx
mov    -0x4(%rbp),%esi
and    $0xfff,%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPressed>:
mov    0x10146000,%ecx
not    %ecx
and    $0xfff,%ecx
and    $0xfff,%edi
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @isPressed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* inttoptr (i64 269770752 to i32*)
%4 = xor i32 %3, -1
%5 = and i32 %4, 4095
%6 = load i32, i32* %2
%7 = and i32 %6, 4095
%8 = icmp eq i32 %5, %7
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @isPressed(i32 %0) {
%2 = load i32, i32* inttoptr (i64 269770752 to i32*)
%3 = and i32 %2, 4095
%4 = xor i32 %3, 4095
%5 = and i32 %0, 4095
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
unsigned short endianSwap(unsigned char one, unsigned char two) {
  short temp = two << 8;
  temp = temp | one;
  return temp;
}


x86 assembly (clang, -O0):
<endianSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endianSwap>:
shl    $0x8,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define zeroext i16 @endianSwap(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i16
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 8
%9 = trunc i32 %8 to i16
store i16 %9, i16* %5
%10 = load i16, i16* %5
%11 = sext i16 %10 to i32
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i16
store i16 %15, i16* %5
%16 = load i16, i16* %5
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @endianSwap(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i16
%4 = shl nuw i16 %3, 8
%5 = zext i8 %0 to i16
%6 = or i16 %4, %5
ret i16 %6
}
int test_imm_5Euint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x5E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Euint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 94
%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_5Euint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 94
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}