xunge/DecIR huggingface dataset:
/* Variables and functions */
int __gpio_request(unsigned int);
int gpio_request(unsigned gpio, const char *label) {
  return __gpio_request(gpio);
}


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

x86 assembly (clang, -O2):
<gpio_request>:
jmp    1030 <__gpio_request@plt>

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

LLVM IR (-O2):
define i32 @gpio_request(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @__gpio_request(i32 %0)
ret i32 %3
}
/* Type definitions */
struct typ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ typ_equal(struct typ const *, struct typ const *);
int typ_cmp(const struct typ **a, const struct typ **b) {
  return !typ_equal(*a, *b);
}


x86 assembly (clang, -O0):
<typ_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <typ_equal@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<typ_cmp>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1030 <typ_equal@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.typ = type { i32 }
define i32 @typ_cmp(%struct.typ** %0, %struct.typ** %1) {
%3 = alloca %struct.typ**
%4 = alloca %struct.typ**
store %struct.typ** %0, %struct.typ*** %3
store %struct.typ** %1, %struct.typ*** %4
%5 = load %struct.typ**, %struct.typ*** %3
%6 = load %struct.typ*, %struct.typ** %5
%7 = load %struct.typ**, %struct.typ*** %4
%8 = load %struct.typ*, %struct.typ** %7
%9 = call i32 @typ_equal(%struct.typ* %6, %struct.typ* %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.typ = type { i32 }
define i32 @typ_cmp(%struct.typ** nocapture %0, %struct.typ** nocapture %1) {
%3 = load %struct.typ*, %struct.typ** %0
%4 = load %struct.typ*, %struct.typ** %1
%5 = tail call i32 @typ_equal(%struct.typ* %3, %struct.typ* %4)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
struct fastbuf {
  int dummy;
};

/* Variables and functions */
int bget_utf16_le_repl(struct fastbuf *, int);
int bget_utf16_le(struct fastbuf *b) { return bget_utf16_le_repl(b, 0xfffc); }


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

x86 assembly (clang, -O2):
<bget_utf16_le>:
mov    $0xfffc,%esi
jmp    1030 <bget_utf16_le_repl@plt>

LLVM IR (-O0):
%struct.fastbuf = type { i32 }
define i32 @bget_utf16_le(%struct.fastbuf* %0) {
%2 = alloca %struct.fastbuf*
store %struct.fastbuf* %0, %struct.fastbuf** %2
%3 = load %struct.fastbuf*, %struct.fastbuf** %2
%4 = call i32 @bget_utf16_le_repl(%struct.fastbuf* %3, i32 65532)
ret i32 %4
}

LLVM IR (-O2):
%struct.fastbuf = type { i32 }
define i32 @bget_utf16_le(%struct.fastbuf* %0) {
%2 = tail call i32 @bget_utf16_le_repl(%struct.fastbuf* %0, i32 65532)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void display_cursor(bool status) {
  if (status == true) {
    fputs("\033[?25h", stdout);
  } else {
    fputs("\033[?25l", stdout);
  }
}


x86 assembly (clang, -O0):
<display_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113f <display_cursor+0x2f>
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    0xecb(%rip),%rdi
call   1030 <fputs@plt>
jmp    1154 <display_cursor+0x44>
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_cursor>:
cmp    $0x1,%edi
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
lea    0xedd(%rip),%rax
lea    0xedd(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25h\00"
@stdout = global i32 0
@.str.1 = [7 x i8] c"\1B[?25l\00"
define void @display_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stdout
%7 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %11
8: ; preds = %1
%9 = load i32, i32* @stdout
%10 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25h\00"
@stdout = global i32 0
@.str.1 = [7 x i8] c"\1B[?25l\00"
define void @display_cursor(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = load i32, i32* @stdout
%4 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @fputs(i8* %4, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_postsub_uint8_t(int /*<<< orphan*/ *, int);
uint8_t atomic_postdec_uint8_t(uint8_t *var) {
  return atomic_postsub_uint8_t(var, 1);
}


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

x86 assembly (clang, -O2):
<atomic_postdec_uint8_t>:
mov    $0x1,%esi
jmp    1030 <atomic_postsub_uint8_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_postdec_uint8_t(i32* %0) {
%2 = tail call i32 @atomic_postsub_uint8_t(i32* %0, i32 1)
ret i32 %2
}
void reverse_comm() {}


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

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

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

LLVM IR (-O2):
define void @reverse_comm() {
ret void
}
/* Variables and functions */
void *return_null() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @return_null() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @return_null() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ Strcpy(int *, int *);
void gettl(int *buf, int *ttl) {
  int i;
  while (*buf == ' ' || *buf == '\t')
    buf++;
  Strcpy(ttl, buf);
  return;
}


x86 assembly (clang, -O0):
<gettl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmpl   $0x20,(%rcx)
mov    %al,-0x15(%rbp)
je     113f <gettl+0x2f>
mov    -0x8(%rbp),%rax
cmpl   $0x9,(%rax)
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114f <gettl+0x3f>
jmp    1160 <gettl+0x50>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <gettl+0x10>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <Strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettl>:
mov    %rdi,%rax
jmp    1124 <gettl+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x4,%rax
mov    (%rax),%ecx
cmp    $0x20,%ecx
je     1120 <gettl+0x10>
cmp    $0x9,%ecx
je     1120 <gettl+0x10>
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <Strcpy@plt>

LLVM IR (-O0):
define void @gettl(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %16, %2
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 32
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 9
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i32 1
store i32* %18, i32** %3
br label %6
19: ; preds = %14
%20 = load i32*, i32** %4
%21 = load i32*, i32** %3
%22 = call i32 @Strcpy(i32* %20, i32* %21)
ret void
}

LLVM IR (-O2):
define void @gettl(i32* %0, i32* %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i32* [ %0, %2 ], [ %7, %6 ]
%5 = load i32, i32* %4
switch i32 %5, label %8 [
i32 32, label %6
i32 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i32, i32* %4, i64 1
br label %3
8: ; preds = %3
%9 = tail call i32 @Strcpy(i32* %1, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pfn();
void indirect2() { pfn(); }


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

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

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

LLVM IR (-O2):
define void @indirect2() {
%1 = tail call i32 (...) @pfn()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int tamFile(FILE *fp) {
  int actual;
  int len;
  actual = ftell(fp);
  fseek(fp, 0, SEEK_END);
  len = ftell(fp);
  fseek(fp, actual, SEEK_SET);
  return len;
}


x86 assembly (clang, -O0):
<tamFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e72(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tamFile>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %eax,%r14d
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %eax,%ebp
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <fseek@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @tamFile(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @ftell(i32* %5)
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i32 @ftell(i32* %10)
store i32 %11, i32* %4
%12 = load i32*, i32** %2
%13 = load i32, i32* %3
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i32 %13, i32 %14)
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @tamFile(i32* nocapture %0) {
%2 = tail call i32 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i32 0, i32 %3)
%5 = tail call i32 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i32 %2, i32 %6)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cPrintf(char *);
void help11(void) {
  cPrintf("  mw                show memory word at PC\n");
  cPrintf("  mw <addr>         show memory word at <addr>\n");
  cPrintf("  mw <addr> <data>  set memory word at <addr> to <data>\n");
}


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

x86 assembly (clang, -O2):
<help11>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf08(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf2c(%rip),%rdi
pop    %rax
jmp    1030 <cPrintf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c" mw show memory word at PC\0A\00"
@.str.1 = [48 x i8] c" mw <addr> show memory word at <addr>\0A\00"
@.str.2 = [57 x i8] c" mw <addr> <data> set memory word at <addr> to <data>\0A\00"
define void @help11() {
%1 = call i32 @cPrintf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cPrintf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @cPrintf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c" mw show memory word at PC\0A\00"
@.str.1 = [48 x i8] c" mw <addr> show memory word at <addr>\0A\00"
@.str.2 = [57 x i8] c" mw <addr> <data> set memory word at <addr> to <data>\0A\00"
define void @help11() {
%1 = tail call i32 @cPrintf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cPrintf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @cPrintf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t heap_right__(size_t idx) { return idx * 2 + 1; }


x86 assembly (clang, -O0):
<heap_right__>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_right__>:
lea    (%rdi,%rdi,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @heap_right__(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 2
%5 = add i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @heap_right__(i64 %0) {
%2 = shl i64 %0, 1
%3 = or i64 %2, 1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ RegReadA_lc898122(int, unsigned char *);
unsigned char TriSts_lc898122(void) {
  unsigned char UcRsltSts = 0;
  unsigned char UcVal;
  RegReadA_lc898122(0x0129, &UcVal);
  if (UcVal & 0x03) {
    RegReadA_lc898122(0x01F4, &UcVal);
    UcRsltSts = UcVal & 0x11;
    UcRsltSts |= 0x80;
  }
  return (UcRsltSts);
}


x86 assembly (clang, -O0):
<TriSts_lc898122>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x129,%edi
lea    -0x2(%rbp),%rsi
call   1030 <RegReadA_lc898122@plt>
movzbl -0x2(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     115e <TriSts_lc898122+0x4e>
mov    $0x1f4,%edi
lea    -0x2(%rbp),%rsi
call   1030 <RegReadA_lc898122@plt>
movzbl -0x2(%rbp),%eax
and    $0x11,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TriSts_lc898122>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x129,%edi
call   1030 <RegReadA_lc898122@plt>
testb  $0x3,0x7(%rsp)
je     1140 <TriSts_lc898122+0x30>
lea    0x7(%rsp),%rsi
mov    $0x1f4,%edi
call   1030 <RegReadA_lc898122@plt>
mov    0x7(%rsp),%al
and    $0x11,%al
or     $0x80,%al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @TriSts_lc898122() {
%1 = alloca i8
%2 = alloca i8
store i8 0, i8* %1
%3 = call i32 @RegReadA_lc898122(i32 297, i8* %2)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = and i32 %5, 3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %0
%9 = call i32 @RegReadA_lc898122(i32 500, i8* %2)
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = and i32 %11, 17
%13 = trunc i32 %12 to i8
store i8 %13, i8* %1
%14 = load i8, i8* %1
%15 = zext i8 %14 to i32
%16 = or i32 %15, 128
%17 = trunc i32 %16 to i8
store i8 %17, i8* %1
br label %18
18: ; preds = %8, %0
%19 = load i8, i8* %1
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @TriSts_lc898122() {
%1 = alloca i8
%2 = call i32 @RegReadA_lc898122(i32 297, i8* %1)
%3 = load i8, i8* %1
%4 = and i8 %3, 3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %0
%7 = call i32 @RegReadA_lc898122(i32 500, i8* %1)
%8 = load i8, i8* %1
%9 = and i8 %8, 17
%10 = or i8 %9, -128
br label %11
11: ; preds = %6, %0
%12 = phi i8 [ %10, %6 ], [ 0, %0 ]
ret i8 %12
}
double gamma(double __d) {
  signed int __local_signgam = 0;
  double return_value_lgamma_r$1;
  return_value_lgamma_r$1 = lgamma_r(__d, &__local_signgam);
  return return_value_lgamma_r$1;
}


x86 assembly (clang, -O0):
<gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
mov    $0x1,%al
call   1030 <lgamma_r@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%al
call   1030 <lgamma_r@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gamma(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store double %0, double* %2
store i32 0, i32* %3
%5 = load double, double* %2
%6 = call i32 (double, i32*, ...) bitcast (i32 (...)* @lgamma_r to i32 (double, i32*, ...)*)(double %5, i32* %3)
%7 = sitofp i32 %6 to double
store double %7, double* %4
%8 = load double, double* %4
ret double %8
}

LLVM IR (-O2):
define double @gamma(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 (double, i32*, ...) bitcast (i32 (...)* @lgamma_r to i32 (double, i32*, ...)*)(double %0, i32* %2)
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ cgpushlit(int);
int /*<<< orphan*/ commit();
int /*<<< orphan*/ gentext();
int /*<<< orphan*/ spill();
void genpushlit(int n) {
  gentext();
  commit();
  spill();
  cgpushlit(n);
}


x86 assembly (clang, -O0):
<genpushlit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gentext@plt>
mov    $0x0,%al
call   1050 <commit@plt>
mov    $0x0,%al
call   1030 <spill@plt>
mov    -0x4(%rbp),%edi
call   1060 <cgpushlit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genpushlit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <gentext@plt>
xor    %eax,%eax
call   1050 <commit@plt>
xor    %eax,%eax
call   1030 <spill@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <cgpushlit@plt>

LLVM IR (-O0):
define void @genpushlit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gentext()
%4 = call i32 (...) @commit()
%5 = call i32 (...) @spill()
%6 = load i32, i32* %2
%7 = call i32 @cgpushlit(i32 %6)
ret void
}

LLVM IR (-O2):
define void @genpushlit(i32 %0) {
%2 = tail call i32 (...) @gentext()
%3 = tail call i32 (...) @commit()
%4 = tail call i32 (...) @spill()
%5 = tail call i32 @cgpushlit(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int /*<<< orphan*/ memset(char *, char, size_t);
int strlen(char *);
int httpreq_copy_buffer(char *dest, char *src, size_t size) {
  memset(dest, '\0', size);
  memcpy(dest, src, size - 1);
  dest[size - 1] = '\0';
  return strlen(dest);
}


x86 assembly (clang, -O0):
<httpreq_copy_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<httpreq_copy_buffer>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <memset@plt>
lea    -0x1(%r15),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <memcpy@plt>
movb   $0x0,-0x1(%rbx,%r15,1)
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @httpreq_copy_buffer(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %6
%9 = call i32 @memset(i8* %7, i8 signext 0, i64 %8)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = call i32 @memcpy(i8* %10, i8* %11, i64 %13)
%15 = load i8*, i8** %4
%16 = load i64, i64* %6
%17 = sub i64 %16, 1
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
%19 = load i8*, i8** %4
%20 = call i32 @strlen(i8* %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @httpreq_copy_buffer(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memset(i8* %0, i8 signext 0, i64 %2)
%5 = add i64 %2, -1
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %5)
%7 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %7
%8 = tail call i32 @strlen(i8* %0)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x10() {
  Assert_real((isdigit(16) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              85, ("isdigit should be 0 for 0x10"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x10\00"
define void @t_isdigit_0x10() {
%1 = tail call i64 @isdigit(i32 16)
%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 85, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() { return -3; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0xfffffffd,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 -3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *const);
int /*<<< orphan*/ write(int, char const *const, int /*<<< orphan*/);
void send_errmsg(const char *const caller, const char *const cause) {
  write(2, "zhsh: ", strlen("zhsh: "));
  write(2, caller, strlen(caller));
  write(2, cause, strlen(cause));
}


x86 assembly (clang, -O0):
<send_errmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    $0x2,%edi
lea    0xeb6(%rip),%rsi
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_errmsg>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xece(%rip),%r15
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %r15,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %r14,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"zhsh: \00"
define void @send_errmsg(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @strlen(i8* %0)
%6 = tail call i32 @write(i32 2, i8* %0, i32 %5)
%7 = tail call i32 @strlen(i8* %1)
%8 = tail call i32 @write(i32 2, i8* %1, i32 %7)
ret void
}
int rfind_char(char *str, char c) {
  int i = -1;
  if (str) {
    for (i = *(&str + 1) - str - 1; i >= 0 && str[i] != c; i--)
      ;
  }
  return i;
}


x86 assembly (clang, -O0):
<rfind_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0xffffffff,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1181 <rfind_char+0x81>
mov    0x0(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jl     1159 <rfind_char+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1169 <rfind_char+0x69>
jmp    117c <rfind_char+0x7c>
jmp    116e <rfind_char+0x6e>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <rfind_char+0x32>
jmp    1181 <rfind_char+0x81>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rfind_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 -1, i32* %5
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %37
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %3, i64 1
%10 = load i8*, i8** %9
%11 = load i8*, i8** %3
%12 = ptrtoint i8* %10 to i64
%13 = ptrtoint i8* %11 to i64
%14 = sub i64 %12, %13
%15 = sub nsw i64 %14, 1
%16 = trunc i64 %15 to i32
store i32 %16, i32* %5
br label %17
17: ; preds = %33, %8
%18 = load i32, i32* %5
%19 = icmp sge i32 %18, 0
br i1 %19, label %20, label %30
20: ; preds = %17
%21 = load i8*, i8** %3
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = load i8, i8* %4
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %26, %28
br label %30
30: ; preds = %20, %17
%31 = phi i1 [ false, %17 ], [ %29, %20 ]
br i1 %31, label %32, label %36
32: ; preds = %30
br label %33
33: ; preds = %32
%34 = load i32, i32* %5
%35 = add nsw i32 %34, -1
store i32 %35, i32* %5
br label %17
36: ; preds = %30
br label %37
37: ; preds = %36, %2
%38 = load i32, i32* %5
ret i32 %38
}

LLVM IR (-O2):
define i32 @rfind_char(i8* %0, i8 signext %1) {
ret i32 -1
}
/* Variables and functions */
float sinf(float);
float sine_ease_in(float p) { return sinf((p - 1.0f) * 1.5707963268f) + 1.0f; }


x86 assembly (clang, -O0):
<sine_ease_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xece(%rip),%xmm1
mulss  %xmm1,%xmm0
call   1030 <sinf@plt>
movss  0xeb9(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine_ease_in>:
push   %rax
addss  0xee7(%rip),%xmm0
mulss  0xee3(%rip),%xmm0
call   1030 <sinf@plt>
addss  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sine_ease_in(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 1.000000e+00
%5 = fmul float %4, 0x3FF921FB60000000
%6 = call float @sinf(float %5)
%7 = fadd float %6, 1.000000e+00
ret float %7
}

LLVM IR (-O2):
define float @sine_ease_in(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fmul float %2, 0x3FF921FB60000000
%4 = tail call float @sinf(float %3)
%5 = fadd float %4, 1.000000e+00
ret float %5
}
int test_imm_95uint8_reg(unsigned char val) {
  return ((val) & (-0x95 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_95uint8_reg>:
test   $0x6b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_95uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -149
%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_95uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 107
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int fstat(int file, struct stat *st) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @fstat(i32 %0, %struct.stat* nocapture readnone %1) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t stdlib_ndarray_get_ptr_float64(const uint8_t *idx, double *out) {
  *out = *(double *)idx;
  return 0;
}


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

x86 assembly (clang, -O2):
<stdlib_ndarray_get_ptr_float64>:
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @stdlib_ndarray_get_ptr_float64(i32* nocapture %0, double* nocapture writeonly %1) {
%3 = bitcast i32* %0 to double*
%4 = load double, double* %3
store double %4, double* %1
ret i32 0
}
void bencode_8(b, p) void *b;
void *p;
{ bcopy(p, b, 8); }


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

x86 assembly (clang, -O2):
<bencode_8>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x8,%edx
xor    %eax,%eax
jmp    1030 <bcopy@plt>

LLVM IR (-O0):
define void @bencode_8(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bcopy to i32 (i8*, i8*, i32, ...)*)(i8* %5, i8* %6, i32 8)
ret void
}

LLVM IR (-O2):
define void @bencode_8(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bcopy to i32 (i8*, i8*, i32, ...)*)(i8* %1, i8* %0, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, char const *);
int nocall(const char *func) { die("called %s()", func); }


x86 assembly (clang, -O0):
<nocall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <die@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocall>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <die@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"called %s()\00"
define i32 @nocall(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @die(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [12 x i8] c"called %s()\00"
define i32 @nocall(i8* %0) {
%2 = tail call i32 @die(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
int test_bit(int nr, volatile const unsigned long *addr) {
  addr += nr / 32;
  return (*addr & (1 << (nr % 32))) ? -1 : 0;
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x18(%rbp),%rdx
mov    $0x1,%eax
shl    %cl,%eax
cltq
and    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %edi,%ecx
lea    0x1f(%rcx),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x5,%eax
mov    $0x1,%edx
shl    %cl,%edx
cltq
movslq %edx,%rcx
and    (%rsi,%rax,8),%rcx
neg    %rcx
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 32
%7 = load i64*, i64** %4
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i64, i64* %7, i64 %8
store i64* %9, i64** %4
%10 = load i64*, i64** %4
%11 = load volatile i64, i64* %10
%12 = load i32, i32* %3
%13 = srem i32 %12, 32
%14 = shl i32 1, %13
%15 = sext i32 %14 to i64
%16 = and i64 %11, %15
%17 = icmp ne i64 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 -1, i32 0
ret i32 %19
}

LLVM IR (-O2):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = sdiv i32 %0, 32
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i64, i64* %1, i64 %4
%6 = load volatile i64, i64* %5
%7 = and i32 %0, 31
%8 = shl nuw i32 1, %7
%9 = sext i32 %8 to i64
%10 = and i64 %6, %9
%11 = icmp ne i64 %10, 0
%12 = sext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ dec2hex();
char getchar();
int /*<<< orphan*/ hex2dec();
int main() {
  char c;
  c = getchar();
  if (c == 'h') {
    hex2dec();
  } else if (c == 'd') {
    dec2hex();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x68,%eax
jne    1162 <main+0x32>
mov    $0x0,%al
call   1030 <hex2dec@plt>
jmp    117b <main+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jne    1176 <main+0x46>
mov    $0x0,%al
call   1050 <dec2hex@plt>
jmp    117b <main+0x4b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x64,%al
je     1149 <main+0x19>
cmp    $0x68,%al
jne    1150 <main+0x20>
xor    %eax,%eax
call   1030 <hex2dec@plt>
jmp    1150 <main+0x20>
xor    %eax,%eax
call   1050 <dec2hex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 104
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @hex2dec()
br label %16
9: ; preds = %0
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 100
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (...) @dec2hex()
br label %15
15: ; preds = %13, %9
br label %16
16: ; preds = %15, %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
switch i8 %1, label %6 [
i8 104, label %2
i8 100, label %4
]
2: ; preds = %0
%3 = tail call i32 (...) @hex2dec()
br label %6
4: ; preds = %0
%5 = tail call i32 (...) @dec2hex()
br label %6
6: ; preds = %0, %4, %2
ret i32 0
}
/* Variables and functions */
double popNumber();
int /*<<< orphan*/ pushNumber(double);
void basMax() {
  double a, b;
  a = popNumber();
  b = popNumber();
  if (b > a)
    a = b;
  pushNumber(a);
}


x86 assembly (clang, -O0):
<basMax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <popNumber@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <popNumber@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    115a <basMax+0x3a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basMax>:
push   %rax
xor    %eax,%eax
call   1040 <popNumber@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <popNumber@plt>
maxsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <pushNumber@plt>

LLVM IR (-O0):
define void @basMax() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @popNumber()
store double %3, double* %1
%4 = call double (...) @popNumber()
store double %4, double* %2
%5 = load double, double* %2
%6 = load double, double* %1
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load double, double* %2
store double %9, double* %1
br label %10
10: ; preds = %8, %0
%11 = load double, double* %1
%12 = call i32 @pushNumber(double %11)
ret void
}

LLVM IR (-O2):
define void @basMax() {
%1 = tail call double (...) @popNumber()
%2 = tail call double (...) @popNumber()
%3 = fcmp ogt double %2, %1
%4 = select i1 %3, double %2, double %1
%5 = tail call i32 @pushNumber(double %4)
ret void
}
/* Type definitions */
struct _stor_fclose_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _stor_fclose_rsp *);
void stor_fclose_rsp_free(struct _stor_fclose_rsp *ptr) { free(ptr); }


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

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

LLVM IR (-O2):
%struct._stor_fclose_rsp = type { i32 }
define void @stor_fclose_rsp_free(%struct._stor_fclose_rsp* nocapture %0) {
%2 = tail call i32 @free(%struct._stor_fclose_rsp* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Use this commands:\n"
         "h\tShow this help\n"
         "q\tQuit\n");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"Use this commands:\0Ah\09Show this help\0Aq\09Quit\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c"Use this commands:\0Ah\09Show this help\0Aq\09Quit\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint_least32_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_uint_least32_t(uint_least32_t const k1,
                                             uint_least32_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_uint_least32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_uint_least32_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_uint_least32_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_uint_least32_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ fork();
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  pid_t pid = fork();
  if (!pid)
    execv("./gennum", argv);
  else {
    int status;
    waitpid(pid, &status, 0);
    execv("./sumnum", argv);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    116f <main+0x3f>
mov    -0x10(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1040 <execv@plt>
jmp    118d <main+0x5d>
mov    -0x14(%rbp),%edi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <waitpid@plt>
mov    -0x10(%rbp),%rsi
lea    0xe81(%rip),%rdi
call   1040 <execv@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
je     115a <main+0x2a>
lea    0xc(%rsp),%rsi
mov    %eax,%edi
xor    %edx,%edx
call   1030 <waitpid@plt>
lea    0xeb1(%rip),%rdi
jmp    1161 <main+0x31>
lea    0xe9f(%rip),%rdi
mov    %rbx,%rsi
call   1040 <execv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"./gennum\00"
@.str.1 = [9 x i8] c"./sumnum\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = tail call i32 (...) @fork()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @execv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %1)
br label %12
8: ; preds = %2
%9 = bitcast i32* %3 to i8*
%10 = call i32 @waitpid(i32 %4, i32* %3, i32 0)
%11 = call i32 @execv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %1)
br label %12
12: ; preds = %8, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void bear_strings_release(char const **in) {
  for (char const *const *it = in; (it) && (*it); ++it) {
    free((void *)*it);
  }
  free((void *)in);
}


x86 assembly (clang, -O0):
<bear_strings_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1142 <bear_strings_release+0x32>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1152 <bear_strings_release+0x42>
jmp    116f <bear_strings_release+0x5f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <bear_strings_release+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bear_strings_release>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1141 <bear_strings_release+0x31>
mov    (%r14),%rdi
test   %rdi,%rdi
je     1141 <bear_strings_release+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <bear_strings_release+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @bear_strings_release(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %9, %3, %1
%7 = bitcast i8** %0 to i8*
%8 = tail call i32 @free(i8* %7)
ret void
9: ; preds = %3, %9
%10 = phi i8* [ %14, %9 ], [ %4, %3 ]
%11 = phi i8** [ %13, %9 ], [ %0, %3 ]
%12 = tail call i32 @free(i8* %10)
%13 = getelementptr inbounds i8*, i8** %11, i64 1
%14 = load i8*, i8** %13
%15 = icmp eq i8* %14, null
br i1 %15, label %6, label %9
}