xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int dup(int);
int /*<<< orphan*/ printf(char *, int);
int mfd_assert_dup(int fd) {
  int r;
  r = dup(fd);
  if (r < 0) {
    printf("dup(%d) failed: %m\n", fd);
    abort();
  }
  return r;
}


x86 assembly (clang, -O0):
<mfd_assert_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <dup@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1166 <mfd_assert_dup+0x36>
mov    -0x4(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfd_assert_dup>:
push   %rbx
mov    %edi,%ebx
call   1050 <dup@plt>
test   %eax,%eax
js     113e <mfd_assert_dup+0xe>
pop    %rbx
ret
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"dup(%d) failed: %m\0A\00"
define i32 @mfd_assert_dup(i32 %0) {
%2 = tail call i32 @dup(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ outw(int, unsigned int);
void vp_notify(unsigned int ioaddr, int queue_index) {
  outw(queue_index, ioaddr + 16);
}


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

x86 assembly (clang, -O2):
<vp_notify>:
mov    %esi,%eax
lea    0x10(%rdi),%esi
mov    %eax,%edi
jmp    1030 <outw@plt>

LLVM IR (-O0):
define void @vp_notify(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, 16
%8 = call i32 @outw(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @vp_notify(i32 %0, i32 %1) {
%3 = add i32 %0, 16
%4 = tail call i32 @outw(i32 %1, i32 %3)
ret void
}
int fn4(int x, int y) { return ~(y | x) | x; }


x86 assembly (clang, -O0):
<fn4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
xor    $0xffffffff,%eax
or     -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn4>:
mov    %esi,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn4(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 = or i32 %5, %6
%8 = xor i32 %7, -1
%9 = load i32, i32* %3
%10 = or i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @fn4(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
void *symlink() {
  errno = ENOSYS;
  return 0;
}


x86 assembly (clang, -O0):
<symlink>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @symlink() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @symlink() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void yyerror(char *msg) { fprintf(stderr, "%s\n", msg); }


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int close(int);
int apr_close(int sock) {
  int retval = 0;
  if (sock < 0)
    return 0;
  retval = close(sock);
  return retval;
}


x86 assembly (clang, -O0):
<apr_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1138 <apr_close+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1149 <apr_close+0x39>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apr_close>:
test   %edi,%edi
js     1119 <apr_close+0x9>
jmp    1030 <close@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @apr_close(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ showUsage();
int /*<<< orphan*/ stderr;
long strtol(char const *, char **, int);
int numarg(const char *arg) {
  char *end = NULL;
  const long num = strtol(arg, &end, 10);
  if (*end) {
    fprintf(stderr, "Not a number: \"%s\"\n", arg);
    showUsage();
  }
  return num;
}


x86 assembly (clang, -O0):
<numarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1187 <numarg+0x57>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe85(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <showUsage@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numarg>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,%r14
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
je     1177 <numarg+0x47>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <showUsage@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Not a number: \22%s\22\0A\00"
define i32 @numarg(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
store i8* null, i8** %3
%5 = load i8*, i8** %2
%6 = call i64 @strtol(i8* %5, i8** %3, i32 10)
store i64 %6, i64* %4
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 (...) @showUsage()
br label %15
15: ; preds = %10, %1
%16 = load i64, i64* %4
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Not a number: \22%s\22\0A\00"
define i32 @numarg(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = call i64 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%11 = tail call i32 (...) @showUsage()
br label %12
12: ; preds = %8, %1
%13 = trunc i64 %4 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void g() { puts("g"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"g\00"
define void @g() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int ntohs(int);
int is_allowed_port(uint16_t port) {
  port = ntohs(port);
  return (port == 80) || (port == 443) || (port == 554);
}


x86 assembly (clang, -O0):
<is_allowed_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ntohs@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x50,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1154 <is_allowed_port+0x44>
mov    $0x1,%al
cmpl   $0x1bb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1154 <is_allowed_port+0x44>
cmpl   $0x22a,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_allowed_port>:
push   %rax
call   1030 <ntohs@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x50,%ecx
je     112a <is_allowed_port+0x1a>
cmp    $0x1bb,%ecx
jne    112c <is_allowed_port+0x1c>
pop    %rcx
ret
xor    %eax,%eax
cmp    $0x22a,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_allowed_port(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ntohs(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 80
br i1 %6, label %13, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 443
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 554
br label %13
13: ; preds = %10, %7, %1
%14 = phi i1 [ true, %7 ], [ true, %1 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @is_allowed_port(i32 %0) {
%2 = tail call i32 @ntohs(i32 %0)
switch i32 %2, label %3 [
i32 443, label %6
i32 80, label %6
]
3: ; preds = %1
%4 = icmp eq i32 %2, 554
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %3
%7 = phi i32 [ 1, %1 ], [ %5, %3 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
int iintxor(int x, int y) {
  x ^= 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<iintxor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x18,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <iintxor+0x2a>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iintxor>:
push   %rbx
mov    %edi,%ebx
xor    $0x18,%ebx
jne    111f <iintxor+0xf>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @iintxor(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 = xor i32 %5, 24
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @foo(i8* null)
br label %11
11: ; preds = %9, %2
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @iintxor(i32 %0, i32 %1) {
%3 = xor i32 %0, 24
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int mpui_list_empty(void *list) {
  if (*(void **)list)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<mpui_list_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1122 <mpui_list_empty+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1129 <mpui_list_empty+0x29>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpui_list_empty>:
xor    %eax,%eax
cmpq   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @mpui_list_empty(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @mpui_list_empty(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
int __attribute((fastcall)) check_fastcall_espdiff_2(int a, int b) {
  return a + b;
}


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

x86 assembly (clang, -O2):
<check_fastcall_espdiff_2>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @check_fastcall_espdiff_2(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @check_fastcall_espdiff_2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void foo757() {}


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

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

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

LLVM IR (-O2):
define void @foo757() {
ret void
}
void xorSwapp(int *x, int *y) {
  if (x != y) {
    *x ^= *y;
    *y ^= *x;
    *x ^= *y;
  }
}


x86 assembly (clang, -O0):
<xorSwapp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1144 <xorSwapp+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorSwapp>:
cmp    %rsi,%rdi
je     1111 <xorSwapp+0x11>
mov    (%rdi),%eax
xor    (%rsi),%eax
mov    %eax,(%rdi)
xor    (%rsi),%eax
mov    %eax,(%rsi)
xor    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @xorSwapp(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
br i1 %7, label %8, label %24
8: ; preds = %2
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = xor i32 %12, %10
store i32 %13, i32* %11
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = xor i32 %17, %15
store i32 %18, i32* %16
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = load i32*, i32** %3
%22 = load i32, i32* %21
%23 = xor i32 %22, %20
store i32 %23, i32* %21
br label %24
24: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @xorSwapp(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = load i32, i32* %0
%7 = xor i32 %6, %5
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = xor i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %0
%11 = xor i32 %10, %9
store i32 %11, i32* %0
br label %12
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ brc(int, char);
void cha(int pn) { brc(pn, 'G'); }


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

x86 assembly (clang, -O2):
<cha>:
mov    $0x47,%esi
jmp    1030 <brc@plt>

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

LLVM IR (-O2):
define void @cha(i32 %0) {
%2 = tail call i32 @brc(i32 %0, i8 signext 71)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void usage(void) {
  die("Usage: build [-b] bootsect setup system rootdev vmlinux vmlinux.bin.gz "
      "<vmlinux with decompressor code>[> image]");
}


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

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

LLVM IR (-O0):
@.str = [113 x i8] c"Usage: build [-b] bootsect setup system rootdev vmlinux vmlinux.bin.gz <vmlinux with decompressor code>[> image]\00"
define void @usage() {
%1 = call i32 @die(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [113 x i8] c"Usage: build [-b] bootsect setup system rootdev vmlinux vmlinux.bin.gz <vmlinux with decompressor code>[> image]\00"
define void @usage() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _delay_ms(int);
int /*<<< orphan*/ lcd_port_config();
int /*<<< orphan*/ lcd_reset();
int /*<<< orphan*/ lcd_wr_command(int);
void lcd_init() {
  lcd_port_config();
  lcd_reset();
  _delay_ms(1);
  lcd_wr_command(0x28);
  lcd_wr_command(0x01);
  lcd_wr_command(0x06);
  lcd_wr_command(0x0E);
  lcd_wr_command(0x80);
}


x86 assembly (clang, -O0):
<lcd_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <lcd_port_config@plt>
mov    $0x0,%al
call   1030 <lcd_reset@plt>
mov    $0x1,%edi
call   1050 <_delay_ms@plt>
mov    $0x28,%edi
call   1060 <lcd_wr_command@plt>
mov    $0x1,%edi
call   1060 <lcd_wr_command@plt>
mov    $0x6,%edi
call   1060 <lcd_wr_command@plt>
mov    $0xe,%edi
call   1060 <lcd_wr_command@plt>
mov    $0x80,%edi
call   1060 <lcd_wr_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_init>:
push   %rax
xor    %eax,%eax
call   1040 <lcd_port_config@plt>
xor    %eax,%eax
call   1030 <lcd_reset@plt>
mov    $0x1,%edi
call   1050 <_delay_ms@plt>
mov    $0x28,%edi
call   1060 <lcd_wr_command@plt>
mov    $0x1,%edi
call   1060 <lcd_wr_command@plt>
mov    $0x6,%edi
call   1060 <lcd_wr_command@plt>
mov    $0xe,%edi
call   1060 <lcd_wr_command@plt>
mov    $0x80,%edi
pop    %rax
jmp    1060 <lcd_wr_command@plt>

LLVM IR (-O0):
define void @lcd_init() {
%1 = call i32 (...) @lcd_port_config()
%2 = call i32 (...) @lcd_reset()
%3 = call i32 @_delay_ms(i32 1)
%4 = call i32 @lcd_wr_command(i32 40)
%5 = call i32 @lcd_wr_command(i32 1)
%6 = call i32 @lcd_wr_command(i32 6)
%7 = call i32 @lcd_wr_command(i32 14)
%8 = call i32 @lcd_wr_command(i32 128)
ret void
}

LLVM IR (-O2):
define void @lcd_init() {
%1 = tail call i32 (...) @lcd_port_config()
%2 = tail call i32 (...) @lcd_reset()
%3 = tail call i32 @_delay_ms(i32 1)
%4 = tail call i32 @lcd_wr_command(i32 40)
%5 = tail call i32 @lcd_wr_command(i32 1)
%6 = tail call i32 @lcd_wr_command(i32 6)
%7 = tail call i32 @lcd_wr_command(i32 14)
%8 = tail call i32 @lcd_wr_command(i32 128)
ret void
}
/* Variables and functions */
scalar_t__ isUpper(unsigned int);
int toLower(unsigned int c) { return (isUpper(c) ? c + ('a' - 'A') : c); }


x86 assembly (clang, -O0):
<toLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isUpper@plt>
cmp    $0x0,%rax
je     113b <toLower+0x2b>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toLower+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isUpper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toLower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isUpper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add i32 %7, 32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @toLower(i32 %0) {
%2 = tail call i64 @isUpper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
double strtod(char const *, char **);
void parse_number(const char *s, const char **end, double *num) {
  *num = strtod(s, (char **)end);
}


x86 assembly (clang, -O0):
<parse_number>:
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 <strtod@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_number>:
push   %rbx
mov    %rdx,%rbx
call   1030 <strtod@plt>
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @parse_number(i8* %0, i8** %1, double* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca double*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store double* %2, double** %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = call double @strtod(i8* %7, i8** %8)
%10 = load double*, double** %6
store double %9, double* %10
ret void
}

LLVM IR (-O2):
define void @parse_number(i8* %0, i8** nocapture %1, double* nocapture writeonly %2) {
%4 = tail call double @strtod(i8* %0, i8** %1)
store double %4, double* %2
ret void
}
/* Variables and functions */
int maxDepth(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", maxDepth(NULL));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @maxDepth(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
void *malloc(int);
void *aligned_malloc(int size) {
  void *mem = malloc(size + 64 + sizeof(void *));
  void **ptr = (void **)((long)(mem + 64 + sizeof(void *)) & ~(64 - 1));
  ptr[-1] = mem;
  return ptr;
}


x86 assembly (clang, -O0):
<aligned_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
cltq
add    $0x8,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x40,%rax
add    $0x8,%rax
and    $0xffffffffffffffc0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,-0x8(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aligned_malloc>:
push   %rax
add    $0x48,%edi
call   1030 <malloc@plt>
lea    0x48(%rax),%rcx
and    $0xffffffffffffffc0,%rcx
mov    %rax,-0x8(%rcx)
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @aligned_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8**
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 64
%7 = sext i32 %6 to i64
%8 = add i64 %7, 8
%9 = trunc i64 %8 to i32
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = getelementptr i8, i8* %11, i64 64
%13 = getelementptr i8, i8* %12, i64 8
%14 = ptrtoint i8* %13 to i64
%15 = and i64 %14, -64
%16 = inttoptr i64 %15 to i8**
store i8** %16, i8*** %4
%17 = load i8*, i8** %3
%18 = load i8**, i8*** %4
%19 = getelementptr inbounds i8*, i8** %18, i64 -1
store i8* %17, i8** %19
%20 = load i8**, i8*** %4
%21 = bitcast i8** %20 to i8*
ret i8* %21
}

LLVM IR (-O2):
define i8* @aligned_malloc(i32 %0) {
%2 = add i32 %0, 72
%3 = tail call i8* @malloc(i32 %2)
%4 = getelementptr i8, i8* %3, i64 72
%5 = ptrtoint i8* %4 to i64
%6 = and i64 %5, -64
%7 = inttoptr i64 %6 to i8**
%8 = getelementptr inbounds i8*, i8** %7, i64 -1
store i8* %3, i8** %8
%9 = inttoptr i64 %6 to i8*
ret i8* %9
}
/* Variables and functions */
int UINT_MAX;
int AlignInt8(unsigned n) { return (n + 7) & (UINT_MAX - 7); }


x86 assembly (clang, -O0):
<AlignInt8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7,%eax
mov    0x2ed4(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x7,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AlignInt8>:
lea    0x7(%rdi),%ecx
mov    0x2ede(%rip),%rax
mov    (%rax),%eax
add    $0xfffffff9,%eax
and    %ecx,%eax
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
define i32 @AlignInt8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 7
%5 = load i32, i32* @UINT_MAX
%6 = sub nsw i32 %5, 7
%7 = and i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
define i32 @AlignInt8(i32 %0) {
%2 = add i32 %0, 7
%3 = load i32, i32* @UINT_MAX
%4 = add nsw i32 %3, -7
%5 = and i32 %4, %2
ret i32 %5
}
void rl_callback_handler_remove(void) {}


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

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

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

LLVM IR (-O2):
define void @rl_callback_handler_remove() {
ret void
}
void hashmap_int_free(void *ptr) { (void)ptr; }


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

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

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

LLVM IR (-O2):
define void @hashmap_int_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void numa_free(void *mem, size_t size) { free(mem); }


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

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

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

LLVM IR (-O2):
define void @numa_free(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
};

/* Variables and functions */
int ntohl(int /*<<< orphan*/);
int pd_socket_get_ip(struct sockaddr_in *addr) {
  int ret = 0;
  if (NULL != addr) {
    ret = ntohl(addr->sin_addr.s_addr);
  }
  return ret;
}


x86 assembly (clang, -O0):
<pd_socket_get_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     113d <pd_socket_get_ip+0x2d>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_socket_get_ip>:
test   %rdi,%rdi
je     111c <pd_socket_get_ip+0xc>
mov    (%rdi),%edi
jmp    1030 <ntohl@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
define i32 @pd_socket_get_ip(%struct.sockaddr_in* %0) {
%2 = icmp eq %struct.sockaddr_in* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @ntohl(i32 %5)
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ integer;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *xmalloc(int);
char *xitoa(int integer) {
  char *string;
  string = xmalloc(sizeof(integer) * sizeof(char) / sizeof(int));
  sprintf(string, "%d", integer);
  return string;
}


x86 assembly (clang, -O0):
<xitoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xitoa>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x1,%edi
call   1030 <xmalloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @xitoa(i32 %0) {
%2 = tail call i8* @xmalloc(i32 1)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  printf("hello c\n");
  printf("hello %s\n", "world");
  printf("hello %d年\n", 2020);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x7e4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x7e4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"hello c\0A\00"
@.str.1 = [10 x i8] c"hello %s\0A\00"
@.str.2 = [6 x i8] c"world\00"
@.str.3 = [13 x i8] c"hello %d\E5\B9\B4\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 2020)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"hello %s\0A\00"
@.str.2 = [6 x i8] c"world\00"
@.str.3 = [13 x i8] c"hello %d\E5\B9\B4\0A\00"
@str = [8 x i8] c"hello c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 2020)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ raiseerr(int);
scalar_t__ send(int, char *, int, int /*<<< orphan*/);
int send_repl_len(int send_sock, char *msg, int len) {
  if (send(send_sock, msg, len, 0) < 0) {
    raiseerr(4);
    close(send_sock);
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<send_repl_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0x0,%rax
jge    1186 <send_repl_len+0x46>
mov    $0x4,%edi
call   1030 <raiseerr@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_repl_len>:
push   %rbx
mov    %edi,%ebx
xor    %ecx,%ecx
call   1040 <send@plt>
test   %rax,%rax
js     1153 <send_repl_len+0x13>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x4,%edi
call   1030 <raiseerr@plt>
mov    %ebx,%edi
call   1050 <close@plt>
xor    %edi,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
define i32 @send_repl_len(i32 %0, i8* %1, i32 %2) {
%4 = tail call i64 @send(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @raiseerr(i32 4)
%8 = tail call i32 @close(i32 %0)
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %3
ret i32 0
}
/* Type definitions */
struct table_entry {
  int dummy;
};
struct table_col {
  int dummy;
};

/* Variables and functions */
int l_unit_raw_div(struct table_col *, struct table_entry *, int, char *);
int l_unit_gib(struct table_col *col, struct table_entry *e) {
  return l_unit_raw_div(col, e, 1024 * 1024, "%.2lf");
}


x86 assembly (clang, -O0):
<l_unit_gib>:
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    $0x100000,%edx
lea    0xecc(%rip),%rcx
call   1030 <l_unit_raw_div@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_unit_gib>:
lea    0xee9(%rip),%rcx
mov    $0x100000,%edx
jmp    1030 <l_unit_raw_div@plt>

LLVM IR (-O0):
%struct.table_col = type { i32 }
%struct.table_entry = type { i32 }
@.str = [6 x i8] c"%.2lf\00"
define i32 @l_unit_gib(%struct.table_col* %0, %struct.table_entry* %1) {
%3 = alloca %struct.table_col*
%4 = alloca %struct.table_entry*
store %struct.table_col* %0, %struct.table_col** %3
store %struct.table_entry* %1, %struct.table_entry** %4
%5 = load %struct.table_col*, %struct.table_col** %3
%6 = load %struct.table_entry*, %struct.table_entry** %4
%7 = call i32 @l_unit_raw_div(%struct.table_col* %5, %struct.table_entry* %6, i32 1048576, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
%struct.table_col = type { i32 }
%struct.table_entry = type { i32 }
@.str = [6 x i8] c"%.2lf\00"
define i32 @l_unit_gib(%struct.table_col* %0, %struct.table_entry* %1) {
%3 = tail call i32 @l_unit_raw_div(%struct.table_col* %0, %struct.table_entry* %1, i32 1048576, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Type definitions */
struct udcFile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ udcSeek(struct udcFile *, unsigned long long);
void udcSeekWrap(void *file, unsigned long long offset) {
  udcSeek((struct udcFile *)file, offset);
}


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

x86 assembly (clang, -O2):
<udcSeekWrap>:
jmp    1030 <udcSeek@plt>

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

LLVM IR (-O2):
%struct.udcFile = type { i32 }
define void @udcSeekWrap(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to %struct.udcFile*
%4 = tail call i32 @udcSeek(%struct.udcFile* %3, i64 %1)
ret void
}
int xmlUCSIsKatakanaPhoneticExtensions(int code) {
  return (((code >= 0x31F0) && (code <= 0x31FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsKatakanaPhoneticExtensions>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x31f0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsKatakanaPhoneticExtensions+0x26>
cmpl   $0x31ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsKatakanaPhoneticExtensions>:
and    $0xfffffff0,%edi
xor    %eax,%eax
cmp    $0x31f0,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsKatakanaPhoneticExtensions(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 12784
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 12799
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsKatakanaPhoneticExtensions(i32 %0) {
%2 = and i32 %0, -16
%3 = icmp eq i32 %2, 12784
%4 = zext i1 %3 to i32
ret i32 %4
}
__attribute((always_)) void _NOP(void) { __asm volatile("NOP"); }


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

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

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

LLVM IR (-O2):
define void @_NOP() {
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
mallocerror() {
  printf("running out of memory\n");
  exit(1);
}


x86 assembly (clang, -O0):
<mallocerror>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<mallocerror>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"running out of memory\0A\00"
define i32 @mallocerror() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"running out of memory\00"
define i32 @mallocerror() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
double promedio(double a, double b) { return (a + b) / 2; }


x86 assembly (clang, -O0):
<promedio>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<promedio>:
addsd  %xmm1,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @promedio(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
%8 = fdiv double %7, 2.000000e+00
ret double %8
}

LLVM IR (-O2):
define double @promedio(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fmul double %3, 5.000000e-01
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void local() {
  int x = 25;
  printf("\nLa variable local x tiene un valor de %d al ingresar a la funcion "
         "local\n",
         x);
  x++;
  printf(
      "La variable local x tiene un valor de %d al salir de la funcion local\n",
      x);
}


x86 assembly (clang, -O0):
<local>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x19,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xf09(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x19,%esi
call   1030 <printf@plt>
lea    0xf21(%rip),%rdi
mov    $0x1a,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [74 x i8] c"\0ALa variable local x tiene un valor de %d al ingresar a la funcion local\0A\00"
@.str.1 = [71 x i8] c"La variable local x tiene un valor de %d al salir de la funcion local\0A\00"
define void @local() {
%1 = alloca i32
store i32 25, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [74 x i8] c"\0ALa variable local x tiene un valor de %d al ingresar a la funcion local\0A\00"
@.str.1 = [71 x i8] c"La variable local x tiene un valor de %d al salir de la funcion local\0A\00"
define void @local() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 25)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0), i32 26)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ unlink(char *);
void rdbRemoveTempFile(pid_t childpid) {
  char tmpfile[256];
  snprintf(tmpfile, 256, "temp-%d.rdb", (int)childpid);
  unlink(tmpfile);
}


x86 assembly (clang, -O0):
<rdbRemoveTempFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x100,%esi
lea    0xeb8(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdbRemoveTempFile>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"temp-%d.rdb\00"
define void @rdbRemoveTempFile(i64 %0) {
%2 = alloca i64
%3 = alloca [256 x i8]
store i64 %0, i64* %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i32
%7 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = call i32 @unlink(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"temp-%d.rdb\00"
define void @rdbRemoveTempFile(i64 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = trunc i64 %0 to i32
%5 = call i32 @snprintf(i8* %3, i32 256, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @unlink(i8* %3)
ret void
}
void H210ToAB30() {}


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

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

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

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