xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int const);
int isRadix2(const char *c) {
  const char *PREFIX = "#b";
  const int PREFIX_SZ = strlen(PREFIX);
  if (c == NULL)
    return 0;
  if (strncmp(c, PREFIX, PREFIX_SZ) == 0)
    return PREFIX_SZ;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isRadix2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115a <isRadix2+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1186 <isRadix2+0x66>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    117f <isRadix2+0x5f>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <isRadix2+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRadix2>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed3(%rip),%rdi
call   1040 <strlen@plt>
test   %rbx,%rbx
je     1157 <isRadix2+0x37>
mov    %eax,%ebp
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
cmove  %ebp,%eax
jmp    1159 <isRadix2+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"#b\00"
define i32 @isRadix2(i8* %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 %2, i32 0
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t spi_rx_is_empty(uint32_t *spi) { return !(spi[0x00C / 4] & 0x04); }


x86 assembly (clang, -O0):
<spi_rx_is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_rx_is_empty>:
xor    %eax,%eax
testb  $0x4,0xc(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @spi_rx_is_empty(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, 4
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @spi_rx_is_empty(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = lshr i32 %3, 2
%5 = and i32 %4, 1
%6 = xor i32 %5, 1
ret i32 %6
}
/* Variables and functions */
scalar_t__ SARRandom(unsigned int);
float SARRandomCoeff(unsigned int seed_offset) {
  return ((float)SARRandom(seed_offset) / (float)0xffffffff);
}


x86 assembly (clang, -O0):
<SARRandomCoeff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <SARRandom@plt>
cvtsi2ss %rax,%xmm0
movss  0xed0(%rip),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SARRandomCoeff>:
push   %rax
call   1030 <SARRandom@plt>
cvtsi2ss %rax,%xmm0
mulss  0xedd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @SARRandomCoeff(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @SARRandom(i32 %3)
%5 = sitofp i64 %4 to float
%6 = fdiv float %5, 0x41F0000000000000
ret float %6
}

LLVM IR (-O2):
define float @SARRandomCoeff(i32 %0) {
%2 = tail call i64 @SARRandom(i32 %0)
%3 = sitofp i64 %2 to float
%4 = fmul float %3, 0x3DF0000000000000
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ __chk_fail();
int __ttyname_r(int, char *, size_t);
int __ttyname_r_chk(int fd, char *buf, size_t buflen, size_t nreal) {
  if (buflen > nreal)
    __chk_fail();
  return __ttyname_r(fd, buf, buflen);
}


x86 assembly (clang, -O0):
<__ttyname_r_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    114c <__ttyname_r_chk+0x2c>
mov    $0x0,%al
call   1030 <__chk_fail@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <__ttyname_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ttyname_r_chk>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
cmp    %rcx,%rdx
jbe    1138 <__ttyname_r_chk+0x18>
xor    %eax,%eax
call   1030 <__chk_fail@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <__ttyname_r@plt>

LLVM IR (-O0):
define i32 @__ttyname_r_chk(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %7
%10 = load i64, i64* %8
%11 = icmp ugt i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = call i32 (...) @__chk_fail()
br label %14
14: ; preds = %12, %4
%15 = load i32, i32* %5
%16 = load i8*, i8** %6
%17 = load i64, i64* %7
%18 = call i32 @__ttyname_r(i32 %15, i8* %16, i64 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @__ttyname_r_chk(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = icmp ugt i64 %2, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (...) @__chk_fail()
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @__ttyname_r(i32 %0, i8* %1, i64 %2)
ret i32 %9
}
/* Variables and functions */
scalar_t__ EISDIR;
scalar_t__ errno;
int nuke_dir(char const *);
int /*<<< orphan*/ rmdir(char const *);
int unlink(char const *);
int nuke(const char *what) {
  int rv;
  int err = 0;
  rv = unlink(what);
  if (rv < 0) {
    if (errno == EISDIR) {
      err = nuke_dir(what);
      if (!err)
        rmdir(what);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<nuke>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    119c <nuke+0x6c>
mov    0x2e78(%rip),%rax
mov    (%rax),%rax
mov    0x2e7e(%rip),%rcx
cmp    (%rcx),%rax
jne    1197 <nuke+0x67>
mov    -0x8(%rbp),%rdi
call   1050 <nuke_dir@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1192 <nuke+0x62>
mov    -0x8(%rbp),%rdi
call   1040 <rmdir@plt>
jmp    1197 <nuke+0x67>
jmp    119c <nuke+0x6c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nuke>:
push   %rbx
mov    %rdi,%rbx
call   1030 <unlink@plt>
test   %eax,%eax
jns    1167 <nuke+0x37>
mov    0x2e94(%rip),%rax
mov    (%rax),%rax
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <nuke+0x37>
mov    %rbx,%rdi
call   1050 <nuke_dir@plt>
test   %eax,%eax
jne    1167 <nuke+0x37>
mov    %rbx,%rdi
call   1040 <rmdir@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@EISDIR = global i64 0
define i32 @nuke(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
%5 = load i8*, i8** %2
%6 = call i32 @unlink(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %1
%10 = load i64, i64* @errno
%11 = load i64, i64* @EISDIR
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = call i32 @nuke_dir(i8* %14)
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = call i32 @rmdir(i8* %19)
br label %21
21: ; preds = %18, %13
br label %22
22: ; preds = %21, %9
br label %23
23: ; preds = %22, %1
ret i32 0
}

LLVM IR (-O2):
@errno = global i64 0
@EISDIR = global i64 0
define i32 @nuke(i8* %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EISDIR
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = tail call i32 @nuke_dir(i8* %0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @rmdir(i8* %0)
br label %13
13: ; preds = %4, %11, %8, %1
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void busy_loop(void) {
  volatile uint16_t i = 1;
  for (; i; ++i)
    ;
}


x86 assembly (clang, -O0):
<busy_loop>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     112a <busy_loop+0x2a>
jmp    111c <busy_loop+0x1c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <busy_loop+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<busy_loop>:
movl   $0x1,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
je     111c <busy_loop+0x1c>
nop
addl   $0x1,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
jne    1110 <busy_loop+0x10>
ret

LLVM IR (-O0):
define void @busy_loop() {
%1 = alloca i32
store volatile i32 1, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load volatile i32, i32* %1
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @busy_loop() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = load volatile i32, i32* %1
%7 = add nsw i32 %6, 1
store volatile i32 %7, i32* %1
%8 = load volatile i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %0
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *_pbcM_realloc(void *p, size_t sz) { return realloc(p, sz); }


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

x86 assembly (clang, -O2):
<_pbcM_realloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @_pbcM_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @_pbcM_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
extern double d1d2s1s2(double d1, double d2, float s1, float s2) {
  return d1 + d2 + s1 + s2;
}


x86 assembly (clang, -O0):
<d1d2s1s2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d1d2s1s2>:
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @d1d2s1s2(double %0, double %1, float %2, float %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca float
%8 = alloca float
store double %0, double* %5
store double %1, double* %6
store float %2, float* %7
store float %3, float* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fadd double %9, %10
%12 = load float, float* %7
%13 = fpext float %12 to double
%14 = fadd double %11, %13
%15 = load float, float* %8
%16 = fpext float %15 to double
%17 = fadd double %14, %16
ret double %17
}

LLVM IR (-O2):
define double @d1d2s1s2(double %0, double %1, float %2, float %3) {
%5 = fadd double %0, %1
%6 = fpext float %2 to double
%7 = fadd double %5, %6
%8 = fpext float %3 to double
%9 = fadd double %7, %8
ret double %9
}
/* Variables and functions */
int compare_ints(void const *, void const *);
int rcompare_ints(const void *a, const void *b) { return -compare_ints(a, b); }


x86 assembly (clang, -O0):
<rcompare_ints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <compare_ints@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcompare_ints>:
push   %rax
call   1030 <compare_ints@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rcompare_ints(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @compare_ints(i8* %5, i8* %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @rcompare_ints(i8* %0, i8* %1) {
%3 = tail call i32 @compare_ints(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
int get_tty_size(void) { return 80; }


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

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

LLVM IR (-O0):
define i32 @get_tty_size() {
ret i32 80
}

LLVM IR (-O2):
define i32 @get_tty_size() {
ret i32 80
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int posix_memalign(void **, int, int);
int /*<<< orphan*/ printf(char *, void *, ...);
int main(void) {
  int ret;
  void *ptr = NULL;
  printf("before posix_memalign(): ptr = %p\n", ptr);
  ret = posix_memalign(&ptr, 4, 123 * sizeof(char));
  printf("after posix_memalign(): ptr = %p, ret=%d\n", ptr, ret);
  free(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x7b,%edx
call   1050 <posix_memalign@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xec0(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x7b,%edx
call   1050 <posix_memalign@plt>
mov    (%rsp),%rsi
lea    0xebd(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"before posix_memalign(): ptr = %p\0A\00"
@.str.1 = [42 x i8] c"after posix_memalign(): ptr = %p, ret=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @posix_memalign(i8** %3, i32 4, i32 123)
store i32 %6, i32* %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %2
%9 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %7, i32 %8)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"before posix_memalign(): ptr = %p\0A\00"
@.str.1 = [42 x i8] c"after posix_memalign(): ptr = %p, ret=%d\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%3 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* null)
%4 = call i32 @posix_memalign(i8** %1, i32 4, i32 123)
%5 = load i8*, i8** %1
%6 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %4)
%7 = load i8*, i8** %1
%8 = call i32 @free(i8* %7)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t convert_byte_array_to_64_bit(uint8_t *data) {
  union {
    uint64_t u64;
    uint8_t u8[8];
  } long_addr;
  uint8_t index;
  for (index = 0; index < 8; index++) {
    long_addr.u8[index] = *data++;
  }
  return long_addr.u64;
}


x86 assembly (clang, -O0):
<convert_byte_array_to_64_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x8,-0x2c(%rbp)
jge    1140 <convert_byte_array_to_64_bit+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%ecx
movslq -0x2c(%rbp),%rax
mov    %ecx,-0x28(%rbp,%rax,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    110f <convert_byte_array_to_64_bit+0xf>
mov    -0x28(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { [8 x i32] }
define i32 @convert_byte_array_to_64_bit(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i32 1
store i32* %10, i32** %2
%11 = load i32, i32* %9
%12 = bitcast %union.anon* %3 to [8 x i32]*
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [8 x i32], [8 x i32]* %12, i64 0, i64 %14
store i32 %11, i32* %15
br label %16
16: ; preds = %8
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
%20 = bitcast %union.anon* %3 to i32*
%21 = load i32, i32* %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @convert_byte_array_to_64_bit(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void VSIFree(void *pData) {
  if (pData != 0)
    free(pData);
}


x86 assembly (clang, -O0):
<VSIFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <VSIFree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VSIFree>:
test   %rdi,%rdi
je     111a <VSIFree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @VSIFree(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @VSIFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void rb_thread_stop_timer(void) {}


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

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

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

LLVM IR (-O2):
define void @rb_thread_stop_timer() {
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, void const *, int);
int osrp2s(const void *p) {
  int16_t tmp;
  memcpy(&tmp, p, 2);
  return tmp;
}


x86 assembly (clang, -O0):
<osrp2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osrp2s>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @osrp2s(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 2)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @osrp2s(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void showBadCharMessage(char value) {
  fprintf(stderr, "Invalid Roman Numeral char '%c' ", value);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<showBadCharMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1030 <fprintf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showBadCharMessage>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Invalid Roman Numeral char '%c' \00"
@stdout = global i32 0
define void @showBadCharMessage(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @stderr
%4 = load i8, i8* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Invalid Roman Numeral char '%c' \00"
@stdout = global i32 0
define void @showBadCharMessage(i8 signext %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int jenkins(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, unsigned int, char *, int);
int /*<<< orphan*/ strlen(char const *);
int hexjenkins(char *buf, unsigned int buf_size, const char *str) {
  snprintf(buf, buf_size, "%08x", jenkins(str, strlen(str)));
  return 0;
}


x86 assembly (clang, -O0):
<hexjenkins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
call   1050 <jenkins@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    %eax,%ecx
lea    0xe83(%rip),%rdx
call   1040 <snprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexjenkins>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <jenkins@plt>
lea    0xeaa(%rip),%rdx
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %eax,%ecx
call   1040 <snprintf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%08x\00"
define i32 @hexjenkins(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @jenkins(i8* %9, i32 %11)
%13 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%08x\00"
define i32 @hexjenkins(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @jenkins(i8* %2, i32 %4)
%6 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int strlen(const char *s) {
  if (!s)
    return 0;
  int n = 0;
  while (s[n++] != '\0')
    ;
  return n - 1;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <strlen+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1153 <strlen+0x53>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114a <strlen+0x4a>
jmp    1126 <strlen+0x26>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
test   %rdi,%rdi
je     111d <strlen+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ 0, %1 ]
%5 = add nuw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
char *put_d(char *, int /*<<< orphan*/);
char *put_i(char *p, int64_t value) {
  if (value < 0) {
    p[0] = '-';
    p++;
    value = -value;
  }
  return put_d(p, (uint64_t)value);
}


x86 assembly (clang, -O0):
<put_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1148 <put_i+0x38>
mov    -0x8(%rbp),%rax
movb   $0x2d,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
call   1030 <put_d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_i>:
test   %rsi,%rsi
js     111a <put_i+0xa>
jmp    1030 <put_d@plt>
movb   $0x2d,(%rdi)
add    $0x1,%rdi
neg    %rsi
jmp    1030 <put_d@plt>

LLVM IR (-O0):
define i8* @put_i(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 45, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i64, i64* %4
%13 = sub nsw i64 0, %12
store i64 %13, i64* %4
br label %14
14: ; preds = %7, %2
%15 = load i8*, i8** %3
%16 = load i64, i64* %4
%17 = trunc i64 %16 to i32
%18 = call i8* @put_d(i8* %15, i32 %17)
ret i8* %18
}

LLVM IR (-O2):
define i8* @put_i(i8* %0, i64 %1) {
%3 = icmp slt i64 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
store i8 45, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = sub nsw i64 0, %1
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %5, %4 ], [ %0, %2 ]
%9 = phi i64 [ %6, %4 ], [ %1, %2 ]
%10 = trunc i64 %9 to i32
%11 = tail call i8* @put_d(i8* %8, i32 %10)
ret i8* %11
}
unsigned int signed_int_to_unsigned_int(signed int src) { return src; }


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

x86 assembly (clang, -O2):
<signed_int_to_unsigned_int>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @signed_int_to_unsigned_int(i32 returned %0) {
ret i32 %0
}
void ys_upcase(char *s) {
  if (!s)
    return;
  for (; *s; ++s)
    if (*s >= 'a' && *s <= 'z')
      *s = 'A' + (*s - 'a');
}


x86 assembly (clang, -O0):
<ys_upcase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <ys_upcase+0x18>
jmp    1175 <ys_upcase+0x75>
jmp    111d <ys_upcase+0x1d>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1175 <ys_upcase+0x75>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     115f <ys_upcase+0x5f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     115f <ys_upcase+0x5f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1164 <ys_upcase+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111d <ys_upcase+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ys_upcase>:
test   %rdi,%rdi
je     113a <ys_upcase+0x3a>
mov    (%rdi),%al
test   %al,%al
je     113a <ys_upcase+0x3a>
add    $0x1,%rdi
jmp    112b <ys_upcase+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     113a <ys_upcase+0x3a>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1120 <ys_upcase+0x20>
add    $0xe0,%al
mov    %al,-0x1(%rdi)
jmp    1120 <ys_upcase+0x20>
ret

LLVM IR (-O0):
define void @ys_upcase(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 %6, label %5
5: ; preds = %1
br label %33
6: ; preds = %1
br label %7
7: ; preds = %30, %6
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %33
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 97
br i1 %15, label %16, label %29
16: ; preds = %11
%17 = load i8*, i8** %2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 122
br i1 %20, label %21, label %29
21: ; preds = %16
%22 = load i8*, i8** %2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = sub nsw i32 %24, 97
%26 = add nsw i32 65, %25
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %2
store i8 %27, i8* %28
br label %29
29: ; preds = %21, %16, %11
br label %30
30: ; preds = %29
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %2
br label %7
33: ; preds = %5, %7
ret void
}

LLVM IR (-O2):
define void @ys_upcase(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %13
%7 = phi i8 [ %15, %13 ], [ %4, %3 ]
%8 = phi i8* [ %14, %13 ], [ %0, %3 ]
%9 = add i8 %7, -97
%10 = icmp ult i8 %9, 26
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = add nsw i8 %7, -32
store i8 %12, i8* %8
br label %13
13: ; preds = %6, %11
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %13, %3, %1
ret void
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_GETREGS;
int /*<<< orphan*/ ptrace(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/ *, struct user_regs_struct *);
void extract_registers(pid_t ch, struct user_regs_struct *regs) {
  ptrace(PTRACE_GETREGS, ch, NULL, regs);
}


x86 assembly (clang, -O0):
<extract_registers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edx
call   1030 <ptrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_registers>:
mov    %rsi,%rcx
mov    %edi,%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
@PTRACE_GETREGS = global i32 0
define void @extract_registers(i32 %0, %struct.user_regs_struct* %1) {
%3 = alloca i32
%4 = alloca %struct.user_regs_struct*
store i32 %0, i32* %3
store %struct.user_regs_struct* %1, %struct.user_regs_struct** %4
%5 = load i32, i32* @PTRACE_GETREGS
%6 = load i32, i32* %3
%7 = load %struct.user_regs_struct*, %struct.user_regs_struct** %4
%8 = call i32 @ptrace(i32 %5, i32 %6, i32* null, %struct.user_regs_struct* %7)
ret void
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
@PTRACE_GETREGS = global i32 0
define void @extract_registers(i32 %0, %struct.user_regs_struct* %1) {
%3 = load i32, i32* @PTRACE_GETREGS
%4 = tail call i32 @ptrace(i32 %3, i32 %0, i32* null, %struct.user_regs_struct* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x13() {
  Assert_real((isbdigit(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_isbdigit.c",
              100, ("isbdigit should be 0 for 0x13"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x13>:
push   %rax
mov    $0x13,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x64,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x13\00"
define void @t_isbdigit_0x13() {
%1 = tail call i64 @isbdigit(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 ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int bar(int i) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
ret i32 0
}
char ascii2rad(char c) {
  static char tab[] = {
      -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
      -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
      -1,  -1,  0,   -1,  -1,  -1,  046, 047, -1,  -1,  -1,  -1,  -1,  -1,  -1,
      -1,  045, -1,  001, 002, 003, 004, 005, 006, 007, 010, 011, 012, -1,  -1,
      -1,  -1,  -1,  -1,  -1,  013, 014, 015, 016, 017, 020, 021, 022, 023, 024,
      025, 026, 027, 030, 031, 032, 033, 034, 035, 036, 037, 040, 041, 042, 043,
      044, -1,  -1,  -1,  -1,  -1,  -1,  013, 014, 015, 016, 017, 020, 021, 022,
      023, 024, 025, 026, 027, 030, 031, 032, 033, 034, 035, 036, 037, 040, 041,
      042, 043, 044, -1,  -1,  -1,  -1,  -1,
  };
  return tab[c & 0177];
}


x86 assembly (clang, -O0):
<ascii2rad>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x7f,%eax
movslq %eax,%rcx
lea    0x2f15(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii2rad>:
and    $0x7f,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@ascii2rad.tab = internal global [128 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\00\FF\FF\FF&'\FF\FF\FF\FF\FF\FF\FF\FF%\FF\01\02\03\04\05\06\07\08\09\0A\FF\FF\FF\FF\FF\FF\FF\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\1A\1B\1C\1D\1E\1F !\22#$\FF\FF\FF\FF\FF\FF\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\1A\1B\1C\1D\1E\1F !\22#$\FF\FF\FF\FF\FF"
define signext i8 @ascii2rad(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 127
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [128 x i8], [128 x i8]* @ascii2rad.tab, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@ascii2rad.tab = internal unnamed_addr constant [128 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\00\FF\FF\FF&'\FF\FF\FF\FF\FF\FF\FF\FF%\FF\01\02\03\04\05\06\07\08\09\0A\FF\FF\FF\FF\FF\FF\FF\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\1A\1B\1C\1D\1E\1F !\22#$\FF\FF\FF\FF\FF\FF\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\1A\1B\1C\1D\1E\1F !\22#$\FF\FF\FF\FF\FF"
define signext i8 @ascii2rad(i8 signext %0) {
%2 = and i8 %0, 127
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds [128 x i8], [128 x i8]* @ascii2rad.tab, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
int func4b(int);
__attribute__((always_)) int func4a(int x) { return func4b(x * 17); }


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

x86 assembly (clang, -O2):
<func4a>:
mov    %edi,%eax
shl    $0x4,%eax
add    %eax,%edi
jmp    1030 <func4b@plt>

LLVM IR (-O0):
define i32 @func4a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 17
%5 = call i32 @func4b(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @func4a(i32 %0) {
%2 = mul nsw i32 %0, 17
%3 = tail call i32 @func4b(i32 %2)
ret i32 %3
}
float vec3_length_squared(float *a) {
  return a[0] * a[0] + a[1] * a[1] + a[2] * a[2];
}


x86 assembly (clang, -O0):
<vec3_length_squared>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_length_squared>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @vec3_length_squared(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
ret float %23
}

LLVM IR (-O2):
define float @vec3_length_squared(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ test();
void runTest(void) {
  {
    { test(); }
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @runTest() {
%1 = tail call i32 (...) @test()
ret void
}
/* Variables and functions */
long long __normal___moddi3(long long, long long);
long long __attribute__((no_instrument_function))
__wrap___moddi3(long long a, long long b) {
  return __normal___moddi3(a, b);
}


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

x86 assembly (clang, -O2):
<__wrap___moddi3>:
jmp    1030 <__normal___moddi3@plt>

LLVM IR (-O0):
define i64 @__wrap___moddi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 @__normal___moddi3(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @__wrap___moddi3(i64 %0, i64 %1) {
%3 = tail call i64 @__normal___moddi3(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void f1() {
  int size = 12;
  char src[12] = "helloworld";
  char dest[12];
  strncpy(dest, src, size);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xc,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
sub    $0x18,%rsp
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,(%rsp)
movl   $0x646c,0x8(%rsp)
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
mov    $0xc,%edx
call   1030 <strncpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.f1.src = [12 x i8] c"helloworld\00\00"
define void @f1() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
store i32 12, i32* %1
%4 = bitcast [12 x i8]* %2 to i8*
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* %1
%8 = call i32 @strncpy(i8* %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@__const.f1.src = [12 x i8] c"helloworld\00\00"
define void @f1() {
%1 = alloca [12 x i8]
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* %3, i32 12)
ret void
}
/* Variables and functions */
char *stpcpy(char *, char const *);
char *test7(char *a1, const char *a2) { return stpcpy(a1, a2); }


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

x86 assembly (clang, -O2):
<test7>:
jmp    1030 <stpcpy@plt>

LLVM IR (-O0):
define i8* @test7(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @stpcpy(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @test7(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @stpcpy(i8* %0, i8* %1)
ret i8* %3
}
main() {
  long a = 0, b = 1, i;
  for (i = 0; i < 20; i++) {
    long c = b;
    b = a + b;
    a = c;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x14,-0x20(%rbp)
jge    115b <main+0x5b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1123 <main+0x23>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef enum xprt_stat { ____Placeholder_xprt_stat } xprt_stat;
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int XPRT_IDLE;
enum xprt_stat svcraw_stat(SVCXPRT *__xprt) { return (XPRT_IDLE); }


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

x86 assembly (clang, -O2):
<svcraw_stat>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@XPRT_IDLE = global i32 0
define i32 @svcraw_stat(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @XPRT_IDLE
ret i32 %3
}

LLVM IR (-O2):
@XPRT_IDLE = global i32 0
define i32 @svcraw_stat(i32* nocapture readnone %0) {
%2 = load i32, i32* @XPRT_IDLE
ret i32 %2
}