xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ AUDIO_CONTINUE;
int ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int audioContinue(int fd, char *arg) {
  if (arg)
    return -1;
  if (ioctl(fd, AUDIO_CONTINUE) == -1)
    perror("AUDIO_CONTINUE");
  return 0;
}


x86 assembly (clang, -O0):
<audioContinue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <audioContinue+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <audioContinue+0x53>
mov    -0x8(%rbp),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    116c <audioContinue+0x4c>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audioContinue>:
push   %rbx
mov    $0xffffffff,%ebx
test   %rsi,%rsi
jne    1140 <audioContinue+0x20>
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
je     1144 <audioContinue+0x24>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
jmp    1140 <audioContinue+0x20>

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

LLVM IR (-O2):
@AUDIO_CONTINUE = global i32 0
@.str = [15 x i8] c"AUDIO_CONTINUE\00"
define i32 @audioContinue(i32 %0, i8* readnone %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @AUDIO_CONTINUE
%6 = tail call i32 @ioctl(i32 %0, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %4, %8, %2
%11 = phi i32 [ -1, %2 ], [ 0, %8 ], [ 0, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ combine_string(char *, char *);
int main() {
  char *s1 = "God is a girl";
  char *s2 = "season in the son son";
  combine_string(s1, s2);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"God is a girl\00"
@.str.1 = [22 x i8] c"season in the son son\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @combine_string(i8* %4, i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"God is a girl\00"
@.str.1 = [22 x i8] c"season in the son son\00"
define i32 @main() {
%1 = tail call i32 @combine_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct cmd_arg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ showDomainBlocking();
void cmdShowDomainBlocking(int cmdType, struct cmd_arg *pCmdArg) {
  showDomainBlocking();
}


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

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

LLVM IR (-O0):
%struct.cmd_arg = type { i32 }
define void @cmdShowDomainBlocking(i32 %0, %struct.cmd_arg* %1) {
%3 = alloca i32
%4 = alloca %struct.cmd_arg*
store i32 %0, i32* %3
store %struct.cmd_arg* %1, %struct.cmd_arg** %4
%5 = call i32 (...) @showDomainBlocking()
ret void
}

LLVM IR (-O2):
%struct.cmd_arg = type { i32 }
define void @cmdShowDomainBlocking(i32 %0, %struct.cmd_arg* nocapture readnone %1) {
%3 = tail call i32 (...) @showDomainBlocking()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(size_t);
void *nmalloc(size_t howmuch) {
  void *r = malloc(howmuch);
  if (r == NULL && howmuch != 0)
    die(("nano is out of memory!"));
  return r;
}


x86 assembly (clang, -O0):
<nmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <nmalloc+0x3b>
cmpq   $0x0,-0x8(%rbp)
je     115b <nmalloc+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <nmalloc+0x25>
test   %r14,%r14
jne    1145 <nmalloc+0x25>
lea    0xec0(%rip),%rdi
call   1040 <die@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"nano is out of memory!\00"
define i8* @nmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [23 x i8] c"nano is out of memory!\00"
define noalias i8* @nmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %2
}
void foo822() {}


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

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

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

LLVM IR (-O2):
define void @foo822() {
ret void
}
void foo397() {}


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

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

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

LLVM IR (-O2):
define void @foo397() {
ret void
}
/* Variables and functions */
int ext2_get_block_size_in_bytes();
unsigned int ext2_get_block_size_in_sectors() {
  return ext2_get_block_size_in_bytes() / 512;
}


x86 assembly (clang, -O0):
<ext2_get_block_size_in_sectors>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ext2_get_block_size_in_bytes@plt>
mov    $0x200,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2_get_block_size_in_sectors>:
push   %rax
xor    %eax,%eax
call   1030 <ext2_get_block_size_in_bytes@plt>
lea    0x1ff(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
sar    $0x9,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ext2_get_block_size_in_sectors() {
%1 = call i32 (...) @ext2_get_block_size_in_bytes()
%2 = sdiv i32 %1, 512
ret i32 %2
}

LLVM IR (-O2):
define i32 @ext2_get_block_size_in_sectors() {
%1 = tail call i32 (...) @ext2_get_block_size_in_bytes()
%2 = sdiv i32 %1, 512
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void print_str(const char *buf) { write(1, buf, strlen(buf)); }


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @print_str(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
int plogin(user, passwd, msg)
char *user;
char *passwd;
char **msg;
{
  char *tty;
  return 3;
}


x86 assembly (clang, -O0):
<plogin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x3,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @plogin(i8* nocapture readnone %0, i8* nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ SSL_CTX;

/* Variables and functions */
int /*<<< orphan*/ setContextKeyTypes(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ const *, size_t);
void tbUpdateKeyTypes(SSL_CTX *ssl_ctx, const uint8_t *key_types,
                      size_t num_key_types) {
  setContextKeyTypes(ssl_ctx, key_types, num_key_types);
}


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

x86 assembly (clang, -O2):
<tbUpdateKeyTypes>:
jmp    1030 <setContextKeyTypes@plt>

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

LLVM IR (-O2):
define void @tbUpdateKeyTypes(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32 @setContextKeyTypes(i32* %0, i32* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ args;

/* Variables and functions */
int spawn(int, char **);
int main(int argc, char *argv[]) {
  char *args[] = {"/usr/local/heimdal/bin/kpasswd", NULL};
  return (spawn((sizeof(args) / sizeof((args)[0])) - 1, args));
}


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    0x2ce3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ce0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x1,%edi
call   1030 <spawn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
call   1030 <spawn@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"/usr/local/heimdal/bin/kpasswd\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [2 x i8*]* %6 to i8*
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%9 = call i32 @spawn(i32 1, i8** %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [31 x i8] c"/usr/local/heimdal/bin/kpasswd\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i8*]
%4 = bitcast [2 x i8*]* %3 to i8*
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%6 = call i32 @spawn(i32 1, i8** %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showver() {
  printf("putin v0.1 - versatile ROM file corruption utility\n\n");
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"putin v0.1 - versatile ROM file corruption utility\0A\0A\00"
define void @showver() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"putin v0.1 - versatile ROM file corruption utility\0A\00"
define void @showver() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ btSentenceComma();
int /*<<< orphan*/ btSentenceInt(int);
int /*<<< orphan*/ btSentenceSend();
int /*<<< orphan*/ btSentenceStart(char, char);
void btConfirmPersistence(int addr, int size, int value) {
  btSentenceStart('P', 'V');
  btSentenceInt(addr);
  btSentenceComma();
  btSentenceInt(value);
  btSentenceSend();
}


x86 assembly (clang, -O0):
<btConfirmPersistence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x50,%edi
mov    $0x56,%esi
call   1030 <btSentenceStart@plt>
mov    -0x4(%rbp),%edi
call   1040 <btSentenceInt@plt>
mov    $0x0,%al
call   1050 <btSentenceComma@plt>
mov    -0xc(%rbp),%edi
call   1040 <btSentenceInt@plt>
mov    $0x0,%al
call   1060 <btSentenceSend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btConfirmPersistence>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
mov    $0x50,%edi
mov    $0x56,%esi
call   1030 <btSentenceStart@plt>
mov    %ebp,%edi
call   1040 <btSentenceInt@plt>
xor    %eax,%eax
call   1050 <btSentenceComma@plt>
mov    %ebx,%edi
call   1040 <btSentenceInt@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <btSentenceSend@plt>

LLVM IR (-O0):
define void @btConfirmPersistence(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @btSentenceStart(i8 signext 80, i8 signext 86)
%8 = load i32, i32* %4
%9 = call i32 @btSentenceInt(i32 %8)
%10 = call i32 (...) @btSentenceComma()
%11 = load i32, i32* %6
%12 = call i32 @btSentenceInt(i32 %11)
%13 = call i32 (...) @btSentenceSend()
ret void
}

LLVM IR (-O2):
define void @btConfirmPersistence(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @btSentenceStart(i8 signext 80, i8 signext 86)
%5 = tail call i32 @btSentenceInt(i32 %0)
%6 = tail call i32 (...) @btSentenceComma()
%7 = tail call i32 @btSentenceInt(i32 %2)
%8 = tail call i32 (...) @btSentenceSend()
ret void
}
void modif_front_unit2UCP() {}


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

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

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

LLVM IR (-O2):
define void @modif_front_unit2UCP() {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *firstn2(char *str, int n) {
  char *ret = malloc(n + 1);
  strncpy(ret, str, n);
  ret[n] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<firstn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstn2>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <strncpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @firstn2(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 i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @strncpy(i8* %9, i8* %10, i32 %11)
%13 = load i8*, i8** %5
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @firstn2(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @strncpy(i8* %4, i8* %0, i32 %1)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int uint16_t;

/* Variables and functions */
int zmem(scalar_t__);
uint16_t zword(uint32_t addr) {
  uint16_t r = zmem(addr) << 8;
  r |= zmem(addr + 1);
  return r;
}


x86 assembly (clang, -O0):
<zword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <zmem@plt>
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <zmem@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zword>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <zmem@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <zmem@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @zword(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @zmem(i64 %4)
%6 = shl i32 %5, 8
store i32 %6, i32* %3
%7 = load i64, i64* %2
%8 = add nsw i64 %7, 1
%9 = call i32 @zmem(i64 %8)
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @zword(i64 %0) {
%2 = tail call i32 @zmem(i64 %0)
%3 = shl i32 %2, 8
%4 = add nsw i64 %0, 1
%5 = tail call i32 @zmem(i64 %4)
%6 = or i32 %3, %5
ret i32 %6
}
int writemask_y(const int writemask) { return (writemask == 0x2); }


x86 assembly (clang, -O0):
<writemask_y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<writemask_y>:
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @writemask_y(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @writemask_y(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
__attribute__((always_)) float detexClamp0To1(float f) {
  if (f < 0.0f)
    return 0.0f;
  else if (f > 1.0f)
    return 1.0f;
  else
    return f;
}


x86 assembly (clang, -O0):
<detexClamp0To1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1123 <detexClamp0To1+0x23>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1155 <detexClamp0To1+0x55>
movss  -0x8(%rbp),%xmm0
movss  0xed0(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    114b <detexClamp0To1+0x4b>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1155 <detexClamp0To1+0x55>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<detexClamp0To1>:
movss  0xef8(%rip),%xmm1
minss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm2,%xmm0
andnps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @detexClamp0To1(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 0.000000e+00, float* %2
br label %13
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp ogt float %8, 1.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store float 1.000000e+00, float* %2
br label %13
11: ; preds = %7
%12 = load float, float* %3
store float %12, float* %2
br label %13
13: ; preds = %11, %10, %6
%14 = load float, float* %2
ret float %14
}

LLVM IR (-O2):
define float @detexClamp0To1(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %0
%5 = select i1 %2, float 0.000000e+00, float %4
ret float %5
}
/* Type definitions */
struct cbor_buf {
  int dummy;
};

/* Variables and functions */
int cbor_buf_append_byte(struct cbor_buf *, int);
bool cbor_add_false(struct cbor_buf *buf) {
  return cbor_buf_append_byte(buf, 0xf4);
}


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

x86 assembly (clang, -O2):
<cbor_add_false>:
mov    $0xf4,%esi
jmp    1030 <cbor_buf_append_byte@plt>

LLVM IR (-O0):
%struct.cbor_buf = type { i32 }
define i32 @cbor_add_false(%struct.cbor_buf* %0) {
%2 = alloca %struct.cbor_buf*
store %struct.cbor_buf* %0, %struct.cbor_buf** %2
%3 = load %struct.cbor_buf*, %struct.cbor_buf** %2
%4 = call i32 @cbor_buf_append_byte(%struct.cbor_buf* %3, i32 244)
ret i32 %4
}

LLVM IR (-O2):
%struct.cbor_buf = type { i32 }
define i32 @cbor_add_false(%struct.cbor_buf* %0) {
%2 = tail call i32 @cbor_buf_append_byte(%struct.cbor_buf* %0, i32 244)
ret i32 %2
}
int baz(void) {
  int i;
  for (i = 0; 1; i++) {
    return 3;
  }
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    111a <baz+0x1a>
jmp    1121 <baz+0x21>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @baz() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %5, %0
br i1 true, label %4, label %8
4: ; preds = %3
store i32 3, i32* %1
br label %8
5: ; No predecessors!
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
br label %3
8: ; preds = %4, %3
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @baz() {
ret i32 3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t uleb_byte_get_bits(const uint8_t byte) { return (byte & 0x7f); }


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

x86 assembly (clang, -O2):
<uleb_byte_get_bits>:
mov    %edi,%eax
and    $0x7f,%eax
ret

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

LLVM IR (-O2):
define i32 @uleb_byte_get_bits(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
/* Type definitions */
struct semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ up(struct semaphore *);
void double_up(struct semaphore *s1, struct semaphore *s2) {
  up(s1);
  if (s1 != s2)
    up(s2);
}


x86 assembly (clang, -O0):
<double_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <up@plt>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1140 <double_up+0x30>
mov    -0x10(%rbp),%rdi
call   1030 <up@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_up>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <up@plt>
cmp    %r14,%rbx
je     1133 <double_up+0x23>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <up@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.semaphore = type { i32 }
define void @double_up(%struct.semaphore* %0, %struct.semaphore* %1) {
%3 = tail call i32 @up(%struct.semaphore* %0)
%4 = icmp eq %struct.semaphore* %0, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @up(%struct.semaphore* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int x();
int main() {
  int i;
  i = x();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @x()
ret i32 0
}
int fun604() { return 604; }


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

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

LLVM IR (-O0):
define i32 @fun604() {
ret i32 604
}

LLVM IR (-O2):
define i32 @fun604() {
ret i32 604
}
/* Variables and functions */
int /*<<< orphan*/ bzero(int *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
int *histinit() {
  int *hist;
  {
    hist = (int *)malloc(((1 << (6 + 7 + 6))) * sizeof(int));
    if (!hist) {
      fprintf(stderr,
              "pic_alloc: Can't allocate %d bytes of memory, aborting\n",
              (1 << (6 + 7 + 6)));
      exit(1);
    }
  };
  bzero(hist, (1 << (6 + 7 + 6)) * sizeof(int));
  return hist;
}


x86 assembly (clang, -O0):
<histinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x200000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1185 <histinit+0x45>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
mov    $0x80000,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    $0x200000,%esi
call   1050 <bzero@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<histinit>:
push   %rbx
mov    $0x200000,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1165 <histinit+0x25>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x200000,%esi
call   1050 <bzero@plt>
mov    %rbx,%rax
pop    %rbx
ret
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
mov    $0x80000,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"pic_alloc: Can't allocate %d bytes of memory, aborting\0A\00"
define i32* @histinit() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 2097152)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 524288)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = load i32*, i32** %1
%12 = call i32 @bzero(i32* %11, i32 2097152)
%13 = load i32*, i32** %1
ret i32* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"pic_alloc: Can't allocate %d bytes of memory, aborting\0A\00"
define i32* @histinit() {
%1 = tail call i64 @malloc(i32 2097152)
%2 = inttoptr i64 %1 to i32*
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 524288)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = tail call i32 @bzero(i32* %2, i32 2097152)
ret i32* %2
}
/* Variables and functions */
char *_strstr_word(char const *, char const *, int, int /*<<< orphan*/, int);
char *strcasestr_word_suffix(const char *haystack, const char *needle) {
  return _strstr_word(haystack, needle, 1, 0, 1);
}


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

x86 assembly (clang, -O2):
<strcasestr_word_suffix>:
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <_strstr_word@plt>

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

LLVM IR (-O2):
define i8* @strcasestr_word_suffix(i8* %0, i8* %1) {
%3 = tail call i8* @_strstr_word(i8* %0, i8* %1, i32 1, i32 0, i32 1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int pthread_self();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ write(int, char *, int);
void *f3(void *p) {
  int i;
  printf("mytid=%u\n", pthread_self());
  for (i = 0;; i++) {
    write(1, "$", 1);
    sleep(1);
  }
  return (void *)456;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    $0x1,%edx
lea    0xe96(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1168 <f3+0x28>

x86 assembly (clang, -O2):
<f3>:
push   %rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xead(%rip),%rbx
nopl   (%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    1160 <f3+0x20>

LLVM IR (-O0):
@.str = [10 x i8] c"mytid=%u\0A\00"
@.str.1 = [2 x i8] c"$\00"
define i8* @f3(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @pthread_self()
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 0, i32* %3
br label %6
6: ; preds = %9, %1
%7 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%8 = call i32 @sleep(i32 1)
br label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %6
}

LLVM IR (-O2):
@.str = [10 x i8] c"mytid=%u\0A\00"
@.str.1 = [2 x i8] c"$\00"
define noalias i8* @f3(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = tail call i32 @sleep(i32 1)
br label %4
}
/* Variables and functions */
int in_class(int, char *);
int in_string_quote_class(int c) { return in_class(c, "'\""); }


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

x86 assembly (clang, -O2):
<in_string_quote_class>:
lea    0xee9(%rip),%rsi
jmp    1030 <in_class@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"'\22\00"
define i32 @in_string_quote_class(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @in_class(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"'\22\00"
define i32 @in_string_quote_class(i32 %0) {
%2 = tail call i32 @in_class(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int __infer_nondet_int();
int isxdigit(int x) { return __infer_nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
char *strlwr(string)
register char *string;
{
  register char *p = string;
  if (p) {
    while (*string) {
      if (isupper(*string))
        *string = tolower(*string);
      ++string;
    }
  }
  return (p);
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1190 <strlwr+0x70>
jmp    1144 <strlwr+0x24>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     118b <strlwr+0x6b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%eax
je     117a <strlwr+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1144 <strlwr+0x24>
jmp    1190 <strlwr+0x70>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
test   %rdi,%rdi
je     1165 <strlwr+0x45>
mov    (%r14),%al
test   %al,%al
je     1165 <strlwr+0x45>
lea    0x1(%r14),%rbx
jmp    114b <strlwr+0x2b>
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <strlwr+0x45>
movsbl %al,%ebp
mov    %ebp,%edi
call   1040 <isupper@plt>
test   %eax,%eax
je     1140 <strlwr+0x20>
mov    %ebp,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <strlwr+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strlwr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %29
7: ; preds = %1
br label %8
8: ; preds = %25, %7
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %28
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 @isupper(i32 %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %12
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = call i32 @tolower(i32 %21)
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %2
store i8 %23, i8* %24
br label %25
25: ; preds = %18, %12
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %2
br label %8
28: ; preds = %8
br label %29
29: ; preds = %28, %1
%30 = load i8*, i8** %3
ret i8* %30
}

LLVM IR (-O2):
define i8* @strlwr(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %3, %15
%7 = phi i8 [ %17, %15 ], [ %4, %3 ]
%8 = phi i8* [ %16, %15 ], [ %0, %3 ]
%9 = sext i8 %7 to i32
%10 = tail call i32 @isupper(i32 %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = tail call i32 @tolower(i32 %9)
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
br label %15
15: ; preds = %12, %6
%16 = getelementptr inbounds i8, i8* %8, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %6
19: ; preds = %15, %3, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int main(int argc, char *argv[]) {
  int a = 5;
  double b = 1.2;
  long answer = a * b;
  printf("%ld\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
store double 1.200000e+00, double* %7
%9 = load i32, i32* %6
%10 = sitofp i32 %9 to double
%11 = load double, double* %7
%12 = fmul double %10, %11
%13 = fptosi double %12 to i64
store i64 %13, i64* %8
%14 = load i64, i64* %8
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(int /*<<< orphan*/ *, int,
                                 int /*<<< orphan*/ *, int, int, int);
void pixel_avg_2x2(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                   int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 2, 2);
}


x86 assembly (clang, -O0):
<pixel_avg_2x2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x2,%r9d
mov    %r9d,%r8d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_2x2>:
mov    $0x2,%r8d
mov    $0x2,%r9d
jmp    1030 <pixel_avg_wxh@plt>

LLVM IR (-O0):
define void @pixel_avg_2x2(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* %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @pixel_avg_wxh(i32* %9, i32 %10, i32* %11, i32 %12, i32 2, i32 2)
ret void
}

LLVM IR (-O2):
define void @pixel_avg_2x2(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 2, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
void keyboard(unsigned char key, int x, int y) {
  switch (key) {
  case ' ':
    glutPostRedisplay();
    break;
  case 27:
    exit(0);
  }
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1b,%eax
je     1166 <keyboard+0x46>
jmp    1149 <keyboard+0x29>
mov    -0x10(%rbp),%eax
sub    $0x20,%eax
jne    116d <keyboard+0x4d>
jmp    115a <keyboard+0x3a>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
jmp    116d <keyboard+0x4d>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
cmp    $0x20,%dil
je     112d <keyboard+0xd>
cmp    $0x1b,%dil
je     1134 <keyboard+0x14>
ret
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %13 [
i32 32, label %9
i32 27, label %11
]
9: ; preds = %3
%10 = call i32 (...) @glutPostRedisplay()
br label %13
11: ; preds = %3
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %3, %9
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %8 [
i8 32, label %4
i8 27, label %6
]
4: ; preds = %3
%5 = tail call i32 (...) @glutPostRedisplay()
br label %8
6: ; preds = %3
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %3, %4
ret void
}
/* Variables and functions */
size_t strcspn(char *, char *);
char *strchomp(char *string) {
  string[strcspn(string, "\r\n")] = '\0';
  return string;
}


x86 assembly (clang, -O0):
<strchomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strcspn@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchomp>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcspn@plt>
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define i8* @strchomp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strcspn(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8, i8* %3, i64 %5
store i8 0, i8* %6
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define i8* @strchomp(i8* returned %0) {
%2 = tail call i64 @strcspn(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 %2
store i8 0, i8* %3
ret i8* %0
}
int SLF(const char s[]) {
  int len = 0;
  while (s[len] != '\0')
    ++len;
  return len;
}


x86 assembly (clang, -O0):
<SLF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <SLF+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <SLF+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SLF>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <SLF+0x10>
ret

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

LLVM IR (-O2):
define i32 @SLF(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ malloc(size_t);
void *memset(int /*<<< orphan*/, int /*<<< orphan*/, size_t);
void *_zalloc(size_t size) { return memset(malloc(size), 0, size); }


x86 assembly (clang, -O0):
<_zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @_zalloc(i64 %0) {
%2 = tail call i32 @malloc(i64 %0)
%3 = tail call i8* @memset(i32 %2, i32 0, i64 %0)
ret i8* %3
}
void libsoc_debug(const char *func, char *format, ...) {}


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

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

LLVM IR (-O0):
define void @libsoc_debug(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @libsoc_debug(i8* nocapture %0, i8* nocapture %1, ...) {
ret void
}