xunge/DecIR huggingface dataset:
/* Variables and functions */
int soundShutdown();
int shutdownModule(void) { return soundShutdown(); }


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

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

LLVM IR (-O0):
define i32 @shutdownModule() {
%1 = call i32 (...) @soundShutdown()
ret i32 %1
}

LLVM IR (-O2):
define i32 @shutdownModule() {
%1 = tail call i32 (...) @soundShutdown()
ret i32 %1
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *strdup(const char *__s) {
  char *charptr;
  if (!__s)
    return NULL;
  charptr = (char *)malloc(sizeof(char) * (strlen(__s) + 1));
  if (charptr)
    strcpy(charptr, __s);
  return charptr;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1191 <strdup+0x61>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1189 <strdup+0x59>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115e <strdup+0x2e>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1160 <strdup+0x30>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1160 <strdup+0x30>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = icmp eq i64 %6, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %11
11: ; preds = %3, %9, %1
%12 = phi i8* [ null, %1 ], [ %7, %9 ], [ %7, %3 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ event_reinit(void *);
void libevent_ctx_reinitialize(void *priv) { event_reinit(priv); }


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

x86 assembly (clang, -O2):
<libevent_ctx_reinitialize>:
jmp    1030 <event_reinit@plt>

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

LLVM IR (-O2):
define void @libevent_ctx_reinitialize(i8* %0) {
%2 = tail call i32 @event_reinit(i8* %0)
ret void
}
void be_write16(void *addr, const unsigned value) {
  unsigned char *p = (unsigned char *)addr;
  p[0] = value >> 8;
  p[1] = value;
}


x86 assembly (clang, -O0):
<be_write16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_write16>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @be_write16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = lshr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i32, i32* %4
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @be_write16(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = trunc i32 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_has_a4(__le16 fc) {
  __le16 tmp = cpu_to_le16(0x0100 | 0x0200);
  return (fc & tmp) == tmp;
}


x86 assembly (clang, -O0):
<ieee80211_has_a4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x300,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_has_a4>:
push   %rbx
mov    %edi,%ebx
mov    $0x300,%edi
call   1030 <cpu_to_le16@plt>
not    %ebx
xor    %ecx,%ecx
test   %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ieee80211_has_a4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @cpu_to_le16(i32 768)
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = and i32 %5, %6
%8 = load i32, i32* %3
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ieee80211_has_a4(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 768)
%3 = and i32 %2, %0
%4 = icmp eq i32 %3, %2
%5 = zext i1 %4 to i32
ret i32 %5
}
const char *get_os(void) { return "unknown"; }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @get_os() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void charfree(void *v) { free(*(char **)v); }


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

x86 assembly (clang, -O2):
<charfree>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @charfree(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
void TMTimerIsActive(void) {}


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

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

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

LLVM IR (-O2):
define void @TMTimerIsActive() {
ret void
}
/* Variables and functions */
int _fwrite(char *, int, int /*<<< orphan*/);
scalar_t__ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int puts(const char *s) {
  if (fputs(s, stdout) < 0)
    return -1;
  return _fwrite("\n", 1, stdout);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
cmp    $0x0,%rax
jge    1154 <puts+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <puts+0x51>
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
lea    0xe9c(%rip),%rdi
mov    $0x1,%esi
call   1040 <_fwrite@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
test   %rax,%rax
js     1148 <puts+0x28>
mov    (%rbx),%edx
lea    0xec3(%rip),%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <_fwrite@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\0A\00"
define i32 @puts(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i64 @fputs(i8* %0, i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @stdout
%7 = tail call i32 @_fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i32 %6)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ -1, %1 ]
ret i32 %9
}
A0RX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*((int *)10000000)) = (p1[x1]); }


x86 assembly (clang, -O0):
<A0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    $0x989680,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A0RX1>:
movslq %ecx,%rax
mov    (%r9,%rax,4),%eax
mov    %eax,0x989680
ret

LLVM IR (-O0):
define i32 @A0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = load i32, i32* %11
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
store i32 %18, i32* inttoptr (i64 10000000 to i32*)
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @A0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* inttoptr (i64 10000000 to i32*)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void print_dot(void) {
  printf(".");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_dot>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_dot>:
push   %rax
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@stdout = global i32 0
define void @print_dot() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @print_dot() {
%1 = tail call i32 @putchar(i32 46)
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
void uartA_putc(char c) {
  while (!(*((volatile unsigned long *)0xb0400198) & 1))
    ;
  *((volatile unsigned long *)0xb040019c) = c;
}


x86 assembly (clang, -O0):
<uartA_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xb0400198,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112c <uartA_putc+0x2c>
jmp    1131 <uartA_putc+0x31>
jmp    110a <uartA_putc+0xa>
movsbq -0x1(%rbp),%rcx
mov    $0xb040019c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uartA_putc>:
mov    $0xb0400198,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x1,(%rax)
je     1110 <uartA_putc+0x10>
movsbq %dil,%rcx
mov    %rcx,0x4(%rax)
ret

LLVM IR (-O0):
define void @uartA_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i64, i64* inttoptr (i64 2956984728 to i64*)
%5 = and i64 %4, 1
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i8, i8* %2
%11 = sext i8 %10 to i64
store volatile i64 %11, i64* inttoptr (i64 2956984732 to i64*)
ret void
}

LLVM IR (-O2):
define void @uartA_putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 2956984728 to i64*)
%4 = and i64 %3, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = sext i8 %0 to i64
store volatile i64 %7, i64* inttoptr (i64 2956984732 to i64*)
ret void
}
int test_imm_A0int32_mem(int *val) {
  return ((*val) & (0xA0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A0int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 160
%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_A0int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 160
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int RSA2048_execute(int, char *);
int /*<<< orphan*/ printf(char *);
int RSA2048_generate_key_STD(int fd) {
  int ret;
  ret = RSA2048_execute(fd, "BF10C00000");
  if (ret != 0) {
    printf("ERR:RSA2048_generate_key_STD failed!\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<RSA2048_generate_key_STD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1040 <RSA2048_execute@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115f <RSA2048_generate_key_STD+0x3f>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <RSA2048_generate_key_STD+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA2048_generate_key_STD>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <RSA2048_execute@plt>
test   %eax,%eax
je     1144 <RSA2048_generate_key_STD+0x24>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"BF10C00000\00"
@str = [37 x i8] c"ERR:RSA2048_generate_key_STD failed!\00"
define i32 @RSA2048_generate_key_STD(i32 %0) {
%2 = tail call i32 @RSA2048_execute(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t ans = 0;
  while (s[ans++] != '\0') {
  };
  return (ans - 1);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1135 <strlen+0x35>
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %4, %2 ]
%4 = add i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int _mpyus(unsigned int src1, int src2) {
  return (unsigned short)src1 * (short)src2;
}


x86 assembly (clang, -O0):
<_mpyus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
movzwl %ax,%eax
mov    -0x8(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpyus>:
movzwl %di,%ecx
movswl %si,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_mpyus(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 = trunc i32 %5 to i16
%7 = zext i16 %6 to i32
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i16
%10 = sext i16 %9 to i32
%11 = mul nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @_mpyus(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = shl i32 %1, 16
%5 = ashr exact i32 %4, 16
%6 = mul nsw i32 %5, %3
ret i32 %6
}
double CodonOmegaFunc_Trad(int i, int j, int gencode, double omega) {
  return omega;
}


x86 assembly (clang, -O0):
<CodonOmegaFunc_Trad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @CodonOmegaFunc_Trad(i32 %0, i32 %1, i32 %2, double returned %3) {
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void normal(int number, char *name) {
  int i;
  for (i = 0; i < number; i++)
    printf("%s\n", name);
}


x86 assembly (clang, -O0):
<normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <normal+0x40>
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <normal+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <normal+0x30>
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <normal+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @normal(i32 %0, i8* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};
typedef int pid_t;
typedef int /*<<< orphan*/ path;

/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ snprintf(char *, int, char *, int const);
scalar_t__ stat(char *, struct stat *);
bool pid_exists(const pid_t pid) {
  char path[PATH_MAX];
  struct stat statbuf;
  (void)snprintf(path, sizeof(path), "/proc/%i", pid);
  return stat(path, &statbuf) == 0;
}


x86 assembly (clang, -O0):
<pid_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    %eax,%esi
mov    -0x4(%rbp),%ecx
lea    0xe9d(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x28(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pid_exists>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %edi,%ecx
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rbx
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xeb4(%rip),%rdx
mov    %rbx,%rdi
call   1030 <snprintf@plt>
lea    -0x10(%rbp),%rsi
mov    %rbx,%rdi
call   1040 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@PATH_MAX = global i32 0
@.str = [9 x i8] c"/proc/%i\00"
define i32 @pid_exists(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca %struct.stat
store i32 %0, i32* %2
%6 = load i32, i32* @PATH_MAX
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = trunc i64 %7 to i32
%11 = load i32, i32* %2
%12 = call i32 @snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i64 @stat(i8* %9, %struct.stat* %5)
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
%16 = load i8*, i8** %3
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@PATH_MAX = global i32 0
@.str = [9 x i8] c"/proc/%i\00"
define i32 @pid_exists(i32 %0) {
%2 = alloca %struct.stat
%3 = load i32, i32* @PATH_MAX
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = bitcast %struct.stat* %2 to i8*
%7 = call i32 @snprintf(i8* %5, i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = call i64 @stat(i8* %5, %struct.stat* %2)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ float_test();
int /*<<< orphan*/ int_test();
int num_test(void) {
  float_test();
  int_test();
  return 0;
}


x86 assembly (clang, -O0):
<num_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <float_test@plt>
mov    $0x0,%al
call   1030 <int_test@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_test>:
push   %rax
xor    %eax,%eax
call   1040 <float_test@plt>
xor    %eax,%eax
call   1030 <int_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @num_test() {
%1 = call i32 (...) @float_test()
%2 = call i32 (...) @int_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @num_test() {
%1 = tail call i32 (...) @float_test()
%2 = tail call i32 (...) @int_test()
ret i32 0
}
int is_valid_chan_spacing(int spacing) {
  if ((spacing == 0) || (spacing == 1) || (spacing == 2))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_valid_chan_spacing>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1125 <is_valid_chan_spacing+0x25>
cmpl   $0x1,-0x8(%rbp)
je     1125 <is_valid_chan_spacing+0x25>
cmpl   $0x2,-0x8(%rbp)
jne    1131 <is_valid_chan_spacing+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <is_valid_chan_spacing+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_chan_spacing>:
xor    %eax,%eax
cmp    $0x3,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_valid_chan_spacing(i32 %0) {
%2 = icmp ult i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void free1D(double *m) { free(m); }


x86 assembly (clang, -O0):
<free1D>:
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):
<free1D>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free1D(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x8c() {
  Assert_real((isprint(140) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              705, ("isprint should be 0 for 0x8c"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x8c\00"
define void @t_isprint_0x8c() {
%1 = call i64 @isprint(i32 140)
%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 705, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x8c\00"
define void @t_isprint_0x8c() {
%1 = tail call i64 @isprint(i32 140)
%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 705, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((always_)) void octave_matrix_def(char *file, char *name, int m,
                                                int mr, int n, int nr, int br,
                                                int bc, double *A) {}


x86 assembly (clang, -O0):
<octave_matrix_def>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @octave_matrix_def(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, double* %8) {
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca double*
store i8* %0, i8** %10
store i8* %1, i8** %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store double* %8, double** %18
ret void
}

LLVM IR (-O2):
define void @octave_matrix_def(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, double* nocapture %8) {
ret void
}
void link(int v, int p, int *child, int *parent) {
  child[p] = v;
  if (v >= 0) {
    parent[v] = p;
  }
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
cmpl   $0x0,-0x4(%rbp)
jl     1138 <link+0x38>
mov    -0x8(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
movslq %esi,%rax
mov    %edi,(%rdx,%rax,4)
test   %edi,%edi
js     110f <link+0xf>
mov    %edi,%eax
mov    %esi,(%rcx,%rax,4)
ret

LLVM IR (-O0):
define void @link(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
%9 = load i32, i32* %5
%10 = load i32*, i32** %7
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 %9, i32* %13
%14 = load i32, i32* %5
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %4
%17 = load i32, i32* %6
%18 = load i32*, i32** %8
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
br label %22
22: ; preds = %16, %4
ret void
}

LLVM IR (-O2):
define void @link(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %2, i64 %5
store i32 %0, i32* %6
%7 = icmp sgt i32 %0, -1
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = zext i32 %0 to i64
%10 = getelementptr inbounds i32, i32* %3, i64 %9
store i32 %1, i32* %10
br label %11
11: ; preds = %8, %4
ret void
}
/* Type definitions */
struct processor {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ processor_exec(struct processor *);
int /*<<< orphan*/ processor_fetch(struct processor *);
void processor_step(struct processor *p, int n) {
  for (; n > 0; n--) {
    processor_fetch(p);
    processor_exec(p);
  }
}


x86 assembly (clang, -O0):
<processor_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1159 <processor_step+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <processor_fetch@plt>
mov    -0x8(%rbp),%rdi
call   1040 <processor_exec@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <processor_step+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processor_step>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1148 <processor_step+0x28>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
mov    %r14,%rdi
call   1030 <processor_fetch@plt>
mov    %r14,%rdi
call   1040 <processor_exec@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <processor_step+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.processor = type { i32 }
define void @processor_step(%struct.processor* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %1, %2 ]
%6 = tail call i32 @processor_fetch(%struct.processor* %0)
%7 = tail call i32 @processor_exec(%struct.processor* %0)
%8 = add nsw i32 %5, -1
%9 = icmp ugt i32 %5, 1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
ret void
}
void label_socket_clear(void) {}


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

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

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

LLVM IR (-O2):
define void @label_socket_clear() {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ rec(int, int);
int main() {
  int n = __VERIFIER_nondet_int();
  rec(n, n + 1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
lea    0x1(%rax),%esi
mov    %eax,%edi
call   1040 <rec@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = call i32 @rec(i32 %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = add nsw i32 %1, 1
%3 = tail call i32 @rec(i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputsn(int, char *, int);
char *print_to_base(int, char *, int, int *);
int print_oct(int fd, int n) {
  int count;
  char buffer[20] = {0};
  char *str;
  str = print_to_base(n, buffer, 8, &count);
  fputsn(fd, str, count);
  return count;
}


x86 assembly (clang, -O0):
<print_oct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
lea    -0xc(%rbp),%rcx
call   1050 <print_to_base@plt>
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <fputsn@plt>
mov    -0xc(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_oct>:
push   %rbx
sub    $0x30,%rsp
mov    %esi,%eax
mov    %edi,%ebx
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
mov    %eax,%edi
mov    $0x8,%edx
call   1040 <print_to_base@plt>
mov    0xc(%rsp),%edx
mov    %ebx,%edi
mov    %rax,%rsi
call   1030 <fputsn@plt>
mov    0xc(%rsp),%eax
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @print_oct(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca [20 x i8]
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%7 = call i8* @print_to_base(i32 %1, i8* %6, i32 8, i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @fputsn(i32 %0, i8* %7, i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}
char *strstr(const char *haystack, const char *needle) {
  char s = *needle;
  return (char *)haystack;
}


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

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

LLVM IR (-O0):
define i8* @strstr(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** %4
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @strstr(i8* readnone returned %0, i8* nocapture readnone %1) {
ret i8* %0
}
char *ulltostr(unsigned long long value, char *endptr) {
  while (value) {
    *--endptr = '0' + (value % 10);
    value /= 10;
  }
  return endptr;
}


x86 assembly (clang, -O0):
<ulltostr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1154 <ulltostr+0x54>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
add    $0x30,%rdx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    110c <ulltostr+0xc>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulltostr>:
test   %rdi,%rdi
je     1137 <ulltostr+0x37>
movabs $0xcccccccccccccccd,%r8
cc cc cc
nop
mov    %rdi,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %edi,%ecx
sub    %eax,%ecx
or     $0x30,%cl
mov    %cl,-0x1(%rsi)
add    $0xffffffffffffffff,%rsi
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1110 <ulltostr+0x10>
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @ulltostr(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
br label %5
5: ; preds = %8, %2
%6 = load i64, i64* %3
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i64, i64* %3
%10 = urem i64 %9, 10
%11 = add i64 48, %10
%12 = trunc i64 %11 to i8
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 -1
store i8* %14, i8** %4
store i8 %12, i8* %14
%15 = load i64, i64* %3
%16 = udiv i64 %15, 10
store i64 %16, i64* %3
br label %5
17: ; preds = %5
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
define i8* @ulltostr(i64 %0, i8* writeonly %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %1, %2 ]
%6 = phi i64 [ %11, %4 ], [ %0, %2 ]
%7 = urem i64 %6, 10
%8 = trunc i64 %7 to i8
%9 = or i8 %8, 48
%10 = getelementptr inbounds i8, i8* %5, i64 -1
store i8 %9, i8* %10
%11 = udiv i64 %6, 10
%12 = icmp ult i64 %6, 10
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i8* [ %1, %2 ], [ %10, %4 ]
ret i8* %14
}
char char2num(char c) {
  char numchar;
  numchar = 0;
  switch (c) {
  case 97:
    numchar = 1;
    break;
  case 99:
    numchar = 2;
    break;
  case 103:
    numchar = 3;
    break;
  case 116:
    numchar = 4;
    break;
  }
  return numchar;
}


x86 assembly (clang, -O0):
<char2num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     1157 <char2num+0x57>
mov    -0x10(%rbp),%rax
lea    0xed1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x1,-0x2(%rbp)
jmp    1157 <char2num+0x57>
movb   $0x2,-0x2(%rbp)
jmp    1157 <char2num+0x57>
movb   $0x3,-0x2(%rbp)
jmp    1157 <char2num+0x57>
movb   $0x4,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2num>:
xor    %eax,%eax
add    $0xffffff9f,%edi
cmp    $0x13,%edi
ja     1125 <char2num+0x25>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%al
ret
mov    $0x2,%al
ret
mov    $0x3,%al
ret
mov    $0x4,%al
ret

LLVM IR (-O0):
define signext i8 @char2num(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 97, label %6
i32 99, label %7
i32 103, label %8
i32 116, label %9
]
6: ; preds = %1
store i8 1, i8* %3
br label %10
7: ; preds = %1
store i8 2, i8* %3
br label %10
8: ; preds = %1
store i8 3, i8* %3
br label %10
9: ; preds = %1
store i8 4, i8* %3
br label %10
10: ; preds = %1, %9, %8, %7, %6
%11 = load i8, i8* %3
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @char2num(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 97, label %3
i32 99, label %4
i32 103, label %5
i32 116, label %6
]
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3
%8 = phi i8 [ 0, %1 ], [ 4, %6 ], [ 3, %5 ], [ 2, %4 ], [ 1, %3 ]
ret i8 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
__attribute__((always_)) uint64_t load64_native(const void *src) {
  uint64_t w;
  memcpy(&w, src, sizeof w);
  return w;
}


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

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

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

LLVM IR (-O2):
define i32 @load64_native(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
unsigned short inw(unsigned short port) {
  unsigned short ret;
  asm volatile("inw %1, %0" : "=a"(ret) : "dN"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @inw(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ be200_cmd_wr(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ uart1_read();
int /*<<< orphan*/ uart1_writeb(int /*<<< orphan*/);
void be200_uart_set_freq() {
  uint8_t multi;
  uint8_t idx;
  idx = uart1_read();
  multi = uart1_read();
  be200_cmd_wr(idx, 45, multi);
  uart1_writeb(multi);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <uart1_read@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <uart1_read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    $0x2d,%esi
call   1050 <be200_cmd_wr@plt>
mov    -0x4(%rbp),%edi
call   1030 <uart1_writeb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <uart1_read@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <uart1_read@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x2d,%esi
mov    %eax,%edx
call   1050 <be200_cmd_wr@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <uart1_writeb@plt>

LLVM IR (-O0):
define void @be200_uart_set_freq() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @uart1_read()
store i32 %3, i32* %2
%4 = call i32 (...) @uart1_read()
store i32 %4, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = call i32 @be200_cmd_wr(i32 %5, i32 45, i32 %6)
%8 = load i32, i32* %1
%9 = call i32 @uart1_writeb(i32 %8)
ret void
}

LLVM IR (-O2):
define void @be200_uart_set_freq() {
%1 = tail call i32 (...) @uart1_read()
%2 = tail call i32 (...) @uart1_read()
%3 = tail call i32 @be200_cmd_wr(i32 %1, i32 45, i32 %2)
%4 = tail call i32 @uart1_writeb(i32 %2)
ret void
}
int USART_Configuration(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @USART_Configuration() {
ret i32 0
}

LLVM IR (-O2):
define i32 @USART_Configuration() {
ret i32 0
}