xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned short htons(unsigned short);
int /*<<< orphan*/ memcpy(void *, unsigned short *, int);
void *append_short(void *buffer_ptr, unsigned short short_num) {
  short_num = htons(short_num);
  memcpy(buffer_ptr, &short_num, sizeof(unsigned short));
  return buffer_ptr + 2;
}


x86 assembly (clang, -O0):
<append_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%edi
call   1030 <htons@plt>
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xa(%rbp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_short>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %ax,0xe(%rsp)
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1040 <memcpy@plt>
add    $0x2,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @append_short(i8* %0, i16 zeroext %1) {
%3 = alloca i16
%4 = tail call zeroext i16 @htons(i16 zeroext %1)
store i16 %4, i16* %3
%5 = call i32 @memcpy(i8* %0, i16* %3, i32 2)
%6 = getelementptr i8, i8* %0, i64 2
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ monitor_write(char *);
void shutdown() { monitor_write("This feature is not avaible yet."); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"This feature is not avaible yet.\00"
define void @shutdown() {
%1 = call i32 @monitor_write(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"This feature is not avaible yet.\00"
define void @shutdown() {
%1 = tail call i32 @monitor_write(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a(int);
int /*<<< orphan*/ b();
void main() {
  int i = 0;
  for (i = 0; i < 5; i++) {
    if (i > 2) {
      a(i);
    } else {
      b();
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1171 <main+0x51>
cmpl   $0x2,-0x4(%rbp)
jle    1157 <main+0x37>
mov    -0x4(%rbp),%edi
call   1040 <a@plt>
jmp    115e <main+0x3e>
mov    $0x0,%al
call   1030 <b@plt>
jmp    1163 <main+0x43>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
call   1030 <b@plt>
mov    $0x3,%edi
call   1040 <a@plt>
mov    $0x4,%edi
pop    %rax
jmp    1040 <a@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @b()
%2 = tail call i32 (...) @b()
%3 = tail call i32 (...) @b()
%4 = tail call i32 @a(i32 3)
%5 = tail call i32 @a(i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int mkfifoat(int, char const *, int /*<<< orphan*/);
__attribute__((__weak__, __always___)) int
softboundmpx_mkfifoat(int dirfd, const char *pathname, mode_t mode) {
  return mkfifoat(dirfd, pathname, mode);
}


x86 assembly (clang, -O0):
<softboundmpx_mkfifoat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <mkfifoat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_mkfifoat>:
jmp    1030 <mkfifoat@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_mkfifoat(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @mkfifoat(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
int test_imm_9Fint64_midword_reg(long long val) {
  return ((val >> 16) & (0x9F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Fint64_midword_reg>:
test   $0x9f0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Fint64_midword_reg(i64 %0) {
%2 = and i64 %0, 10420224
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ intervalTimer_reset(int /*<<< orphan*/);
void TimerHardware_ResetTimer(void) { intervalTimer_reset(0); }


x86 assembly (clang, -O0):
<TimerHardware_ResetTimer>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <intervalTimer_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerHardware_ResetTimer>:
xor    %edi,%edi
jmp    1030 <intervalTimer_reset@plt>

LLVM IR (-O0):
define void @TimerHardware_ResetTimer() {
%1 = call i32 @intervalTimer_reset(i32 0)
ret void
}

LLVM IR (-O2):
define void @TimerHardware_ResetTimer() {
%1 = tail call i32 @intervalTimer_reset(i32 0)
ret void
}
void brcmf_debugfs_detach(struct brcmf_pub *drvr) {}


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

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

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

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
define void @brcmf_debugfs_detach(%struct.brcmf_pub* nocapture %0) {
ret void
}
unsigned short int net2short(const unsigned char **bufp) {
  unsigned short int i;
  i = **bufp;
  i <<= 8;
  i |= *(*bufp + 1);
  *bufp += 2;
  return i;
}


x86 assembly (clang, -O0):
<net2short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
shl    $0x8,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl 0x1(%rax),%ecx
movzwl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<net2short>:
mov    (%rdi),%rcx
movzwl (%rcx),%eax
rol    $0x8,%ax
add    $0x2,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define zeroext i16 @net2short(i8** %0) {
%2 = alloca i8**
%3 = alloca i16
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
store i16 %7, i16* %3
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = shl i32 %9, 8
%11 = trunc i32 %10 to i16
store i16 %11, i16* %3
%12 = load i8**, i8*** %2
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i16, i16* %3
%18 = zext i16 %17 to i32
%19 = or i32 %18, %16
%20 = trunc i32 %19 to i16
store i16 %20, i16* %3
%21 = load i8**, i8*** %2
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8* %23, i8** %21
%24 = load i16, i16* %3
ret i16 %24
}

LLVM IR (-O2):
define zeroext i16 @net2short(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = or i16 %5, %8
%10 = getelementptr inbounds i8, i8* %2, i64 2
store i8* %10, i8** %0
ret i16 %9
}
/* Variables and functions */
char *keyname(int);
int /*<<< orphan*/ printf(char *, int, int, char *);
int main(int argc, char *argv[]) {
  int n;
  for (n = -1; n < 512; n++) {
    printf("%d(%5o):%s\n", n, n, keyname(n));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
cmpl   $0x200,-0x14(%rbp)
jge    1181 <main+0x61>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <keyname@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %rax,%rcx
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%ebx
lea    0xed0(%rip),%r14
mov    %ebx,%edi
call   1040 <keyname@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %rax,%rcx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x200,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d(%5o):%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ -1, %2 ], [ %7, %3 ]
%5 = tail call i8* @keyname(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %4, i8* %5)
%7 = add nsw i32 %4, 1
%8 = icmp eq i32 %7, 512
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
long fn2(int x) { return 42L - (42 / x) * x; }


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x2a,%eax
cltd
idivl  -0x4(%rbp)
imul   -0x4(%rbp),%eax
movslq %eax,%rcx
mov    $0x2a,%eax
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
mov    $0x2a,%eax
xor    %edx,%edx
idiv   %edi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i64 @fn2(i32 %0) {
%2 = srem i32 42, %0
%3 = zext i32 %2 to i64
ret i64 %3
}
void UTF8_putc(void) {}


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

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

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

LLVM IR (-O2):
define void @UTF8_putc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isExists();
int main() {
  isExists();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @isExists()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *malloc(size_t const);
void *nhr_malloc(const size_t size) {
  if (size > 0) {
    void *mem = malloc(size);
    assert(mem);
    return mem;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<nhr_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    115a <nhr_malloc+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <nhr_malloc+0x42>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nhr_malloc>:
push   %rbx
test   %rdi,%rdi
je     1138 <nhr_malloc+0x18>
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
jmp    113a <nhr_malloc+0x1a>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @quux() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;
struct hle_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alist_copy_blocks(struct hle_t *, int, int, int, int);
void NEAD_16(struct hle_t *hle, uint32_t w1, uint32_t w2) {
  uint8_t count = (w1 >> 16);
  uint16_t dmemi = w1;
  uint16_t dmemo = (w2 >> 16);
  uint16_t block_size = w2;
  alist_copy_blocks(hle, dmemo, dmemi, block_size, count);
}


x86 assembly (clang, -O0):
<NEAD_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <alist_copy_blocks@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NEAD_16>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %esi,%r8d
sar    $0x10,%r8d
mov    %ecx,%esi
sar    $0x10,%esi
jmp    1030 <alist_copy_blocks@plt>

LLVM IR (-O0):
%struct.hle_t = type { i32 }
define void @NEAD_16(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = alloca %struct.hle_t*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.hle_t* %0, %struct.hle_t** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%11 = load i32, i32* %5
%12 = ashr i32 %11, 16
store i32 %12, i32* %7
%13 = load i32, i32* %5
store i32 %13, i32* %8
%14 = load i32, i32* %6
%15 = ashr i32 %14, 16
store i32 %15, i32* %9
%16 = load i32, i32* %6
store i32 %16, i32* %10
%17 = load %struct.hle_t*, %struct.hle_t** %4
%18 = load i32, i32* %9
%19 = load i32, i32* %8
%20 = load i32, i32* %10
%21 = load i32, i32* %7
%22 = call i32 @alist_copy_blocks(%struct.hle_t* %17, i32 %18, i32 %19, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @NEAD_16(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = ashr i32 %1, 16
%5 = ashr i32 %2, 16
%6 = tail call i32 @alist_copy_blocks(%struct.hle_t* %0, i32 %5, i32 %1, i32 %2, i32 %4)
ret void
}
/* Variables and functions */
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int unix_socket_server_accept(int fd) {
  int client_fd;
  if ((client_fd = accept(fd, NULL, NULL)) == -1) {
    perror("accept error");
    return -1;
  }
  return client_fd;
}


x86 assembly (clang, -O0):
<unix_socket_server_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1040 <accept@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    115e <unix_socket_server_accept+0x3e>
lea    0xeb3(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <unix_socket_server_accept+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unix_socket_server_accept>:
push   %rbx
xor    %esi,%esi
xor    %edx,%edx
call   1040 <accept@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1135 <unix_socket_server_accept+0x15>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec4(%rip),%rdi
call   1030 <perror@plt>
jmp    1131 <unix_socket_server_accept+0x11>

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

LLVM IR (-O2):
@.str = [13 x i8] c"accept error\00"
define i32 @unix_socket_server_accept(i32 %0) {
%2 = tail call i32 @accept(i32 %0, i32* null, i32* null)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret i32 %2
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_position_unmask_ri(void) {
  char ctrl_reg2 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1C, &ctrl_reg2, 1) == 0) {
    ctrl_reg2 &= ~0x10;
    KIONIX_ACCEL_write_byte(0x1C, ctrl_reg2);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_position_unmask_ri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1c,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_position_unmask_ri+0x4d>
movsbl -0x1(%rbp),%eax
and    $0xffffffef,%eax
mov    %al,-0x1(%rbp)
mov    $0x1c,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_position_unmask_ri+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_position_unmask_ri>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1c,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_position_unmask_ri+0x41>
movsbl 0xf(%rsp),%esi
and    $0xffffffef,%esi
mov    %sil,0xf(%rsp)
mov    $0x1c,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_position_unmask_ri() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = and i32 %7, -17
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_position_unmask_ri() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = and i8 %5, -17
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
int emac2_etherstatspkts1024to1518octets_set(
    unsigned int dev_id, union emac2_etherstatspkts1024to1518octets_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac2_etherstatspkts1024to1518octets_u = type opaque
define i32 @emac2_etherstatspkts1024to1518octets_set(i32 %0, %union.emac2_etherstatspkts1024to1518octets_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_etherstatspkts1024to1518octets_u*
store i32 %0, i32* %3
store %union.emac2_etherstatspkts1024to1518octets_u* %1, %union.emac2_etherstatspkts1024to1518octets_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_etherstatspkts1024to1518octets_u = type opaque
define i32 @emac2_etherstatspkts1024to1518octets_set(i32 %0, %union.emac2_etherstatspkts1024to1518octets_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
scalar_t__ strlen(char const *const);
int isempty(const char *const str) {
  return ((str && (strlen(str) == 0)) ? 1 : 0);
}


x86 assembly (clang, -O0):
<isempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113f <isempty+0x2f>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isempty>:
xor    %eax,%eax
test   %rdi,%rdi
je     110d <isempty+0xd>
cmpb   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @isempty(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 %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = icmp eq i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @isempty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
void sdmmc_write32(uint16_t reg, uint32_t val) {
  *(volatile uint32_t *)(0x10006000 + reg) = val;
}


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

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

LLVM IR (-O0):
define void @sdmmc_write32(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = add nsw i64 268460032, %6
%8 = inttoptr i64 %7 to i32*
store volatile i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @sdmmc_write32(i64 %0, i32 %1) {
%3 = add nsw i64 %0, 268460032
%4 = inttoptr i64 %3 to i32*
store volatile i32 %1, i32* %4
ret void
}
/* Type definitions */
struct lineFile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lineFileNext(struct lineFile *, char **, int *);
int /*<<< orphan*/ lineFileUnexpectedEnd(struct lineFile *);
void lineFileNeedNext(struct lineFile *lf, char **retStart, int *retSize) {
  if (!lineFileNext(lf, retStart, retSize))
    lineFileUnexpectedEnd(lf);
}


x86 assembly (clang, -O0):
<lineFileNeedNext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <lineFileNext@plt>
cmp    $0x0,%eax
jne    1157 <lineFileNeedNext+0x37>
mov    -0x8(%rbp),%rdi
call   1040 <lineFileUnexpectedEnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineFileNeedNext>:
push   %rbx
mov    %rdi,%rbx
call   1030 <lineFileNext@plt>
test   %eax,%eax
je     112f <lineFileNeedNext+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <lineFileUnexpectedEnd@plt>

LLVM IR (-O0):
%struct.lineFile = type { i32 }
define void @lineFileNeedNext(%struct.lineFile* %0, i8** %1, i32* %2) {
%4 = alloca %struct.lineFile*
%5 = alloca i8**
%6 = alloca i32*
store %struct.lineFile* %0, %struct.lineFile** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load %struct.lineFile*, %struct.lineFile** %4
%8 = load i8**, i8*** %5
%9 = load i32*, i32** %6
%10 = call i32 @lineFileNext(%struct.lineFile* %7, i8** %8, i32* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %3
%13 = load %struct.lineFile*, %struct.lineFile** %4
%14 = call i32 @lineFileUnexpectedEnd(%struct.lineFile* %13)
br label %15
15: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
%struct.lineFile = type { i32 }
define void @lineFileNeedNext(%struct.lineFile* %0, i8** %1, i32* %2) {
%4 = tail call i32 @lineFileNext(%struct.lineFile* %0, i8** %1, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @lineFileUnexpectedEnd(%struct.lineFile* %0)
br label %8
8: ; preds = %6, %3
ret void
}
int cvmx_helper_get_interface_num(int ipd_port) { return ipd_port; }


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

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

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

LLVM IR (-O2):
define i32 @cvmx_helper_get_interface_num(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
int BNC_3() {
  int ii, stat = 99;
  char com1, data;
  BNCIO(3);
  return (stat);
}


x86 assembly (clang, -O0):
<BNC_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
mov    $0x3,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNC_3>:
push   %rax
mov    $0x3,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BNC_3() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO(i32 3)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BNC_3() {
%1 = tail call i32 @BNCIO(i32 3)
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ _s2_priv_textab(float, float, float, int /*<<< orphan*/, int,
                                   float, float, char *);
void s2textxyf(float ix, float iy, float iz, float flipx, float flipy,
               char *itext) {
  _s2_priv_textab(ix, iy, iz, 0, 1, flipx, flipy, itext);
}


x86 assembly (clang, -O0):
<s2textxyf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
mov    %rdi,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
mov    -0x20(%rbp),%rdx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <_s2_priv_textab@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2textxyf>:
mov    %rdi,%rdx
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <_s2_priv_textab@plt>

LLVM IR (-O0):
define void @s2textxyf(float %0, float %1, float %2, float %3, float %4, i8* %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca i8*
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store i8* %5, i8** %12
%13 = load float, float* %7
%14 = load float, float* %8
%15 = load float, float* %9
%16 = load float, float* %10
%17 = load float, float* %11
%18 = load i8*, i8** %12
%19 = call i32 @_s2_priv_textab(float %13, float %14, float %15, i32 0, i32 1, float %16, float %17, i8* %18)
ret void
}

LLVM IR (-O2):
define void @s2textxyf(float %0, float %1, float %2, float %3, float %4, i8* %5) {
%7 = tail call i32 @_s2_priv_textab(float %0, float %1, float %2, i32 0, i32 1, float %3, float %4, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displayOdometer();
int /*<<< orphan*/ displayTripmeter();
void setupOdometerDisplay() {
  displayOdometer();
  displayTripmeter();
}


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

x86 assembly (clang, -O2):
<setupOdometerDisplay>:
push   %rax
xor    %eax,%eax
call   1040 <displayOdometer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <displayTripmeter@plt>

LLVM IR (-O0):
define void @setupOdometerDisplay() {
%1 = call i32 (...) @displayOdometer()
%2 = call i32 (...) @displayTripmeter()
ret void
}

LLVM IR (-O2):
define void @setupOdometerDisplay() {
%1 = tail call i32 (...) @displayOdometer()
%2 = tail call i32 (...) @displayTripmeter()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hellow World!\nMy name is Gary Frazier.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Hellow World!\0AMy name is Gary Frazier.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [39 x i8] c"Hellow World!\0AMy name is Gary Frazier.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo371() {}


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

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

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

LLVM IR (-O2):
define void @foo371() {
ret void
}
int summing(int x) {
  int count = 1;
  int sum = 0;
  while (count < x) {
    sum += (1 << (32 - count));
  }
  return sum;
}


x86 assembly (clang, -O0):
<summing>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113b <summing+0x3b>
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <summing+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @summing(i32 %0) {
ret i32 0
}
void yr_heap_free() { return; }


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

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

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

LLVM IR (-O2):
define void @yr_heap_free() {
ret void
}
/* Variables and functions */
scalar_t__ M_PI;
double __builtin_cos(double);
double Sleef_cospi_u05(double x) { return __builtin_cos(x * (double)M_PI); }


x86 assembly (clang, -O0):
<Sleef_cospi_u05>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
cvtsi2sdq (%rax),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_cospi_u05>:
mov    0x2ed1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
mulsd  %xmm1,%xmm0
jmp    1030 <cos@plt>

LLVM IR (-O0):
@M_PI = global i64 0
define double @Sleef_cospi_u05(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i64, i64* @M_PI
%5 = sitofp i64 %4 to double
%6 = fmul double %3, %5
%7 = call double @cos(double %6)
ret double %7
}

LLVM IR (-O2):
@M_PI = global i64 0
define double @Sleef_cospi_u05(double %0) {
%2 = load i64, i64* @M_PI
%3 = sitofp i64 %2 to double
%4 = fmul double %3, %0
%5 = tail call double @cos(double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ assert_log(int, int, char *, int *);
size_t rev_strspn(char *, char *);
int test_rev_strspn(int verbose) {
  int ok = 1;
  char *tmp = "efgh ijk  \t \n";
  size_t exp = 5;
  size_t res = rev_strspn(tmp, " \t\n");
  assert_log(res == exp, verbose, "rev_strspn not working", &ok);
  return ok;
}


x86 assembly (clang, -O0):
<test_rev_strspn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    0xec7(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x5,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <rev_strspn@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%esi
lea    0xe9f(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <assert_log@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rev_strspn>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x1,0xc(%rsp)
lea    0xeca(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <rev_strspn@plt>
xor    %edi,%edi
cmp    $0x5,%rax
sete   %dil
lea    0xebf(%rip),%rdx
lea    0xc(%rsp),%rcx
mov    %ebx,%esi
call   1040 <assert_log@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"efgh ijk \09 \0A\00"
@.str.1 = [4 x i8] c" \09\0A\00"
@.str.2 = [23 x i8] c"rev_strspn not working\00"
define i32 @test_rev_strspn(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %2
store i32 1, i32* %3
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %4
store i64 5, i64* %5
%7 = load i8*, i8** %4
%8 = call i64 @rev_strspn(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = load i64, i64* %5
%11 = icmp eq i64 %9, %10
%12 = zext i1 %11 to i32
%13 = load i32, i32* %2
%14 = call i32 @assert_log(i32 %12, i32 %13, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [14 x i8] c"efgh ijk \09 \0A\00"
@.str.1 = [4 x i8] c" \09\0A\00"
@.str.2 = [23 x i8] c"rev_strspn not working\00"
define i32 @test_rev_strspn(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = tail call i64 @rev_strspn(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 5
%6 = zext i1 %5 to i32
%7 = call i32 @assert_log(i32 %6, i32 %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x33() {
  Assert_real((isascii(51)),
              "/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_isascii.c",
              260, ("isascii should be 1 for 3"));
}


x86 assembly (clang, -O0):
<t_isascii_0x33>:
push   %rbp
mov    %rsp,%rbp
mov    $0x33,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x104,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x33>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x104,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for 3\00"
define void @t_isascii_0x33() {
%1 = call i32 @isascii(i32 51)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 260, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for 3\00"
define void @t_isascii_0x33() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 260, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_36(void) {
  if (*(uint32_t *)0x10000130ul == 0x8ul) {
    if (*(uint32_t *)0x10000134ul == 0x0ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x1ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x2ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x3ul) {
      return true;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<errata_36>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0x8,%rax
jne    1193 <errata_36+0x93>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_36+0x34>
movl   $0x1,-0x4(%rbp)
jmp    119a <errata_36+0x9a>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x1,%rax
jne    1152 <errata_36+0x52>
movl   $0x1,-0x4(%rbp)
jmp    119a <errata_36+0x9a>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x2,%rax
jne    1170 <errata_36+0x70>
movl   $0x1,-0x4(%rbp)
jmp    119a <errata_36+0x9a>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x3,%rax
jne    118e <errata_36+0x8e>
movl   $0x1,-0x4(%rbp)
jmp    119a <errata_36+0x9a>
jmp    1193 <errata_36+0x93>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @errata_36() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int get_array(int a[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  return i;
}


x86 assembly (clang, -O0):
<get_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <get_array+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <get_array+0x16>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_array>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <get_array+0x37>
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %esi,%ebp
lea    0xed6(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%rbp
jne    1130 <get_array+0x20>
jmp    114a <get_array+0x3a>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @get_array(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = phi i32 [ 0, %2 ], [ %1, %6 ]
ret i32 %13
}
char *strcat(char *dst, char *src) {
  char *cp = dst;
  while (*cp)
    cp++;
  while (*cp++ = *src++)
    ;
  return dst;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <strcat+0x66>
jmp    1137 <strcat+0x37>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Type definitions */
struct sStreamCodec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ StreamEncoder_PutU32(struct sStreamCodec *, unsigned long);
void StreamEncoder_PutS32(struct sStreamCodec *p, signed long s32) {
  StreamEncoder_PutU32(p, (unsigned long)s32);
}


x86 assembly (clang, -O0):
<StreamEncoder_PutS32>:
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 <StreamEncoder_PutU32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StreamEncoder_PutS32>:
jmp    1030 <StreamEncoder_PutU32@plt>

LLVM IR (-O0):
%struct.sStreamCodec = type { i32 }
define void @StreamEncoder_PutS32(%struct.sStreamCodec* %0, i64 %1) {
%3 = alloca %struct.sStreamCodec*
%4 = alloca i64
store %struct.sStreamCodec* %0, %struct.sStreamCodec** %3
store i64 %1, i64* %4
%5 = load %struct.sStreamCodec*, %struct.sStreamCodec** %3
%6 = load i64, i64* %4
%7 = call i32 @StreamEncoder_PutU32(%struct.sStreamCodec* %5, i64 %6)
ret void
}

LLVM IR (-O2):
%struct.sStreamCodec = type { i32 }
define void @StreamEncoder_PutS32(%struct.sStreamCodec* %0, i64 %1) {
%3 = tail call i32 @StreamEncoder_PutU32(%struct.sStreamCodec* %0, i64 %1)
ret void
}