xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getNumShards(char *);
int main(int argc, char **argv) {
  getNumShards(argv[1]);
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <getNumShards@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <getNumShards@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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @getNumShards(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @getNumShards(i8* %4)
ret i32 0
}
/* Variables and functions */
float randu32();
float oct_float_randu(void) { return randu32(); }


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

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

LLVM IR (-O0):
define float @oct_float_randu() {
%1 = call float (...) @randu32()
ret float %1
}

LLVM IR (-O2):
define float @oct_float_randu() {
%1 = tail call float (...) @randu32()
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ bbm_byte_write(void *, int, int, int);
int /*<<< orphan*/ msWait(int);
int fc8300_reset(void *handle, unsigned short devid) {
  bbm_byte_write(handle, 0x5f04, 0x0001, 0x7f);
  msWait(2);
  bbm_byte_write(handle, 0x5f04, 0x0001, 0xcf);
  msWait(2);
  bbm_byte_write(handle, 0x5800, 0x0001, 0xff);
  msWait(2);
  return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x1,%edx
mov    $0x7f,%ecx
call   1030 <bbm_byte_write@plt>
mov    $0x2,%edi
call   1040 <msWait@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x1,%edx
mov    $0xcf,%ecx
call   1030 <bbm_byte_write@plt>
mov    $0x2,%edi
call   1040 <msWait@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5800,%esi
mov    $0x1,%edx
mov    $0xff,%ecx
call   1030 <bbm_byte_write@plt>
mov    $0x2,%edi
call   1040 <msWait@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
mov    $0x5f04,%esi
mov    $0x1,%edx
mov    $0x7f,%ecx
call   1030 <bbm_byte_write@plt>
mov    $0x2,%edi
call   1040 <msWait@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x1,%edx
mov    $0xcf,%ecx
call   1030 <bbm_byte_write@plt>
mov    $0x2,%edi
call   1040 <msWait@plt>
mov    %rbx,%rdi
mov    $0x5800,%esi
mov    $0x1,%edx
mov    $0xff,%ecx
call   1030 <bbm_byte_write@plt>
mov    $0x2,%edi
call   1040 <msWait@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fc8300_reset(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = call i32 @bbm_byte_write(i8* %5, i32 24324, i32 1, i32 127)
%7 = call i32 @msWait(i32 2)
%8 = load i8*, i8** %3
%9 = call i32 @bbm_byte_write(i8* %8, i32 24324, i32 1, i32 207)
%10 = call i32 @msWait(i32 2)
%11 = load i8*, i8** %3
%12 = call i32 @bbm_byte_write(i8* %11, i32 22528, i32 1, i32 255)
%13 = call i32 @msWait(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @fc8300_reset(i8* %0, i16 zeroext %1) {
%3 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 1, i32 127)
%4 = tail call i32 @msWait(i32 2)
%5 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 1, i32 207)
%6 = tail call i32 @msWait(i32 2)
%7 = tail call i32 @bbm_byte_write(i8* %0, i32 22528, i32 1, i32 255)
%8 = tail call i32 @msWait(i32 2)
ret i32 0
}
void f149(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
  a:
    ({
      goto a;
      0;
    });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f149>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    1120 <f149+0x20>

x86 assembly (clang, -O2):
<f149>:
jmp    1100 <f149>

LLVM IR (-O0):
define void @f149() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = load i32, i32* %1
store i32 0, i32* %2
%8 = load i32, i32* %2
store i32 0, i32* %3
%9 = load i32, i32* %3
store i32 0, i32* %4
%10 = load i32, i32* %4
br label %11
11: ; preds = %11, %0
br label %11
}

LLVM IR (-O2):
define void @f149() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_IFCHR;
int _fstat(int fd, struct stat *buf) {
  buf->st_mode = S_IFCHR;
  return (0);
}


x86 assembly (clang, -O0):
<_fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fstat>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFCHR = global i32 0
define i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @S_IFCHR
%6 = load %struct.stat*, %struct.stat** %4
%7 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
store i32 %5, i32* %7
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFCHR = global i32 0
define i32 @_fstat(i32 %0, %struct.stat* nocapture writeonly %1) {
%3 = load i32, i32* @S_IFCHR
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
store i32 %3, i32* %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ qsort(void *, int, int, int (*)(void const *, void const *));
void xqsort(void *data, int n, int elemsize,
            int (*cmp)(const void *, const void *)) {
  qsort(data, n, elemsize, cmp);
}


x86 assembly (clang, -O0):
<xqsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xqsort>:
jmp    1030 <qsort@plt>

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

LLVM IR (-O2):
define void @xqsort(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* nocapture %3) {
%5 = tail call i32 @qsort(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* %3)
ret void
}
void RTSemFastMutexRequest(void) {}


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

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

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

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

/* Variables and functions */
void bcf_float_set(float *ptr, uint32_t value) {
  union {
    uint32_t i;
    float f;
  } u;
  u.i = value;
  *ptr = u.f;
}


x86 assembly (clang, -O0):
<bcf_float_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcf_float_set>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define void @bcf_float_set(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca %union.anon
store float* %0, float** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = bitcast %union.anon* %5 to i32*
store i32 %6, i32* %7
%8 = bitcast %union.anon* %5 to float*
%9 = load float, float* %8
%10 = load float*, float** %3
store float %9, float* %10
ret void
}

LLVM IR (-O2):
define void @bcf_float_set(float* nocapture writeonly %0, i32 %1) {
%3 = bitcast float* %0 to i32*
store i32 %1, i32* %3
ret void
}
char *langRomTypeKoei() { return "Koei (SRAM)"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Koei (SRAM)\00"
define i8* @langRomTypeKoei() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"Koei (SRAM)\00"
define i8* @langRomTypeKoei() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
float fx(float x) { return 1.0 + 3.0 / (2.302585093 * x); }


x86 assembly (clang, -O0):
<fx>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xef6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fx>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fx(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 0x40026BB1BBB58975, %4
%6 = fdiv double 3.000000e+00, %5
%7 = fadd double 1.000000e+00, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @fx(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x40026BB1BBB58975
%4 = fdiv double 3.000000e+00, %3
%5 = fadd double %4, 1.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}
void const *const constructNode(const void *const data, void *userdata) {
  return data;
}


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

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

LLVM IR (-O0):
define i8* @constructNode(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
ret i8* %5
}

LLVM IR (-O2):
define i8* @constructNode(i8* readnone returned %0, i8* nocapture readnone %1) {
ret i8* %0
}
void a_out_exec(const char *path) {}


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

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

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

LLVM IR (-O2):
define void @a_out_exec(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int *malloc(int);
void f(uint8_t **x) {
  *x = malloc(sizeof(uint8_t));
  **x = 42;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x2a,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
movl   $0x2a,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @f(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = call i32* @malloc(i32 4)
%4 = load i32**, i32*** %2
store i32* %3, i32** %4
%5 = load i32**, i32*** %2
%6 = load i32*, i32** %5
store i32 42, i32* %6
ret void
}

LLVM IR (-O2):
define void @f(i32** nocapture writeonly %0) {
%2 = tail call i32* @malloc(i32 4)
store i32* %2, i32** %0
store i32 42, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ benchmark();
int /*<<< orphan*/ initialise_board();
int /*<<< orphan*/ start_trigger();
int /*<<< orphan*/ stop_trigger();
int main(void) {
  int i;
  initialise_board();
  start_trigger();
  for (i = 0; i < (1 >> 0); i++)
    benchmark();
  stop_trigger();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <initialise_board@plt>
mov    $0x0,%al
call   1030 <start_trigger@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1183 <main+0x43>
mov    $0x0,%al
call   1050 <benchmark@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x24>
mov    $0x0,%al
call   1040 <stop_trigger@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <initialise_board@plt>
xor    %eax,%eax
call   1030 <start_trigger@plt>
xor    %eax,%eax
call   1050 <benchmark@plt>
xor    %eax,%eax
call   1040 <stop_trigger@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @initialise_board()
%4 = call i32 (...) @start_trigger()
store i32 0, i32* %2
br label %5
5: ; preds = %10, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = call i32 (...) @benchmark()
br label %10
10: ; preds = %8
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %5
13: ; preds = %5
%14 = call i32 (...) @stop_trigger()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialise_board()
%2 = tail call i32 (...) @start_trigger()
%3 = tail call i32 (...) @benchmark()
%4 = tail call i32 (...) @stop_trigger()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int __IUSAT(int, int);
__attribute__((always_)) uint32_t __UQSUB16(uint32_t x, uint32_t y) {
  int32_t r, s;
  r = __IUSAT((((x << 16) >> 16) - ((y << 16) >> 16)), 16) & 0x0000FFFF;
  s = __IUSAT((((x) >> 16) - ((y) >> 16)), 16) & 0x0000FFFF;
  return ((s << 16) | (r));
}


x86 assembly (clang, -O0):
<__UQSUB16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x10,%edi
sar    $0x10,%edi
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
sar    $0x10,%eax
sub    %eax,%edi
mov    $0x10,%esi
call   1030 <__IUSAT@plt>
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
sub    %eax,%edi
mov    $0x10,%esi
call   1030 <__IUSAT@plt>
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__UQSUB16>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
movswl %bp,%edi
movswl %bx,%eax
sub    %eax,%edi
mov    $0x10,%esi
call   1030 <__IUSAT@plt>
movzwl %ax,%r14d
sar    $0x10,%ebp
sar    $0x10,%ebx
sub    %ebx,%ebp
mov    %ebp,%edi
mov    $0x10,%esi
call   1030 <__IUSAT@plt>
shl    $0x10,%eax
or     %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__UQSUB16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = shl i32 %7, 16
%9 = ashr i32 %8, 16
%10 = load i32, i32* %4
%11 = shl i32 %10, 16
%12 = ashr i32 %11, 16
%13 = sub nsw i32 %9, %12
%14 = call i32 @__IUSAT(i32 %13, i32 16)
%15 = and i32 %14, 65535
store i32 %15, i32* %5
%16 = load i32, i32* %3
%17 = ashr i32 %16, 16
%18 = load i32, i32* %4
%19 = ashr i32 %18, 16
%20 = sub nsw i32 %17, %19
%21 = call i32 @__IUSAT(i32 %20, i32 16)
%22 = and i32 %21, 65535
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = shl i32 %23, 16
%25 = load i32, i32* %5
%26 = or i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @__UQSUB16(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = shl i32 %1, 16
%6 = ashr exact i32 %5, 16
%7 = sub nsw i32 %4, %6
%8 = tail call i32 @__IUSAT(i32 %7, i32 16)
%9 = and i32 %8, 65535
%10 = ashr i32 %0, 16
%11 = ashr i32 %1, 16
%12 = sub nsw i32 %10, %11
%13 = tail call i32 @__IUSAT(i32 %12, i32 16)
%14 = shl i32 %13, 16
%15 = or i32 %14, %9
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 2, j = 2;
  if ((unsigned short)1 > -1)
    while (i + 1 ? --i : j++)
      printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
je     114d <main+0x3d>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x10(%rbp)
jmp    115b <main+0x4b>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    $0x0,%eax
je     117b <main+0x6b>
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 2, i32* %3
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %8
%15 = phi i32 [ %10, %8 ], [ %12, %11 ]
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %4
20: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ _helper_pixel16(int);
void lcd_stream(uint8_t r, uint8_t g, uint8_t b) {
  _helper_pixel16((((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3)));
}


x86 assembly (clang, -O0):
<lcd_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
and    $0xf8,%edi
shl    $0x8,%edi
mov    -0x8(%rbp),%eax
and    $0xfc,%eax
shl    $0x3,%eax
or     %eax,%edi
mov    -0xc(%rbp),%eax
and    $0xf8,%eax
sar    $0x3,%eax
or     %eax,%edi
call   1030 <_helper_pixel16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_stream>:
shl    $0x8,%edi
and    $0xf800,%edi
and    $0xfc,%esi
lea    (%rdi,%rsi,8),%edi
shr    $0x3,%edx
and    $0x1f,%edx
or     %edx,%edi
jmp    1030 <_helper_pixel16@plt>

LLVM IR (-O0):
define void @lcd_stream(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = and i32 %7, 248
%9 = shl i32 %8, 8
%10 = load i32, i32* %5
%11 = and i32 %10, 252
%12 = shl i32 %11, 3
%13 = or i32 %9, %12
%14 = load i32, i32* %6
%15 = and i32 %14, 248
%16 = ashr i32 %15, 3
%17 = or i32 %13, %16
%18 = call i32 @_helper_pixel16(i32 %17)
ret void
}

LLVM IR (-O2):
define void @lcd_stream(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 8
%5 = and i32 %4, 63488
%6 = shl i32 %1, 3
%7 = and i32 %6, 2016
%8 = or i32 %7, %5
%9 = lshr i32 %2, 3
%10 = and i32 %9, 31
%11 = or i32 %8, %10
%12 = tail call i32 @_helper_pixel16(i32 %11)
ret void
}
void proc49() {}


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

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

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

LLVM IR (-O2):
define void @proc49() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *mkstring(char const *);
int /*<<< orphan*/ stderr;
char *nc_mkstring(const char *input) {
  char *str;
  if (NULL == (str = mkstring(input))) {
    fprintf(stderr, "ERROR: Unable to allocate memory for a string.\n");
    exit(1);
  }
  return (str);
}


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

x86 assembly (clang, -O2):
<nc_mkstring>:
push   %rax
call   1030 <mkstring@plt>
test   %rax,%rax
je     113d <nc_mkstring+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"ERROR: Unable to allocate memory for a string.\0A\00"
define i8* @nc_mkstring(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @mkstring(i8* %4)
store i8* %5, i8** %3
%6 = icmp eq i8* null, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"ERROR: Unable to allocate memory for a string.\0A\00"
define i8* @nc_mkstring(i8* %0) {
%2 = tail call i8* @mkstring(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x91() {
  Assert_real((isdigit(145) == 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_isdigit.c",
              730, ("isdigit should be 0 for 0x91"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x91>:
push   %rax
mov    $0x91,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2da,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x91\00"
define void @t_isdigit_0x91() {
%1 = call i64 @isdigit(i32 145)
%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 730, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x91\00"
define void @t_isdigit_0x91() {
%1 = tail call i64 @isdigit(i32 145)
%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 730, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
#define LM_FORWARDMASK 128
int /*<<< orphan*/ printf(char *);
void lm_dont(unsigned char *cmd, int len) {
  if (len < 1) {
    printf("lm_dont: no command!!!\n");
    return;
  }
  switch (cmd[0]) {
  case LM_FORWARDMASK:
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<lm_dont>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    113a <lm_dont+0x2a>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
jmp    1157 <lm_dont+0x47>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
sub    $0x80,%al
jne    1152 <lm_dont+0x42>
jmp    114d <lm_dont+0x3d>
jmp    1152 <lm_dont+0x42>
jmp    1157 <lm_dont+0x47>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lm_dont>:
test   %esi,%esi
jle    1115 <lm_dont+0x5>
ret
lea    0xee4(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"lm_dont: no command!!!\0A\00"
define void @lm_dont(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %16
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
switch i32 %13, label %15 [
i32 128, label %14
]
14: ; preds = %9
br label %15
15: ; preds = %9, %14
br label %16
16: ; preds = %7, %15
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"lm_dont: no command!!!\00"
define void @lm_dont(i8* nocapture readnone %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void rtu_memFree(void *p_mem) { free(p_mem); }


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

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

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

LLVM IR (-O2):
define void @rtu_memFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct _mgmt_templogin_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _mgmt_templogin_rsp *);
void mgmt_templogin_rsp_free(struct _mgmt_templogin_rsp *ptr) {
  osapi_free(ptr);
}


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

x86 assembly (clang, -O2):
<mgmt_templogin_rsp_free>:
jmp    1030 <osapi_free@plt>

LLVM IR (-O0):
%struct._mgmt_templogin_rsp = type { i32 }
define void @mgmt_templogin_rsp_free(%struct._mgmt_templogin_rsp* %0) {
%2 = alloca %struct._mgmt_templogin_rsp*
store %struct._mgmt_templogin_rsp* %0, %struct._mgmt_templogin_rsp** %2
%3 = load %struct._mgmt_templogin_rsp*, %struct._mgmt_templogin_rsp** %2
%4 = call i32 @osapi_free(%struct._mgmt_templogin_rsp* %3)
ret void
}

LLVM IR (-O2):
%struct._mgmt_templogin_rsp = type { i32 }
define void @mgmt_templogin_rsp_free(%struct._mgmt_templogin_rsp* %0) {
%2 = tail call i32 @osapi_free(%struct._mgmt_templogin_rsp* %0)
ret void
}
__attribute__((always_)) const int ceilfk(float x) {
  return (int)x + (x < 0 ? 0 : 1);
}


x86 assembly (clang, -O0):
<ceilfk>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
movss  -0x4(%rbp),%xmm1
xorps  %xmm0,%xmm0
mov    $0x1,%ecx
xor    %edx,%edx
ucomiss %xmm1,%xmm0
cmova  %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilfk>:
cvttss2si %xmm0,%ecx
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setbe  %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ceilfk(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = load float, float* %2
%6 = fcmp olt float %5, 0.000000e+00
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
%9 = add nsw i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ceilfk(float %0) {
%2 = fptosi float %0 to i32
%3 = fcmp uge float %0, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
char *strchr(char *, char);
void strip_eoln(char *where) {
  char *now;
  now = strchr(where, '\n');
  if (now) {
    *now = '\0';
  }
}


x86 assembly (clang, -O0):
<strip_eoln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <strip_eoln+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_eoln>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <strip_eoln+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @strip_eoln(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x96() {
  Assert_real((ispunct(150) == 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_ispunct.c",
              755, ("ispunct should be 0 for 0x96"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x96>:
push   %rax
mov    $0x96,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2f3,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x96\00"
define void @t_ispunct_0x96() {
%1 = call i64 @ispunct(i32 150)
%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 755, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x96\00"
define void @t_ispunct_0x96() {
%1 = tail call i64 @ispunct(i32 150)
%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 755, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int __VERIFIER_nondet_int() {
  int val;
  return val;
}


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

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

LLVM IR (-O0):
define i32 @__VERIFIER_nondet_int() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @__VERIFIER_nondet_int() {
ret i32 undef
}
void tw(int **la, int pk) {
  int *ow = *la;
  int jo = !!pk;
  if (jo == 0)
    *la = &pk;
  tw(&ow, pk);
}


x86 assembly (clang, -O0):
<tw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1152 <tw+0x42>
mov    -0x8(%rbp),%rax
lea    -0xc(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%esi
lea    -0x18(%rbp),%rdi
call   1030 <tw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tw>:
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
mov    (%rdi),%rax
mov    %rax,0x10(%rsp)
test   %esi,%esi
jne    112c <tw+0x1c>
lea    0xc(%rsp),%rax
mov    %rax,(%rdi)
lea    0x10(%rsp),%rdi
call   1030 <tw@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @tw(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
%7 = load i32**, i32*** %3
%8 = load i32*, i32** %7
store i32* %8, i32** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load i32**, i32*** %3
store i32* %4, i32** %17
br label %18
18: ; preds = %16, %2
%19 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @tw(i32** nocapture %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %1, i32* %3
%5 = bitcast i32** %4 to i8*
%6 = load i32*, i32** %0
store i32* %6, i32** %4
%7 = icmp eq i32 %1, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32* %3, i32** %0
br label %9
9: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
main() {
  f(10);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 10)
ret i32 0
}
/* Variables and functions */
double mayorDif(float *);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  float arrayLineal[] = {2, 2, -1, -16.5, -8, 0};
  printf("La mayor diferencia es: %f\n", mayorDif(arrayLineal));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <mayorDif@plt>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <mayorDif@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arrayLineal = [6 x float] [float 2.000000e+00, float 2.000000e+00, float -1.000000e+00, float -1.650000e+01, float -8.000000e+00, float 0.000000e+00]
@.str = [28 x i8] c"La mayor diferencia es: %f\0A\00"
define i32 @main() {
%1 = alloca [6 x float]
%2 = bitcast [6 x float]* %1 to i8*
%3 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 0
%4 = call double @mayorDif(float* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arrayLineal = [6 x float] [float 2.000000e+00, float 2.000000e+00, float -1.000000e+00, float -1.650000e+01, float -8.000000e+00, float 0.000000e+00]
@.str = [28 x i8] c"La mayor diferencia es: %f\0A\00"
define i32 @main() {
%1 = alloca [6 x float]
%2 = bitcast [6 x float]* %1 to i8*
%3 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 0
%4 = call double @mayorDif(float* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Type definitions */
struct lastlog {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(struct lastlog *, int, int, int /*<<< orphan*/ *);
int ll_read(struct lastlog *ll, signed int entries) {
  FILE *fp = fopen("/var/log/lastlog", "rb");
  int code = fread(ll, (sizeof(struct lastlog)), entries, fp);
  fclose(fp);
  return code;
}


x86 assembly (clang, -O0):
<ll_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeba(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
call   1030 <fread@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ll_read>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14d,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.lastlog = type { i32 }
@.str = [17 x i8] c"/var/log/lastlog\00"
@.str.1 = [3 x i8] c"rb\00"
define i32 @ll_read(%struct.lastlog* %0, i32 %1) {
%3 = alloca %struct.lastlog*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store %struct.lastlog* %0, %struct.lastlog** %3
store i32 %1, i32* %4
%7 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load %struct.lastlog*, %struct.lastlog** %3
%9 = load i32, i32* %4
%10 = load i32*, i32** %5
%11 = call i32 @fread(%struct.lastlog* %8, i32 4, i32 %9, i32* %10)
store i32 %11, i32* %6
%12 = load i32*, i32** %5
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
%struct.lastlog = type { i32 }
@.str = [17 x i8] c"/var/log/lastlog\00"
@.str.1 = [3 x i8] c"rb\00"
define i32 @ll_read(%struct.lastlog* nocapture %0, i32 %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @fread(%struct.lastlog* %0, i32 4, i32 %1, i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret i32 %4
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double Wtime_msec(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1e3 + tv.tv_usec / 1e3;
}


x86 assembly (clang, -O0):
<Wtime_msec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wtime_msec>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl (%rsp),%xmm0
cvtsi2sdl 0x4(%rsp),%xmm1
movsd  0xed2(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define double @Wtime_msec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+03
%10 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+03, double %9)
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define double @Wtime_msec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.000000e+03
%11 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e+03, double %10)
ret double %11
}
void GB_SECOND_f_FP64(double *z, const double *x, const double *y) {
  (*z) = (*y);
}


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

x86 assembly (clang, -O2):
<GB_SECOND_f_FP64>:
movsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @GB_SECOND_f_FP64(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %6
%8 = load double, double* %7
%9 = load double*, double** %4
store double %8, double* %9
ret void
}

LLVM IR (-O2):
define void @GB_SECOND_f_FP64(double* nocapture writeonly %0, double* nocapture readnone %1, double* nocapture %2) {
%4 = load double, double* %2
store double %4, double* %0
ret void
}
int parse_int(const char *s) {
  int v = 0;
  while (*s >= '0' && *s <= '9') {
    v *= 10;
    v += (*(s++)) - '0';
  }
  return v;
}


x86 assembly (clang, -O0):
<parse_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1134 <parse_int+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <parse_int+0x44>
jmp    116b <parse_int+0x6b>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <parse_int+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <parse_int+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <parse_int+0x20>
ret

LLVM IR (-O0):
define i32 @parse_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 48
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %26
16: ; preds = %14
%17 = load i32, i32* %3
%18 = mul nsw i32 %17, 10
store i32 %18, i32* %3
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
%21 = load i8, i8* %19
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 48
%24 = load i32, i32* %3
%25 = add nsw i32 %24, %23
store i32 %25, i32* %3
br label %4
26: ; preds = %14
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @parse_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %13, %5 ], [ 0, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add i32 %10, -48
%13 = add i32 %12, %9
%14 = load i8, i8* %11
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(void) {
  printf("Usage: %s [OPTION] [DIRECTORY]\n\n    Change current working "
         "directory to [DIRECTORY].\n    With no args, move to $HOME.\n    "
         "With '-' arg, move to $OLDPWD\n\nOptions:\n    -h, --help\t\tdisplay "
         "this help\n    -V, --version\tdisplay version information\n\nReport "
         "bugs to <bulliver@gmail.com>\n",
         "cd");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0xffa(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [280 x i8] c"Usage: %s [OPTION] [DIRECTORY]\0A\0A Change current working directory to [DIRECTORY].\0A With no args, move to $HOME.\0A With '-' arg, move to $OLDPWD\0A\0AOptions:\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [3 x i8] c"cd\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([280 x i8], [280 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [280 x i8] c"Usage: %s [OPTION] [DIRECTORY]\0A\0A Change current working directory to [DIRECTORY].\0A With no args, move to $HOME.\0A With '-' arg, move to $OLDPWD\0A\0AOptions:\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [3 x i8] c"cd\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([280 x i8], [280 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}