xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ bar();
scalar_t__ foo();
main() {
  if (bar() != 0 || foo() != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <bar@plt>
cmp    $0x0,%rax
jne    1161 <main+0x31>
mov    $0x0,%al
call   1050 <foo@plt>
cmp    $0x0,%rax
je     1168 <main+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <bar@plt>
test   %rax,%rax
jne    114d <main+0x1d>
xor    %eax,%eax
call   1050 <foo@plt>
test   %rax,%rax
jne    114d <main+0x1d>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @bar()
%3 = icmp ne i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i64 (...) @foo()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4, %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @bar()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 (...) @foo()
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int isSupported(char *type) {
  if (!strcasecmp(type, "XGM"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSupported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1141 <isSupported+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <isSupported+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSupported>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"XGM\00"
define i32 @isSupported(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_CTX;
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ SSL_CTX_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *SSL_get_SSL_CTX(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_shutdown(int /*<<< orphan*/ *);
void SSL_terminal(SSL *ssl) {
  SSL_CTX *ctx = SSL_get_SSL_CTX(ssl);
  SSL_shutdown(ssl);
  SSL_free(ssl);
  if (ctx)
    SSL_CTX_free(ctx);
}


x86 assembly (clang, -O0):
<SSL_terminal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <SSL_get_SSL_CTX@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <SSL_shutdown@plt>
mov    -0x8(%rbp),%rdi
call   1030 <SSL_free@plt>
cmpq   $0x0,-0x10(%rbp)
je     117f <SSL_terminal+0x3f>
mov    -0x10(%rbp),%rdi
call   1060 <SSL_CTX_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSL_terminal>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <SSL_get_SSL_CTX@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <SSL_shutdown@plt>
mov    %rbx,%rdi
call   1030 <SSL_free@plt>
test   %r14,%r14
je     1173 <SSL_terminal+0x33>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <SSL_CTX_free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @SSL_terminal(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32* @SSL_get_SSL_CTX(i32* %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %2
%7 = call i32 @SSL_shutdown(i32* %6)
%8 = load i32*, i32** %2
%9 = call i32 @SSL_free(i32* %8)
%10 = load i32*, i32** %3
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32*, i32** %3
%14 = call i32 @SSL_CTX_free(i32* %13)
br label %15
15: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
define void @SSL_terminal(i32* %0) {
%2 = tail call i32* @SSL_get_SSL_CTX(i32* %0)
%3 = tail call i32 @SSL_shutdown(i32* %0)
%4 = tail call i32 @SSL_free(i32* %0)
%5 = icmp eq i32* %2, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @SSL_CTX_free(i32* %2)
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int sigblock(int mask) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<sigblock>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigblock>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sigblock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sigblock(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ basename(char *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int basename_match_filter(char *filename, char *textcontent) {
  if (strcmp(basename(filename), textcontent) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<basename_match_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <basename@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115a <basename_match_filter+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <basename_match_filter+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename_match_filter>:
push   %rbx
mov    %rsi,%rbx
call   1040 <basename@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @basename_match_filter(i8* %0, i8* %1) {
%3 = tail call i32 @basename(i8* %0)
%4 = tail call i64 @strcmp(i32 %3, i8* %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, size_t);
void *solv_extend(void *, size_t, size_t, size_t, size_t);
void *solv_zextend(void *buf, size_t len, size_t nmemb, size_t size,
                   size_t block) {
  buf = solv_extend(buf, len, nmemb, size, block);
  memset((char *)buf + len * size, 0, nmemb * size);
  return buf;
}


x86 assembly (clang, -O0):
<solv_zextend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <solv_extend@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
imul   -0x20(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rdx
imul   -0x20(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solv_zextend>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <solv_extend@plt>
mov    %rax,%r12
imul   %r15,%rbx
add    %rax,%rbx
imul   %r14,%r15
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15,%rdx
call   1040 <memset@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @solv_zextend(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = call i8* @solv_extend(i8* %11, i64 %12, i64 %13, i64 %14, i64 %15)
store i8* %16, i8** %6
%17 = load i8*, i8** %6
%18 = load i64, i64* %7
%19 = load i64, i64* %9
%20 = mul i64 %18, %19
%21 = getelementptr inbounds i8, i8* %17, i64 %20
%22 = load i64, i64* %8
%23 = load i64, i64* %9
%24 = mul i64 %22, %23
%25 = call i32 @memset(i8* %21, i32 0, i64 %24)
%26 = load i8*, i8** %6
ret i8* %26
}

LLVM IR (-O2):
define i8* @solv_zextend(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i8* @solv_extend(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4)
%7 = mul i64 %3, %1
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = mul i64 %3, %2
%10 = tail call i32 @memset(i8* %8, i32 0, i64 %9)
ret i8* %6
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_motion_mask_z(void) {
  char int_ctrl_reg2 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1F, &int_ctrl_reg2, 1) == 0) {
    int_ctrl_reg2 |= 0x20;
    KIONIX_ACCEL_write_byte(0x1F, int_ctrl_reg2);
  } else
    status = 1;
  return status;
}


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

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

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

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_motion_mask_z() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 31, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = or i8 %5, 32
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 31, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
int parent(int iPos) { return (iPos - 1) / 2; }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_CYAN;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attrset(int /*<<< orphan*/);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ start_color();
void jogo_fim() {
  start_color();
  init_pair(1, COLOR_CYAN, COLOR_BLACK);
  attrset(COLOR_PAIR(1));
  printw("GAME OVER!!!\nAperte alguma tecla para sair...");
  getch();
}


x86 assembly (clang, -O0):
<jogo_fim>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <start_color@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1080 <attrset@plt>
lea    0xe61(%rip),%rdi
call   1050 <printw@plt>
mov    $0x0,%al
call   1070 <getch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jogo_fim>:
push   %rax
xor    %eax,%eax
call   1040 <start_color@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%esi
mov    0x2e70(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1080 <attrset@plt>
lea    0xe64(%rip),%rdi
call   1050 <printw@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <getch@plt>

LLVM IR (-O0):
@COLOR_CYAN = global i32 0
@COLOR_BLACK = global i32 0
@.str = [46 x i8] c"GAME OVER!!!\0AAperte alguma tecla para sair...\00"
define void @jogo_fim() {
%1 = call i32 (...) @start_color()
%2 = load i32, i32* @COLOR_CYAN
%3 = load i32, i32* @COLOR_BLACK
%4 = call i32 @init_pair(i32 1, i32 %2, i32 %3)
%5 = call i32 @COLOR_PAIR(i32 1)
%6 = call i32 @attrset(i32 %5)
%7 = call i32 @printw(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@COLOR_CYAN = global i32 0
@COLOR_BLACK = global i32 0
@.str = [46 x i8] c"GAME OVER!!!\0AAperte alguma tecla para sair...\00"
define void @jogo_fim() {
%1 = tail call i32 (...) @start_color()
%2 = load i32, i32* @COLOR_CYAN
%3 = load i32, i32* @COLOR_BLACK
%4 = tail call i32 @init_pair(i32 1, i32 %2, i32 %3)
%5 = tail call i32 @COLOR_PAIR(i32 1)
%6 = tail call i32 @attrset(i32 %5)
%7 = tail call i32 @printw(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @getch()
ret void
}
int neii(int a, int b) { return -(a != b); }


x86 assembly (clang, -O0):
<neii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neii>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @neii(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern char *__progname;
  fprintf(stderr,
          "usage: %s [-cdfghlmnpqrstv] [-Pprinter] [-#num] [-C class] "
          "[-J job] [-T title]\n           [-U user] [-i [numcols]] "
          "[-1234 font] [-wnum] [name ...]\n",
          __progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%rdx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [148 x i8] c"usage: %s [-cdfghlmnpqrstv] [-Pprinter] [-#num] [-C class] [-J job] [-T title]\0A [-U user] [-i [numcols]] [-1234 font] [-wnum] [name ...]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [148 x i8] c"usage: %s [-cdfghlmnpqrstv] [-Pprinter] [-#num] [-C class] [-J job] [-T title]\0A [-U user] [-i [numcols]] [-1234 font] [-wnum] [name ...]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int capng_lock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @capng_lock() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ xmm_free(void *, size_t);
void *xmm_new(size_t);
void *xmm_renew(void *old, size_t old_size, size_t new_size) {
  xmm_free(old, old_size);
  return xmm_new(new_size);
}


x86 assembly (clang, -O0):
<xmm_renew>:
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
call   1030 <xmm_free@plt>
mov    -0x18(%rbp),%rdi
call   1040 <xmm_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmm_renew>:
push   %rbx
mov    %rdx,%rbx
call   1030 <xmm_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <xmm_new@plt>

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

LLVM IR (-O2):
define i8* @xmm_renew(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @xmm_free(i8* %0, i64 %1)
%5 = tail call i8* @xmm_new(i64 %2)
ret i8* %5
}
void glEnableVertexAttribArray(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glEnableVertexAttribArray() {
ret void
}
/* Type definitions */
struct p7_timer_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ p7_timer_event_del_(struct p7_timer_event *);
void p7_timer_event_del(struct p7_timer_event *ev) { p7_timer_event_del_(ev); }


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

x86 assembly (clang, -O2):
<p7_timer_event_del>:
jmp    1030 <p7_timer_event_del_@plt>

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

LLVM IR (-O2):
%struct.p7_timer_event = type { i32 }
define void @p7_timer_event_del(%struct.p7_timer_event* %0) {
%2 = tail call i32 @p7_timer_event_del_(%struct.p7_timer_event* %0)
ret void
}
void McASPRxTimeSlotSet(unsigned int baseAddr, unsigned int slotMask) {
  (*((volatile unsigned int *)(baseAddr + (0x78)))) = slotMask;
}


x86 assembly (clang, -O0):
<McASPRxTimeSlotSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x78,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPRxTimeSlotSet>:
add    $0x78,%edi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @McASPRxTimeSlotSet(i32 %0, i32 %1) {
%3 = add i32 %0, 120
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
int any_odd_one(unsigned x) { return !!(x & 0xAAAAAAAA); }


x86 assembly (clang, -O0):
<any_odd_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaaaaaaaa,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_odd_one>:
xor    %eax,%eax
test   $0xaaaaaaaa,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @any_odd_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -1431655766
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @any_odd_one(i32 %0) {
%2 = and i32 %0, -1431655766
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mostraMenu();
main() {
  mostraMenu();
  return 0;
}


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

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

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

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


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

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

LLVM IR (-O0):
define i32 @do_362() {
ret i32 362
}

LLVM IR (-O2):
define i32 @do_362() {
ret i32 362
}
/* Variables and functions */
double floor(double);
double nearbyint(double x) { return floor(x + 0.5); }


x86 assembly (clang, -O0):
<nearbyint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearbyint>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @nearbyint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call double @llvm.floor.f64(double %4)
ret double %5
}

LLVM IR (-O2):
define double @nearbyint(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
ret double %3
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ mystrncpy(char *, char *, int);
char *mystrndup(char *src, int n) {
  if (src) {
    char *ptr = (char *)malloc(n + 1);
    mystrncpy(ptr, src, n);
    return ptr;
  } else
    return NULL;
}


x86 assembly (clang, -O0):
<mystrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1166 <mystrndup+0x46>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <mystrncpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <mystrndup+0x4e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrndup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     114c <mystrndup+0x2c>
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0x1(%r14),%edi
call   1030 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <mystrncpy@plt>
jmp    114f <mystrndup+0x2f>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @mystrndup(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = add nsw i32 %1, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @mystrncpy(i8* %7, i8* %0, i32 %1)
br label %9
9: ; preds = %2, %4
%10 = phi i8* [ %7, %4 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void sleep_ms(unsigned n) { usleep(n * 1000); }


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

x86 assembly (clang, -O2):
<sleep_ms>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @sleep_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @sleep_ms(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
void PDMQueueInsert(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMQueueInsert() {
ret void
}
int even(int n) {
  if (n % 2 == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<even>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <even+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <even+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<even>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @even(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void cbw() {
  put8(0x66);
  put8(0x98);
}


x86 assembly (clang, -O0):
<cbw>:
push   %rbp
mov    %rsp,%rbp
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x98,%edi
call   1030 <put8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbw>:
push   %rax
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x98,%edi
pop    %rax
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @cbw() {
%1 = call i32 @put8(i32 102)
%2 = call i32 @put8(i32 152)
ret void
}

LLVM IR (-O2):
define void @cbw() {
%1 = tail call i32 @put8(i32 102)
%2 = tail call i32 @put8(i32 152)
ret void
}
/* Variables and functions */
int a1(int);
int a2(int, int);
int a3(int, int, int);
int j0(int j) { return a1(j) + a2(j, j) + a3(j, j, j); }


x86 assembly (clang, -O0):
<j0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <a1@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <a2@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1040 <a3@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j0>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1030 <a1@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    %ebx,%esi
call   1050 <a2@plt>
mov    %eax,%ebp
add    %r14d,%ebp
mov    %ebx,%edi
mov    %ebx,%esi
mov    %ebx,%edx
call   1040 <a3@plt>
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @j0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @a1(i32 %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @a2(i32 %5, i32 %6)
%8 = add nsw i32 %4, %7
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @a3(i32 %9, i32 %10, i32 %11)
%13 = add nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @j0(i32 %0) {
%2 = tail call i32 @a1(i32 %0)
%3 = tail call i32 @a2(i32 %0, i32 %0)
%4 = add nsw i32 %3, %2
%5 = tail call i32 @a3(i32 %0, i32 %0, i32 %0)
%6 = add nsw i32 %4, %5
ret i32 %6
}
/* Type definitions */
struct usb_descriptor_header {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct usb_descriptor_header **);
void usb_free_descriptors(struct usb_descriptor_header **v) { kfree(v); }


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

x86 assembly (clang, -O2):
<usb_free_descriptors>:
jmp    1030 <kfree@plt>

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

LLVM IR (-O2):
%struct.usb_descriptor_header = type { i32 }
define void @usb_free_descriptors(%struct.usb_descriptor_header** %0) {
%2 = tail call i32 @kfree(%struct.usb_descriptor_header** %0)
ret void
}
void *baz(void) {
  int i;
  return &i;
}


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

x86 assembly (clang, -O2):
<baz>:
lea    -0x4(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @baz() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @baz() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ MemError();
int /*<<< orphan*/ MyExit(int);
scalar_t__ asprintf(char **, char *, char *, char *);
char *AddFileName(char *pathname, char *filename) {
  char *buffer;
  if (asprintf(&buffer, "%s/%s", pathname, filename) < 0) {
    MemError();
    MyExit(10);
  }
  return buffer;
}


x86 assembly (clang, -O0):
<AddFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1040 <asprintf@plt>
cmp    $0x0,%rax
jge    1173 <AddFileName+0x43>
mov    $0x0,%al
call   1030 <MemError@plt>
mov    $0xa,%edi
call   1050 <MyExit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddFileName>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xec2(%rip),%rsi
mov    %rsp,%rdi
call   1040 <asprintf@plt>
test   %rax,%rax
jns    115c <AddFileName+0x2c>
xor    %eax,%eax
call   1030 <MemError@plt>
mov    $0xa,%edi
call   1050 <MyExit@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
define i8* @AddFileName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @asprintf(i8** %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 (...) @MemError()
%9 = call i32 @MyExit(i32 10)
br label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %3
ret i8* %11
}
void *memcopy(void *p, int len) {
  char *q = malloc(len);
  if (!q)
    fatal("out of dynamic memory");
  memcpy(q, p, len);
  return (q);
}


x86 assembly (clang, -O0):
<memcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1165 <memcopy+0x35>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1050 <fatal@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcopy>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
movslq %esi,%r15
mov    %r15,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1159 <memcopy+0x29>
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1050 <fatal@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"out of dynamic memory\00"
define i8* @memcopy(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 = sext i32 %6 to i64
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@.str = [22 x i8] c"out of dynamic memory\00"
define i8* @memcopy(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %4, i8* align 1 %0, i64 %3, i1 false)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char prompt_use_code(void) {
  char temp_value = '\0';
  printf("Use Code (R, C, I)? ");
  scanf(" %c", &temp_value);
  return temp_value;
}


x86 assembly (clang, -O0):
<prompt_use_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_use_code>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Use Code (R, C, I)? \00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @prompt_use_code() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
@.str = [21 x i8] c"Use Code (R, C, I)? \00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @prompt_use_code() {
%1 = alloca i8
store i8 0, i8* %1
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
ret i8 %4
}
/* Variables and functions */
char getc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ stdin;
int main() {
  char a;
  a = getc(stdin);
  printf("%d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %al,-0x5(%rbp)
lea    0xeb9(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
movsbl %al,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = load i32, i32* @stdin
%4 = call signext i8 @getc(i32 %3)
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call signext i8 @getc(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int execveat_(int fd, const char *path, char **argv, char **envp, int flags) {
  errno = -ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<execveat_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xor    %ecx,%ecx
mov    0x2ec8(%rip),%rax
sub    (%rax),%ecx
mov    0x2eaf(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<execveat_>:
mov    0x2ee1(%rip),%rax
xor    %ecx,%ecx
sub    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @execveat_(i32 %0, i8* %1, i8** %2, i8** %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
%12 = sub nsw i32 0, %11
store i32 %12, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @execveat_(i32 %0, i8* nocapture readnone %1, i8** nocapture readnone %2, i8** nocapture readnone %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
%7 = sub nsw i32 0, %6
store i32 %7, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sem_create(int);
int sem_getval(int);
int /*<<< orphan*/ sem_setval(int, int);
int main(void) {
  int semid;
  semid = sem_create(1234);
  sem_setval(semid, 5);
  printf("%d\n", sem_getval(semid));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4d2,%edi
call   1040 <sem_create@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
call   1050 <sem_setval@plt>
mov    -0x8(%rbp),%edi
call   1060 <sem_getval@plt>
mov    %eax,%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4d2,%edi
call   1040 <sem_create@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x5,%esi
call   1050 <sem_setval@plt>
mov    %ebx,%edi
call   1060 <sem_getval@plt>
lea    0xe99(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sem_create(i32 1234)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @sem_setval(i32 %4, i32 5)
%6 = load i32, i32* %2
%7 = call i32 @sem_getval(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @sem_create(i32 1234)
%2 = tail call i32 @sem_setval(i32 %1, i32 5)
%3 = tail call i32 @sem_getval(i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_set_monitor(void *bus,
                                                              int b) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_set_monitor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_set_monitor>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_set_monitor(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_set_monitor(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
int main(void) {
  char a;
  char c;
  char b;
  a = b + c;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsbl -0x7(%rbp),%eax
movsbl -0x6(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x5(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i32 0, i32* %1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = add nsw i32 %6, %8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int sigfillset(sigset_t *set) {
  (void)set;
  puts("sigfillset: not implemented");
  return -1;
}


x86 assembly (clang, -O0):
<sigfillset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"sigfillset: not implemented\00"
define i32 @sigfillset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [28 x i8] c"sigfillset: not implemented\00"
define i32 @sigfillset(i32* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int f1(int x, int y) {
  int z = x * y;
  return x + y + z;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %esi,%eax
imul   %edi,%eax
add    %esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %3
ret i32 %5
}