xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fmemopen(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int vfprintf(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int vsprintf(char *restrict s, const char *restrict format, va_list arg) {
  FILE *f = fmemopen(s, 0, 0);
  return vfprintf(f, format, arg);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <fmemopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vfprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
xor    %esi,%esi
xor    %edx,%edx
call   1030 <fmemopen@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <vfprintf@plt>

LLVM IR (-O0):
define i32 @vsprintf(i8* noalias %0, i8* noalias %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i32* @fmemopen(i8* %8, i32 0, i32 0)
store i32* %9, i32** %7
%10 = load i32*, i32** %7
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @vfprintf(i32* %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @vsprintf(i8* noalias %0, i8* noalias nocapture %1, i32 %2) {
%4 = tail call i32* @fmemopen(i8* %0, i32 0, i32 0)
%5 = tail call i32 @vfprintf(i32* %4, i8* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ FCEU_DispMessage(char *);
void FCEUD_AviStop(void) { FCEU_DispMessage("Not implemented."); }


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"Not implemented.\00"
define void @FCEUD_AviStop() {
%1 = tail call i32 @FCEU_DispMessage(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
void __libvpi_c_dummy_function() {}


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

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

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

LLVM IR (-O2):
define void @__libvpi_c_dummy_function() {
ret void
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *x;
  x = malloc(sizeof(int));
  *x = 42;
  int *y;
  y = malloc(sizeof(int));
  *y = 13;
  *x = *y;
  printf("x: %i\n", *x);
  printf("y: %i\n", *y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xd,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"x: %i\0A\00"
@.str.1 = [7 x i8] c"y: %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
store i32 42, i32* %5
%6 = call i32* @malloc(i32 4)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
store i32 13, i32* %7
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = load i32*, i32** %2
store i32 %9, i32* %10
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"x: %i\0A\00"
@.str.1 = [7 x i8] c"y: %i\0A\00"
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32* @malloc(i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 13)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *malloc_s(size_t size) {
  void *p;
  p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "Memória insuficiente\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<malloc_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <malloc_s+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_s>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <malloc_s+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Mem\C3\B3ria insuficiente\0A\00"
define i8* @malloc_s(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Mem\C3\B3ria insuficiente\0A\00"
define noalias i8* @malloc_s(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void irc_invite(char *nick, char *channel) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s %s", "INVITE", nick, channel);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_invite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    $0x1fd,%esi
lea    0xeb2(%rip),%rdx
lea    0xeb4(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_invite>:
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r9
mov    %rdi,%r8
lea    0xecb(%rip),%rdx
lea    0xecd(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s %s %s\00"
@.str.1 = [7 x i8] c"INVITE\00"
define void @irc_invite(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [509 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 509, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%11 = call i32 @net_send(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s %s %s\00"
@.str.1 = [7 x i8] c"INVITE\00"
define void @irc_invite(i8* %0, i8* %1) {
%3 = alloca [509 x i8]
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 509, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @net_send(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_array(void *array) { free(array); }


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

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

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

LLVM IR (-O2):
define void @free_array(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int acceptConnection(int s) {
  int acc_fd;
  if ((acc_fd = accept(s, NULL, 0)) == -1)
    return -1;
  else
    return acc_fd;
}


x86 assembly (clang, -O0):
<acceptConnection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <accept@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1141 <acceptConnection+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <acceptConnection+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acceptConnection>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <accept@plt>

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

LLVM IR (-O2):
define i32 @acceptConnection(i32 %0) {
%2 = tail call i32 @accept(i32 %0, i32* null, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: ninefs [options]\n\nOptions:\n"
                  "  -w WORKER number of I/O worker threads (default \"16\")\n"
                  "  -p PORT   listen on port (default \"564\")\n"
                  "  -s        map all users to the squash user\n"
                  "  -d        protocol debugging to standard error\n"
                  "  -h        show this help\n"
                  "\n");
  exit(2);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [256 x i8] c"Usage: ninefs [options]\0A\0AOptions:\0A -w WORKER number of I/O worker threads (default \2216\22)\0A -p PORT listen on port (default \22564\22)\0A -s map all users to the squash user\0A -d protocol debugging to standard error\0A -h show this help\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [256 x i8] c"Usage: ninefs [options]\0A\0AOptions:\0A -w WORKER number of I/O worker threads (default \2216\22)\0A -p PORT listen on port (default \22564\22)\0A -s map all users to the squash user\0A -d protocol debugging to standard error\0A -h show this help\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int *allocate(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *arr = allocate(sizeof(int) * 2);
  arr[0] = 1;
  arr[1] = 2;
  printf("%d \n", arr[1]);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1040 <allocate@plt>
movabs $0x200000001,%rcx
mov    %rcx,(%rax)
lea    0xec1(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = tail call i32* @allocate(i32 8)
store i32 1, i32* %1
%2 = getelementptr inbounds i32, i32* %1, i64 1
store i32 2, i32* %2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t ispowerof2(uint32_t x) { return x && !(x & (x - 1)); }


x86 assembly (clang, -O0):
<ispowerof2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <ispowerof2+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispowerof2>:
test   %edi,%edi
je     110f <ispowerof2+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ispowerof2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @ispowerof2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int /*<<< orphan*/);
uint16_t ByteSwap16(uint16_t d) { return bswap_16(d); }


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

x86 assembly (clang, -O2):
<ByteSwap16>:
jmp    1030 <bswap_16@plt>

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

LLVM IR (-O2):
define i32 @ByteSwap16(i32 %0) {
%2 = tail call i32 @bswap_16(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int mtd_write(FILE *fp, const char *mtd, int flags) { return -1; }


x86 assembly (clang, -O0):
<mtd_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mtd_write(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @mtd_write(i32* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ sFLASH_EraseSector(int);
void HAL_EEPROM_Clear() {
  sFLASH_EraseSector(0x03E000);
  sFLASH_EraseSector(0x03F000);
}


x86 assembly (clang, -O0):
<HAL_EEPROM_Clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e000,%edi
call   1030 <sFLASH_EraseSector@plt>
mov    $0x3f000,%edi
call   1030 <sFLASH_EraseSector@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HAL_EEPROM_Clear>:
push   %rax
mov    $0x3e000,%edi
call   1030 <sFLASH_EraseSector@plt>
mov    $0x3f000,%edi
pop    %rax
jmp    1030 <sFLASH_EraseSector@plt>

LLVM IR (-O0):
define void @HAL_EEPROM_Clear() {
%1 = call i32 @sFLASH_EraseSector(i32 253952)
%2 = call i32 @sFLASH_EraseSector(i32 258048)
ret void
}

LLVM IR (-O2):
define void @HAL_EEPROM_Clear() {
%1 = tail call i32 @sFLASH_EraseSector(i32 253952)
%2 = tail call i32 @sFLASH_EraseSector(i32 258048)
ret void
}
/* Variables and functions */
int mudolo(int, int);
int gcd(int first_num, int second_num) {
  if (second_num == 0) {
    return first_num;
  }
  return gcd(second_num, mudolo(first_num, second_num));
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1143 <gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <gcd+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <mudolo@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
push   %rbx
test   %esi,%esi
je     1131 <gcd+0x21>
mov    %esi,%eax
nopw   0x0(%rax,%rax,1)
mov    %eax,%ebx
mov    %eax,%esi
call   1030 <mudolo@plt>
mov    %ebx,%edi
test   %eax,%eax
jne    1120 <gcd+0x10>
jmp    1133 <gcd+0x23>
mov    %edi,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = tail call i32 @mudolo(i32 %6, i32 %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int);
ssize_t test_process_vm_readv(pid_t pid, const struct iovec *lvec,
                              unsigned long liovcnt, const struct iovec *rvec,
                              unsigned long riovcnt, unsigned long flags) {
  return syscall(-1);
}


x86 assembly (clang, -O0):
<test_process_vm_readv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0xffffffff,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_process_vm_readv>:
mov    $0xffffffff,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @test_process_vm_readv(i32 %0, %struct.iovec* %1, i64 %2, %struct.iovec* %3, i64 %4, i64 %5) {
%7 = alloca i32
%8 = alloca %struct.iovec*
%9 = alloca i64
%10 = alloca %struct.iovec*
%11 = alloca i64
%12 = alloca i64
store i32 %0, i32* %7
store %struct.iovec* %1, %struct.iovec** %8
store i64 %2, i64* %9
store %struct.iovec* %3, %struct.iovec** %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = call i32 @syscall(i32 -1)
ret i32 %13
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @test_process_vm_readv(i32 %0, %struct.iovec* nocapture readnone %1, i64 %2, %struct.iovec* nocapture readnone %3, i64 %4, i64 %5) {
%7 = tail call i32 @syscall(i32 -1)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_xor_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_xor_ps(__m128 A, __m128 B) { return _mm_xor_ps(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_xor_ps>:
jmp    1030 <_mm_xor_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_xor_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_xor_ps(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DrawMaskedBorder_DOOR_1();
int /*<<< orphan*/ DrawMaskedBorder_DOOR_2();
int /*<<< orphan*/ DrawMaskedBorder_DOOR_3();
int /*<<< orphan*/ DrawMaskedBorder_FIELD();
void DrawMaskedBorder_ALL() {
  DrawMaskedBorder_FIELD();
  DrawMaskedBorder_DOOR_1();
  DrawMaskedBorder_DOOR_2();
  DrawMaskedBorder_DOOR_3();
}


x86 assembly (clang, -O0):
<DrawMaskedBorder_ALL>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <DrawMaskedBorder_FIELD@plt>
mov    $0x0,%al
call   1050 <DrawMaskedBorder_DOOR_1@plt>
mov    $0x0,%al
call   1030 <DrawMaskedBorder_DOOR_2@plt>
mov    $0x0,%al
call   1040 <DrawMaskedBorder_DOOR_3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawMaskedBorder_ALL>:
push   %rax
xor    %eax,%eax
call   1060 <DrawMaskedBorder_FIELD@plt>
xor    %eax,%eax
call   1050 <DrawMaskedBorder_DOOR_1@plt>
xor    %eax,%eax
call   1030 <DrawMaskedBorder_DOOR_2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <DrawMaskedBorder_DOOR_3@plt>

LLVM IR (-O0):
define void @DrawMaskedBorder_ALL() {
%1 = call i32 (...) @DrawMaskedBorder_FIELD()
%2 = call i32 (...) @DrawMaskedBorder_DOOR_1()
%3 = call i32 (...) @DrawMaskedBorder_DOOR_2()
%4 = call i32 (...) @DrawMaskedBorder_DOOR_3()
ret void
}

LLVM IR (-O2):
define void @DrawMaskedBorder_ALL() {
%1 = tail call i32 (...) @DrawMaskedBorder_FIELD()
%2 = tail call i32 (...) @DrawMaskedBorder_DOOR_1()
%3 = tail call i32 (...) @DrawMaskedBorder_DOOR_2()
%4 = tail call i32 (...) @DrawMaskedBorder_DOOR_3()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
s_abort() { exit(1); }


x86 assembly (clang, -O0):
<s_abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<s_abort>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @s_abort() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @s_abort() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
int sdp_get_mp_len(unsigned char *mp) {
  return (mp[0] & 0x40) ? ((mp[2] << 8) + mp[3] + 4) : (mp[1] + 2);
}


x86 assembly (clang, -O0):
<sdp_get_mp_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     113b <sdp_get_mp_len+0x3b>
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <sdp_get_mp_len+0x49>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdp_get_mp_len>:
testb  $0x40,(%rdi)
jne    110d <sdp_get_mp_len+0xd>
movzbl 0x1(%rdi),%eax
add    $0x2,%eax
ret
movzwl 0x2(%rdi),%eax
shl    $0x10,%eax
bswap  %eax
add    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @sdp_get_mp_len(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 64
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = add nsw i32 %14, %18
%20 = add nsw i32 %19, 4
br label %27
21: ; preds = %1
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = add nsw i32 %25, 2
br label %27
27: ; preds = %21, %9
%28 = phi i32 [ %20, %9 ], [ %26, %21 ]
ret i32 %28
}

LLVM IR (-O2):
define i32 @sdp_get_mp_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 64
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 8
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
%14 = add nuw nsw i32 %13, 4
br label %20
15: ; preds = %1
%16 = getelementptr inbounds i8, i8* %0, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = add nuw nsw i32 %18, 2
br label %20
20: ; preds = %15, %5
%21 = phi i32 [ %14, %5 ], [ %19, %15 ]
ret i32 %21
}
/* Variables and functions */
void **malloc(unsigned long);
void **maketbl(unsigned long newsize) {
  unsigned long i;
  void **newtbl;
  newtbl = malloc(newsize * sizeof *newtbl);
  if (newtbl) {
    for (i = 0; i < newsize; i++)
      newtbl[i] = NULL;
  }
  return newtbl;
}


x86 assembly (clang, -O0):
<maketbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1174 <maketbl+0x64>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    116f <maketbl+0x5f>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1140 <maketbl+0x30>
jmp    1174 <maketbl+0x64>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maketbl>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0x0(,%rdi,8),%r14
mov    %r14,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1152 <maketbl+0x32>
test   %r15,%r15
je     1152 <maketbl+0x32>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8** @maketbl(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i8**
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = mul i64 %5, 8
%7 = call i8** @malloc(i64 %6)
store i8** %7, i8*** %4
%8 = load i8**, i8*** %4
%9 = icmp ne i8** %8, null
br i1 %9, label %10, label %23
10: ; preds = %1
store i64 0, i64* %3
br label %11
11: ; preds = %19, %10
%12 = load i64, i64* %3
%13 = load i64, i64* %2
%14 = icmp ult i64 %12, %13
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load i8**, i8*** %4
%17 = load i64, i64* %3
%18 = getelementptr inbounds i8*, i8** %16, i64 %17
store i8* null, i8** %18
br label %19
19: ; preds = %15
%20 = load i64, i64* %3
%21 = add i64 %20, 1
store i64 %21, i64* %3
br label %11
22: ; preds = %11
br label %23
23: ; preds = %22, %1
%24 = load i8**, i8*** %4
ret i8** %24
}

LLVM IR (-O2):
define noalias i8** @maketbl(i64 %0) {
%2 = shl i64 %0, 3
%3 = tail call i8** @malloc(i64 %2)
%4 = icmp ne i8** %3, null
%5 = icmp ne i64 %0, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = bitcast i8** %3 to i8*
br label %9
9: ; preds = %7, %1
ret i8** %3
}
/* Variables and functions */
int /*<<< orphan*/ sysCall(int, int /*<<< orphan*/, unsigned long, int);
unsigned char inbyte(void) {
  char c;
  sysCall(3, 0, (unsigned long)&c, 1);
  return c;
}


x86 assembly (clang, -O0):
<inbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdx
mov    $0x3,%edi
xor    %esi,%esi
mov    $0x1,%ecx
call   1030 <sysCall@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inbyte>:
push   %rax
lea    0x7(%rsp),%rdx
mov    $0x3,%edi
xor    %esi,%esi
mov    $0x1,%ecx
call   1030 <sysCall@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @inbyte() {
%1 = alloca i8
%2 = ptrtoint i8* %1 to i64
%3 = call i32 @sysCall(i32 3, i32 0, i64 %2, i32 1)
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @inbyte() {
%1 = alloca i8
%2 = ptrtoint i8* %1 to i64
%3 = call i32 @sysCall(i32 3, i32 0, i64 %2, i32 1)
%4 = load i8, i8* %1
ret i8 %4
}
void ff_hevc_put_hevc_pel_pixels16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels16_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dummy_call();
int main() {
  dummy_call();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @dummy_call()
ret i32 0
}
/* Variables and functions */
scalar_t__ tolower(unsigned char);
void tolower_string(char *str) {
  for (; *str != '\0'; str++)
    *str = (char)tolower((unsigned char)*str);
}


x86 assembly (clang, -O0):
<tolower_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <tolower_string+0x41>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <tolower_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <tolower_string+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <tolower_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @tolower_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i64 @tolower(i8 zeroext %5)
%8 = trunc i64 %7 to i8
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t USBDMAChannelIntStatus(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x40050000);
  return ((*((volatile uint32_t *)(ui32Base + 0x00000200))));
}


x86 assembly (clang, -O0):
<USBDMAChannelIntStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x200,%eax
cltq
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDMAChannelIntStatus>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x200(%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @USBDMAChannelIntStatus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074069504
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 512
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @USBDMAChannelIntStatus(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 512
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int choiceSelector() {
  int ch;
  printf("Enter your choice : ");
  scanf("%d", &ch);
  return ch;
}


x86 assembly (clang, -O0):
<choiceSelector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choiceSelector>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter your choice : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @choiceSelector() {
%1 = alloca i32
%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 ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [21 x i8] c"Enter your choice : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @choiceSelector() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
scalar_t__ my_strverscmp(char const *, char *);
const char *ykpiv_check_version(const char *req_version) {
  if (!req_version || my_strverscmp(req_version, "1.4.2") <= 0)
    return "1.4.2";
  return NULL;
}


x86 assembly (clang, -O0):
<ykpiv_check_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1141 <ykpiv_check_version+0x31>
mov    -0x10(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <my_strverscmp@plt>
cmp    $0x0,%rax
jg     1151 <ykpiv_check_version+0x41>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <ykpiv_check_version+0x49>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ykpiv_check_version>:
test   %rdi,%rdi
je     1133 <ykpiv_check_version+0x23>
push   %rbx
lea    0xee3(%rip),%rbx
mov    %rbx,%rsi
call   1030 <my_strverscmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
cmovle %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rax
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"1.4.2\00"
define i8* @ykpiv_check_version(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @my_strverscmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp slt i64 %4, 1
%6 = select i1 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* null
br label %7
7: ; preds = %3, %1
%8 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %1 ], [ %6, %3 ]
ret i8* %8
}
/* Variables and functions */
int mktemp_internal(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                    int /*<<< orphan*/);
char *_mktemp(char *path) {
  if (mktemp_internal(path, 0, 0, 0) == -1)
    return (NULL);
  return (path);
}


x86 assembly (clang, -O0):
<_mktemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <mktemp_internal@plt>
cmp    $0xffffffff,%eax
jne    1141 <_mktemp+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1149 <_mktemp+0x39>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mktemp>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <mktemp_internal@plt>
cmp    $0xffffffff,%eax
cmovne %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_mktemp(i8* %0) {
%2 = tail call i32 @mktemp_internal(i8* %0, i32 0, i32 0, i32 0)
%3 = icmp eq i32 %2, -1
%4 = select i1 %3, i8* null, i8* %0
ret i8* %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
void set_XButtonPressedEvent_x(void *_p, int _v) {
  ((XButtonPressedEvent *)_p)->x = (int)_v;
}


x86 assembly (clang, -O0):
<set_XButtonPressedEvent_x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XButtonPressedEvent_x>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonPressedEvent_x(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonPressedEvent_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void c_intface__(int *i) { fprintf(stdout, "f77IsF2C\n"); }


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

x86 assembly (clang, -O2):
<c_intface__>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"f77IsF2C\0A\00"
define void @c_intface__(i32* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ insertion(int *, int);
int main() {
  int *a;
  int N = __VERIFIER_nondet_int();
  insertion(a, N);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @insertion(i32* undef, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dbg_write(unsigned long const);
void dbg_write_u32(const unsigned long *val, long len) {
  dbg_write((0x01 | ((4 & 0xff) << 8)) | ((len & 0xffff) << 16));
  while (len > 0) {
    dbg_write(*val);
    val++;
    len--;
  }
}


x86 assembly (clang, -O0):
<dbg_write_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
and    $0xffff,%rdi
shl    $0x10,%rdi
or     $0x401,%rdi
call   1030 <dbg_write@plt>
cmpq   $0x0,-0x10(%rbp)
jle    116f <dbg_write_u32+0x5f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <dbg_write@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    113b <dbg_write_u32+0x2b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_write_u32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %ebx,%edi
shl    $0x10,%edi
or     $0x401,%rdi
call   1030 <dbg_write@plt>
test   %rbx,%rbx
jle    1156 <dbg_write_u32+0x46>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14),%rdi
call   1030 <dbg_write@plt>
add    $0x8,%r14
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1140 <dbg_write_u32+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @dbg_write_u32(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 65535
%7 = shl i64 %6, 16
%8 = or i64 1025, %7
%9 = call i32 @dbg_write(i64 %8)
br label %10
10: ; preds = %13, %2
%11 = load i64, i64* %4
%12 = icmp sgt i64 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load i64*, i64** %3
%15 = load i64, i64* %14
%16 = call i32 @dbg_write(i64 %15)
%17 = load i64*, i64** %3
%18 = getelementptr inbounds i64, i64* %17, i32 1
store i64* %18, i64** %3
%19 = load i64, i64* %4
%20 = add nsw i64 %19, -1
store i64 %20, i64* %4
br label %10
21: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @dbg_write_u32(i64* nocapture %0, i64 %1) {
%3 = shl i64 %1, 16
%4 = and i64 %3, 4294901760
%5 = or i64 %4, 1025
%6 = tail call i32 @dbg_write(i64 %5)
%7 = icmp sgt i64 %1, 0
br i1 %7, label %8, label %16
8: ; preds = %2, %8
%9 = phi i64 [ %14, %8 ], [ %1, %2 ]
%10 = phi i64* [ %13, %8 ], [ %0, %2 ]
%11 = load i64, i64* %10
%12 = tail call i32 @dbg_write(i64 %11)
%13 = getelementptr inbounds i64, i64* %10, i64 1
%14 = add nsw i64 %9, -1
%15 = icmp ugt i64 %9, 1
br i1 %15, label %8, label %16
16: ; preds = %8, %2
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t right_rot(uint32_t value, unsigned int count) {
  return value >> count | value << (32 - count);
}


x86 assembly (clang, -O0):
<right_rot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_rot>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @right_rot(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @right_rot(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}