xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ AND_HOST_REG_W(int, int);
int /*<<< orphan*/ addbyte(int);
int TEST_HOST_REG_W(int dst_reg, int src_reg) {
  if (dst_reg & 8) {
    addbyte(0x44);
    addbyte(0x89);
    addbyte(0xc0 | ((dst_reg & 7) << 3) | 2);
    dst_reg = 2;
  }
  AND_HOST_REG_W(dst_reg, src_reg);
  return dst_reg;
}


x86 assembly (clang, -O0):
<TEST_HOST_REG_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     116f <TEST_HOST_REG_W+0x4f>
mov    $0x44,%edi
call   1040 <addbyte@plt>
mov    $0x89,%edi
call   1040 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     $0x2,%edi
call   1040 <addbyte@plt>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <AND_HOST_REG_W@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_HOST_REG_W>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   $0x8,%bpl
je     1158 <TEST_HOST_REG_W+0x38>
mov    $0x44,%edi
call   1040 <addbyte@plt>
mov    $0x89,%edi
call   1040 <addbyte@plt>
shl    $0x3,%ebp
or     $0xc2,%ebp
movzbl %bpl,%edi
call   1040 <addbyte@plt>
mov    $0x2,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <AND_HOST_REG_W@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @TEST_HOST_REG_W(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = call i32 @addbyte(i32 68)
%10 = call i32 @addbyte(i32 137)
%11 = load i32, i32* %3
%12 = and i32 %11, 7
%13 = shl i32 %12, 3
%14 = or i32 192, %13
%15 = or i32 %14, 2
%16 = call i32 @addbyte(i32 %15)
store i32 2, i32* %3
br label %17
17: ; preds = %8, %2
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 @AND_HOST_REG_W(i32 %18, i32 %19)
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @TEST_HOST_REG_W(i32 %0, i32 %1) {
%3 = and i32 %0, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 @addbyte(i32 68)
%7 = tail call i32 @addbyte(i32 137)
%8 = shl i32 %0, 3
%9 = and i32 %8, 56
%10 = or i32 %9, 194
%11 = tail call i32 @addbyte(i32 %10)
br label %12
12: ; preds = %5, %2
%13 = phi i32 [ 2, %5 ], [ %0, %2 ]
%14 = tail call i32 @AND_HOST_REG_W(i32 %13, i32 %1)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ glutSwapBuffers();
int /*<<< orphan*/ stderr;
void Swap(void) {
  fprintf(stderr, "::swapping\n");
  fflush(stderr);
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<Swap>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swap>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <glutSwapBuffers@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"::swapping\0A\00"
define void @Swap() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fflush(i32 %3)
%5 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"::swapping\0A\00"
define void @Swap() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 (...) @glutSwapBuffers()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
size_t coap_opt_put_uint(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                         int /*<<< orphan*/);
size_t coap_put_option_ct(uint8_t *buf, uint16_t lastonum,
                          uint16_t content_type) {
  return coap_opt_put_uint(buf, lastonum, (12), content_type);
}


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

x86 assembly (clang, -O2):
<coap_put_option_ct>:
mov    %edx,%ecx
mov    $0xc,%edx
jmp    1030 <coap_opt_put_uint@plt>

LLVM IR (-O0):
define i64 @coap_put_option_ct(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i64 @coap_opt_put_uint(i32* %7, i32 %8, i32 12, i32 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @coap_put_option_ct(i32* %0, i32 %1, i32 %2) {
%4 = tail call i64 @coap_opt_put_uint(i32* %0, i32 %1, i32 12, i32 %2)
ret i64 %4
}
extern void __outlc_p(unsigned int value, unsigned short port) {
  __asm__ __volatile__("out"
                       "l"
                       " %"
                       "0,%"
                       ""
                       "1"
                       :
                       : "a"(value), "id"(port));
  __asm__ __volatile__("jmp 1f\n1:\tjmp 1f\n1:");
}


x86 assembly (clang, -O0):
<__outlc_p>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
jmp    111b <__outlc_p+0x1b>
jmp    1120 <__outlc_p+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outlc_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
jmp    1107 <__outlc_p+0x7>
jmp    1109 <__outlc_p+0x9>
ret

LLVM IR (-O0):
define void @__outlc_p(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @__outlc_p(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,$1", "{ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
tail call void asm sideeffect "jmp 1f\0A1:\09jmp 1f\0A1:", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int test_imm_AFint8_reg(signed char val) {
  return ((val) & (-0xAF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AFint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff51,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_AFint8_reg(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, -175
%6 = icmp ne i32 %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_AFint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -175
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void start_timing() { (*(volatile uint32_t *)(0x018 + 0xE000E000)) = 0; }


x86 assembly (clang, -O0):
<start_timing>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e018,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_timing>:
mov    $0xe000e018,%eax
movq   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @start_timing() {
store volatile i64 0, i64* inttoptr (i64 3758153752 to i64*)
ret void
}

LLVM IR (-O2):
define void @start_timing() {
store volatile i64 0, i64* inttoptr (i64 3758153752 to i64*)
ret void
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ st_pop(struct forth_instance *);
void qpnum(struct forth_instance *fi) { printf("%ld", st_pop(fi)); }


x86 assembly (clang, -O0):
<qpnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <st_pop@plt>
mov    %eax,%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qpnum>:
push   %rax
call   1040 <st_pop@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
@.str = [4 x i8] c"%ld\00"
define void @qpnum(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load %struct.forth_instance*, %struct.forth_instance** %2
%4 = call i32 @st_pop(%struct.forth_instance* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
@.str = [4 x i8] c"%ld\00"
define void @qpnum(%struct.forth_instance* %0) {
%2 = tail call i32 @st_pop(%struct.forth_instance* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int __attach_tun(int, char *, unsigned int);
int __open_tun();
int open_tun(char *name, unsigned flags) {
  int fd;
  fd = __open_tun();
  if (fd < 0)
    return -1;
  return __attach_tun(fd, name, flags);
}


x86 assembly (clang, -O0):
<open_tun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    $0x0,%al
call   1030 <__open_tun@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    114f <open_tun+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <open_tun+0x41>
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <__attach_tun@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_tun>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__open_tun@plt>
test   %eax,%eax
js     1145 <open_tun+0x25>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <__attach_tun@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @open_tun(i8* %0, i32 %1) {
%3 = tail call i32 (...) @__open_tun()
%4 = icmp slt i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @__attach_tun(i32 %3, i8* %0, i32 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ output_utf(char);
int strlen(char *);
void output_string(char *outstr) {
  int nextchar;
  int cnt;
  for (cnt = 0; cnt < strlen(outstr); cnt++) {
    output_utf(outstr[cnt]);
  }
}


x86 assembly (clang, -O0):
<output_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    116e <output_string+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <output_utf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <output_string+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    115d <output_string+0x3d>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <output_utf@plt>
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <output_string+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @output_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @output_utf(i8 signext %7)
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ calloc(size_t, int);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *_dup_str_n(const char *str, size_t n) {
  size_t len = n;
  char *ns;
  if (n == 0)
    return NULL;
  ns = (char *)calloc(len + 1, 1);
  memcpy(ns, str, len);
  ns[len] = '\000';
  return ns;
}


x86 assembly (clang, -O0):
<_dup_str_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1150 <_dup_str_n+0x30>
movq   $0x0,-0x8(%rbp)
jmp    118b <_dup_str_n+0x6b>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dup_str_n>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1156 <_dup_str_n+0x36>
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%r14,%rbx,1)
jmp    1159 <_dup_str_n+0x39>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @_dup_str_n(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = add i64 %1, 1
%6 = tail call i64 @calloc(i64 %5, i32 1)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i64 %1)
%9 = getelementptr inbounds i8, i8* %7, i64 %1
store i8 0, i8* %9
br label %10
10: ; preds = %2, %4
%11 = phi i8* [ %7, %4 ], [ null, %2 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ IO_output(int, int /*<<< orphan*/);
void IO_output_low(int pin) { IO_output(pin, 0); }


x86 assembly (clang, -O0):
<IO_output_low>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <IO_output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IO_output_low>:
xor    %esi,%esi
jmp    1030 <IO_output@plt>

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

LLVM IR (-O2):
define void @IO_output_low(i32 %0) {
%2 = tail call i32 @IO_output(i32 %0, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ tl_is_rooted(char *);
char *tl_search_nwk_rootcmd(char const *);
int tl_parse_nwk_rooting(const char *nwk) {
  char *rootcmd = tl_search_nwk_rootcmd(nwk);
  if (tl_is_rooted(rootcmd)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tl_parse_nwk_rooting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <tl_search_nwk_rootcmd@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <tl_is_rooted@plt>
cmp    $0x0,%rax
je     1158 <tl_parse_nwk_rooting+0x38>
movl   $0x1,-0x4(%rbp)
jmp    115f <tl_parse_nwk_rooting+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl_parse_nwk_rooting>:
push   %rax
call   1030 <tl_search_nwk_rootcmd@plt>
mov    %rax,%rdi
call   1040 <tl_is_rooted@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tl_parse_nwk_rooting(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @tl_search_nwk_rootcmd(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @tl_is_rooted(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @tl_parse_nwk_rooting(i8* %0) {
%2 = tail call i8* @tl_search_nwk_rootcmd(i8* %0)
%3 = tail call i64 @tl_is_rooted(i8* %2)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ funPrinti();
int main() {
  funPrinti();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @funPrinti()
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
uint64_t zigzag(int64_t n) { return (n << 1) ^ (n >> 63); }


x86 assembly (clang, -O0):
<zigzag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%edx
mov    $0x3f,%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @zigzag(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 63
%7 = xor i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @zigzag(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ print_stack_trace();
int /*<<< orphan*/ printf(char *, ...);
void kernel_panic(const char *msg) {
  printf("\nPANIC: %s\n\nWelcome to Kernel Debugging Land...\n\n", msg);
  print_stack_trace();
  printf("\n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<kernel_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <print_stack_trace@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1153 <kernel_panic+0x33>

x86 assembly (clang, -O2):
<kernel_panic>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <print_stack_trace@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
jmp    1160 <kernel_panic+0x30>

LLVM IR (-O0):
@.str = [50 x i8] c"\0APANIC: %s\0A\0AWelcome to Kernel Debugging Land...\0A\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @kernel_panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @print_stack_trace()
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %7, %1
br label %7
}

LLVM IR (-O2):
@.str = [50 x i8] c"\0APANIC: %s\0A\0AWelcome to Kernel Debugging Land...\0A\0A\00"
define void @kernel_panic(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @print_stack_trace()
%4 = tail call i32 @putchar(i32 10)
br label %5
5: ; preds = %5, %1
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xf5() {
  Assert_real((ispunct(245) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              1230, ("ispunct should be 0 for 0xf5"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xf5>:
push   %rax
mov    $0xf5,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ce,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xf5\00"
define void @t_ispunct_0xf5() {
%1 = tail call i64 @ispunct(i32 245)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1230, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long getCyclelength(unsigned long start) {
  unsigned long cycleLength = 0;
  while (start > 0) {
    cycleLength++;
    if (start == 1) {
      break;
    }
    if (start % 2 == 0) {
      start /= 2;
    } else {
      start = 3 * start + 1;
    }
  }
  return cycleLength;
}


x86 assembly (clang, -O0):
<getCyclelength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    116c <getCyclelength+0x6c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x1,-0x8(%rbp)
jne    1137 <getCyclelength+0x37>
jmp    116c <getCyclelength+0x6c>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    115a <getCyclelength+0x5a>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <getCyclelength+0x67>
imul   $0x3,-0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <getCyclelength+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCyclelength>:
test   %rdi,%rdi
je     1136 <getCyclelength+0x36>
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
mov    %rcx,%rax
cmp    $0x1,%rdi
je     1135 <getCyclelength+0x35>
mov    %rdi,%rcx
shr    %rcx
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%rdi
cmove  %rcx,%rdi
lea    0x1(%rax),%rcx
test   %rdi,%rdi
jne    1110 <getCyclelength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @getCyclelength(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %16, label %3
3: ; preds = %1, %8
%4 = phi i64 [ %6, %8 ], [ 0, %1 ]
%5 = phi i64 [ %14, %8 ], [ %0, %1 ]
%6 = add i64 %4, 1
%7 = icmp eq i64 %5, 1
br i1 %7, label %16, label %8
8: ; preds = %3
%9 = and i64 %5, 1
%10 = icmp eq i64 %9, 0
%11 = lshr i64 %5, 1
%12 = mul i64 %5, 3
%13 = add i64 %12, 1
%14 = select i1 %10, i64 %11, i64 %13
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %3
16: ; preds = %8, %3, %1
%17 = phi i64 [ 0, %1 ], [ %6, %3 ], [ %6, %8 ]
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ usage();
void usageError(void) {
  usage();
  error("Bad usage");
}


x86 assembly (clang, -O0):
<usageError>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <usage@plt>
lea    0xece(%rip),%rdi
call   1040 <error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usageError>:
push   %rax
xor    %eax,%eax
call   1030 <usage@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Bad usage\00"
define void @usageError() {
%1 = call i32 (...) @usage()
%2 = call i32 @error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Bad usage\00"
define void @usageError() {
%1 = tail call i32 (...) @usage()
%2 = tail call i32 @error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_BLACK;
int /*<<< orphan*/ ChangeColor(int /*<<< orphan*/);
void SetColorBlack() { ChangeColor(COLOR_BLACK); }


x86 assembly (clang, -O0):
<SetColorBlack>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <ChangeColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetColorBlack>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <ChangeColor@plt>

LLVM IR (-O0):
@COLOR_BLACK = global i32 0
define void @SetColorBlack() {
%1 = load i32, i32* @COLOR_BLACK
%2 = call i32 @ChangeColor(i32 %1)
ret void
}

LLVM IR (-O2):
@COLOR_BLACK = global i32 0
define void @SetColorBlack() {
%1 = load i32, i32* @COLOR_BLACK
%2 = tail call i32 @ChangeColor(i32 %1)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int stun_make_type(int);
uint16_t stun_make_request(uint16_t method) {
  return (stun_make_type(method) & 0xFEEF);
}


x86 assembly (clang, -O0):
<stun_make_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <stun_make_type@plt>
and    $0xfeef,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stun_make_request>:
push   %rax
call   1030 <stun_make_type@plt>
and    $0xfeef,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stun_make_request(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @stun_make_type(i32 %3)
%5 = and i32 %4, 65263
ret i32 %5
}

LLVM IR (-O2):
define i32 @stun_make_request(i32 %0) {
%2 = tail call i32 @stun_make_type(i32 %0)
%3 = and i32 %2, 65263
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int);
int main() {
  int i = 2147483647;
  unsigned int j = 4294967295;
  printf("%d %d %d\n", i, i + 1, i + 2);
  printf("%u %u %u\n", j, j + 1, j + 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%ecx
add    $0x2,%ecx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
lea    0xeac(%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
mov    $0x7fffffff,%esi
mov    $0x80000000,%edx
mov    $0x80000001,%ecx
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0xffffffff,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [10 x i8] c"%u %u %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2147483647, i32 -2147483648, i32 -2147483647)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 -1, i32 0, i32 1)
ret i32 0
}
main() {
  int *p, *q;
  *(p + 1);
  *p + 1;
  p - q;
  p < q ? 1 : 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = load i32*, i32** %1
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
%9 = load i32*, i32** %1
%10 = load i32*, i32** %2
%11 = ptrtoint i32* %9 to i64
%12 = ptrtoint i32* %10 to i64
%13 = sub i64 %11, %12
%14 = sdiv exact i64 %13, 4
%15 = load i32*, i32** %1
%16 = load i32*, i32** %2
%17 = icmp ult i32* %15, %16
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ uart_write_chars(unsigned char const *, int /*<<< orphan*/);
void uart_write_string(const char *str) {
  uart_write_chars((const unsigned char *)str, strlen(str));
}


x86 assembly (clang, -O0):
<uart_write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <uart_write_chars@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_write_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <uart_write_chars@plt>

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

LLVM IR (-O2):
define void @uart_write_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @uart_write_chars(i8* %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __wait4(int /*<<< orphan*/, int *, int,
                           int /*<<< orphan*/ *);
pid_t waitpid(pid_t pid, int *status, int options) {
  return __wait4(pid, status, options, NULL);
}


x86 assembly (clang, -O0):
<waitpid>:
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
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <__wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
xor    %ecx,%ecx
jmp    1030 <__wait4@plt>

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

LLVM IR (-O2):
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @__wait4(i32 %0, i32* %1, i32 %2, i32* null)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printIndent(int depth) {
  while (depth-- > 0) {
    printf("%c", '\t');
  }
}


x86 assembly (clang, -O0):
<printIndent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1145 <printIndent+0x35>
lea    0xeca(%rip),%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
jmp    111b <printIndent+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIndent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <printIndent+0x35>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <printIndent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printIndent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 9)
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
long double test1l(long double a) { return -a; }


x86 assembly (clang, -O0):
<test1l>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fchs
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1l>:
fldt   0x8(%rsp)
fchs
ret

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

LLVM IR (-O2):
define x86_fp80 @test1l(x86_fp80 %0) {
%2 = fneg x86_fp80 %0
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void proper_exit(int reason) { exit(reason); }


x86 assembly (clang, -O0):
<proper_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<proper_exit>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define void @proper_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @proper_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x01() {
  Assert_real((isalpha(1) == 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_isalpha.c",
              10, ("isalpha should be 0 for 0x01"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x01>:
push   %rax
mov    $0x1,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xa,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x01\00"
define void @t_isalpha_0x01() {
%1 = tail call i64 @isalpha(i32 1)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float toFaren(float c) { return (c * 1.8f + 32.0f); }


x86 assembly (clang, -O0):
<toFaren>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xee2(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<toFaren>:
mulss  0xef8(%rip),%xmm0
addss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @toFaren(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fmuladd.f32(float %3, float 0x3FFCCCCCC0000000, float 3.200000e+01)
ret float %4
}

LLVM IR (-O2):
define float @toFaren(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float 0x3FFCCCCCC0000000, float 3.200000e+01)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void BeaufordCleanUp(char *key) { free(key); }


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

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

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

LLVM IR (-O2):
define void @BeaufordCleanUp(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void orderna(int *V, int a, int b, int c) {}


x86 assembly (clang, -O0):
<orderna>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @orderna(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @orderna(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int _pack2(unsigned int, unsigned int);
unsigned conj_fun_complexOf_short(unsigned a) {
  return _pack2(a >> 16, -(a & 0x0000ffff));
}


x86 assembly (clang, -O0):
<conj_fun_complexOf_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shr    $0x10,%edi
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
xor    %esi,%esi
sub    %eax,%esi
call   1030 <_pack2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conj_fun_complexOf_short>:
movzwl %di,%esi
shr    $0x10,%edi
neg    %esi
jmp    1030 <_pack2@plt>

LLVM IR (-O0):
define i32 @conj_fun_complexOf_short(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = load i32, i32* %2
%6 = and i32 %5, 65535
%7 = sub i32 0, %6
%8 = call i32 @_pack2(i32 %4, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @conj_fun_complexOf_short(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %0, 65535
%4 = sub nsw i32 0, %3
%5 = tail call i32 @_pack2(i32 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ FS460_image_request_freeze(int, int, int /*<<< orphan*/);
void freeze_test_write(void) {
  static int mode = 0;
  switch (mode++) {
  default:
    mode = 1;
  case 0:
    FS460_image_request_freeze(0x0001, 0x0001, 0);
    break;
  case 1:
    FS460_image_request_freeze(0, 0x0001, 0);
    break;
  }
}


x86 assembly (clang, -O0):
<freeze_test_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2f0e(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f00(%rip)
test   %eax,%eax
je     1154 <freeze_test_write+0x44>
jmp    1139 <freeze_test_write+0x29>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
je     1167 <freeze_test_write+0x57>
jmp    114a <freeze_test_write+0x3a>
movl   $0x1,0x2ed8(%rip)
mov    $0x1,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1030 <FS460_image_request_freeze@plt>
jmp    1175 <freeze_test_write+0x65>
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1030 <FS460_image_request_freeze@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeze_test_write>:
mov    0x2f16(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0d(%rip)
mov    $0x1,%edi
test   %eax,%eax
je     113b <freeze_test_write+0x2b>
cmp    $0x1,%eax
jne    1131 <freeze_test_write+0x21>
xor    %edi,%edi
jmp    113b <freeze_test_write+0x2b>
movl   $0x1,0x2ef1(%rip)
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <FS460_image_request_freeze@plt>

LLVM IR (-O0):
@freeze_test_write.mode = internal global i32 0
define void @freeze_test_write() {
%1 = load i32, i32* @freeze_test_write.mode
%2 = add nsw i32 %1, 1
store i32 %2, i32* @freeze_test_write.mode
switch i32 %1, label %3 [
i32 0, label %4
i32 1, label %6
]
3: ; preds = %0
store i32 1, i32* @freeze_test_write.mode
br label %4
4: ; preds = %0, %3
%5 = call i32 @FS460_image_request_freeze(i32 1, i32 1, i32 0)
br label %8
6: ; preds = %0
%7 = call i32 @FS460_image_request_freeze(i32 0, i32 1, i32 0)
br label %8
8: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@freeze_test_write.mode = internal unnamed_addr global i32 0
define void @freeze_test_write() {
%1 = load i32, i32* @freeze_test_write.mode
%2 = add nsw i32 %1, 1
store i32 %2, i32* @freeze_test_write.mode
switch i32 %1, label %3 [
i32 0, label %5
i32 1, label %4
]
3: ; preds = %0
store i32 1, i32* @freeze_test_write.mode
br label %5
4: ; preds = %0
br label %5
5: ; preds = %3, %0, %4
%6 = phi i32 [ 0, %4 ], [ 1, %0 ], [ 1, %3 ]
%7 = tail call i32 @FS460_image_request_freeze(i32 %6, i32 1, i32 0)
ret void
}
/* Variables and functions */
double wtime_impl();
double wtime__(void) { return wtime_impl(); }


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

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

LLVM IR (-O0):
define double @wtime__() {
%1 = call double (...) @wtime_impl()
ret double %1
}

LLVM IR (-O2):
define double @wtime__() {
%1 = tail call double (...) @wtime_impl()
ret double %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rol(uint32_t v, uint32_t s) { return (v >> (32 - s)) | (v << s); }


x86 assembly (clang, -O0):
<rol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
sar    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 32, %6
%8 = ashr i32 %5, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = shl i32 %9, %10
%12 = or i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol(i32 %0, i32 %1) {
%3 = sub nsw i32 32, %1
%4 = ashr i32 %0, %3
%5 = shl i32 %0, %1
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
void **alloca(int);
void *malloc(int);
int main() {
  void **pp = alloca(sizeof *pp);
  *pp = malloc(sizeof **pp);
  long l = (long)*pp;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <alloca@plt>
mov    %rax,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x8,%edi
call   1030 <alloca@plt>
mov    %rax,%rbx
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8**
%2 = alloca i64
%3 = call i8** @alloca(i32 8)
store i8** %3, i8*** %1
%4 = call i8* @malloc(i32 1)
%5 = load i8**, i8*** %1
store i8* %4, i8** %5
%6 = load i8**, i8*** %1
%7 = load i8*, i8** %6
%8 = ptrtoint i8* %7 to i64
store i64 %8, i64* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8** @alloca(i32 8)
%2 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
store i8* %2, i8** %1
ret i32 0
}