xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ft_free(void **ptr) {
  if (*ptr) {
    free(*ptr);
    *ptr = NULL;
  }
}


x86 assembly (clang, -O0):
<ft_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <ft_free+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <ft_free+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *zipmapLookupRaw(unsigned char *, unsigned char *,
                                    unsigned int, int /*<<< orphan*/ *);
int zipmapExists(unsigned char *zm, unsigned char *key, unsigned int klen) {
  return zipmapLookupRaw(zm, key, klen, NULL) != NULL;
}


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

x86 assembly (clang, -O2):
<zipmapExists>:
push   %rax
xor    %ecx,%ecx
call   1030 <zipmapLookupRaw@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @zipmapExists(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32* @zipmapLookupRaw(i8* %7, i8* %8, i32 %9, i32* null)
%11 = icmp ne i32* %10, null
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @zipmapExists(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32* @zipmapLookupRaw(i8* %0, i8* %1, i32 %2, i32* null)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
void *malloc(size_t);
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t newsize) {
  if (p == NULL) {
    return malloc(newsize);
  }
  return realloc(p, newsize);
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <xrealloc+0x2d>
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    115e <xrealloc+0x3e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
test   %rdi,%rdi
je     112a <xrealloc+0xa>
jmp    1040 <realloc@plt>
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @malloc(i64 %1)
br label %8
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i64 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
ret i8* %9
}
/* Variables and functions */
char *GetEnv(char *, int /*<<< orphan*/);
char *homedir(void) {
  char *home;
  home = GetEnv("CURL_HOME", 0);
  if (home)
    return home;
  home = GetEnv("HOME", 0);
  if (home)
    return home;
  return home;
}


x86 assembly (clang, -O0):
<homedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
xor    %esi,%esi
call   1030 <GetEnv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1142 <homedir+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <homedir+0x64>
lea    0xebc(%rip),%rdi
xor    %esi,%esi
call   1030 <GetEnv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116c <homedir+0x5c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <homedir+0x64>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<homedir>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <GetEnv@plt>
test   %rax,%rax
je     1126 <homedir+0x16>
pop    %rcx
ret
lea    0xed8(%rip),%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <GetEnv@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"CURL_HOME\00"
@.str.1 = [5 x i8] c"HOME\00"
define i8* @homedir() {
%1 = tail call i8* @GetEnv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i8* @GetEnv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %5
5: ; preds = %3, %0
%6 = phi i8* [ %1, %0 ], [ %4, %3 ]
ret i8* %6
}
__attribute__((always_)) void unlock_vector_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @unlock_vector_lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
void test(const char *input) {
  char buf[10];
  strcpy(buf, input);
  printf("%s \n", buf);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x12(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
define void @test(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
void keyspaceEventsStringToFlags(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               82, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<keyspaceEventsStringToFlags>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x52,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyspaceEventsStringToFlags>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x52,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.keyspaceEventsStringToFlags = [28 x i8] c"keyspaceEventsStringToFlags\00"
define void @keyspaceEventsStringToFlags() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 82, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__func__.keyspaceEventsStringToFlags, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.keyspaceEventsStringToFlags = [28 x i8] c"keyspaceEventsStringToFlags\00"
define void @keyspaceEventsStringToFlags() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 82, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__func__.keyspaceEventsStringToFlags, i64 0, i64 0))
ret void
}
/* Variables and functions */
int containsNearbyAlmostDuplicate(int *, int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x[] = {-1, 2147483647};
  printf("%d\n", containsNearbyAlmostDuplicate(x, 2, 1, 2147483647));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x7fffffff,%ecx
call   1040 <containsNearbyAlmostDuplicate@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x7fffffff,%ecx
call   1040 <containsNearbyAlmostDuplicate@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 9223372036854775807, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @containsNearbyAlmostDuplicate(i32* %3, i32 2, i32 1, i32 2147483647)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int xmount(char *spec, char *dir, int rwflag) {
  printf("mount() not implemented\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<xmount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [25 x i8] c"mount() not implemented\0A\00"
define i32 @xmount(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"mount() not implemented\00"
define i32 @xmount(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
int usleep(int);
int iotMsleep(const char *who, int msec) {
  printf("Function '%s' sleeps for %d msec\n", who, msec);
  return usleep(msec * 1000);
}


x86 assembly (clang, -O0):
<iotMsleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
imul   $0x3e8,-0xc(%rbp),%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iotMsleep>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
imul   $0x3e8,%ebx,%edi
pop    %rbx
jmp    1040 <usleep@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Function '%s' sleeps for %d msec\0A\00"
define i32 @iotMsleep(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 1000
%10 = call i32 @usleep(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [34 x i8] c"Function '%s' sleeps for %d msec\0A\00"
define i32 @iotMsleep(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = mul nsw i32 %1, 1000
%5 = tail call i32 @usleep(i32 %4)
ret i32 %5
}
/* Variables and functions */
scalar_t__ isrunning();
int /*<<< orphan*/ keyup(char *);
int /*<<< orphan*/ togglecont();
int /*<<< orphan*/ typestr(char *);
void cpu_cont(void) {
  typestr("<CONT>\r\n");
  if (isrunning())
    return;
  keyup("STOP");
  togglecont();
}


x86 assembly (clang, -O0):
<cpu_cont>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1050 <typestr@plt>
mov    $0x0,%al
call   1040 <isrunning@plt>
cmp    $0x0,%rax
je     1166 <cpu_cont+0x26>
jmp    1179 <cpu_cont+0x39>
lea    0xe9c(%rip),%rdi
call   1060 <keyup@plt>
mov    $0x0,%al
call   1030 <togglecont@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_cont>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <typestr@plt>
xor    %eax,%eax
call   1040 <isrunning@plt>
test   %rax,%rax
je     115b <cpu_cont+0x1b>
pop    %rax
ret
lea    0xea7(%rip),%rdi
call   1060 <keyup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <togglecont@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"<CONT>\0D\0A\00"
@.str.1 = [5 x i8] c"STOP\00"
define void @cpu_cont() {
%1 = call i32 @typestr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i64 (...) @isrunning()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %8
5: ; preds = %0
%6 = call i32 @keyup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @togglecont()
br label %8
8: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"<CONT>\0D\0A\00"
@.str.1 = [5 x i8] c"STOP\00"
define void @cpu_cont() {
%1 = tail call i32 @typestr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 (...) @isrunning()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @keyup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @togglecont()
br label %7
7: ; preds = %0, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_close_allv() {
  printf("NOT IMPLEMENTED:"
         "pa_close_allv"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_close_allv\0A\00"
define i32 @pa_close_allv() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_close_allv\00"
define i32 @pa_close_allv() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
unsigned long long ff(unsigned long long a) {
  return a & 0x0000000000ffffffull;
}


x86 assembly (clang, -O0):
<ff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff>:
mov    %rdi,%rax
and    $0xffffff,%eax
ret

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

LLVM IR (-O2):
define i64 @ff(i64 %0) {
%2 = and i64 %0, 16777215
ret i64 %2
}
/* Variables and functions */
int strcmp(char const *, char const *);
int a_strcmp(const char *a, const char *b) {
  return strcmp((a ? a : ""), (b ? b : ""));
}


x86 assembly (clang, -O0):
<a_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <a_strcmp+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <a_strcmp+0x38>
lea    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <a_strcmp+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <a_strcmp+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1178 <a_strcmp+0x68>
lea    0xe91(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1178 <a_strcmp+0x68>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_strcmp>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
cmove  %rax,%rdi
test   %rsi,%rsi
cmove  %rax,%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @a_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i8*, i8** %3
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi i8* [ %8, %7 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %9 ]
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i8*, i8** %4
br label %17
16: ; preds = %10
br label %17
17: ; preds = %16, %14
%18 = phi i8* [ %15, %14 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %16 ]
%19 = call i32 @strcmp(i8* %11, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @a_strcmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%5 = icmp eq i8* %1, null
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void cpu_halt(void) { __asm__ __volatile__("hlt"); }


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

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

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

LLVM IR (-O2):
define void @cpu_halt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vector_nd_free(void **, int *, int);
void vector_2d_free(void **ptr, int d1, int d2) {
  int dims[2];
  dims[0] = d1;
  dims[1] = d2;
  vector_nd_free(ptr, dims, 2);
}


x86 assembly (clang, -O0):
<vector_2d_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x2,%edx
call   1030 <vector_nd_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_2d_free>:
push   %rax
mov    %esi,(%rsp)
mov    %edx,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edx
call   1030 <vector_nd_free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @vector_2d_free(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x i32]
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 %8, i32* %9
%10 = load i32, i32* %6
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 %10, i32* %11
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%14 = call i32 @vector_nd_free(i8** %12, i32* %13, i32 2)
ret void
}

LLVM IR (-O2):
define void @vector_2d_free(i8** %0, i32 %1, i32 %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %1, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %2, i32* %7
%8 = call i32 @vector_nd_free(i8** %0, i32* %6, i32 2)
ret void
}
/* Variables and functions */
int f240(int *);
int f241(int *p) { return f240(p); }


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

x86 assembly (clang, -O2):
<f241>:
jmp    1030 <f240@plt>

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

LLVM IR (-O2):
define i32 @f241(i32* %0) {
%2 = tail call i32 @f240(i32* %0)
ret i32 %2
}
int isprint(int ch) { return ch >= 0x20 && ch <= 0x7E; }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint+0x20>
cmpl   $0x7e,-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):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
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 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct unpacked_tlv {
  int dummy;
};
struct packed_tlv {
  int dummy;
};

/* Variables and functions */
struct unpacked_tlv *bld_end_tlv();
int /*<<< orphan*/ free(struct unpacked_tlv *);
struct packed_tlv *pack_tlv(struct unpacked_tlv *);
struct packed_tlv *pack_end_tlv() {
  struct unpacked_tlv *tlv;
  struct packed_tlv *ptlv;
  tlv = bld_end_tlv();
  ptlv = pack_tlv(tlv);
  free(tlv);
  return ptlv;
}


x86 assembly (clang, -O0):
<pack_end_tlv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <bld_end_tlv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <pack_tlv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_end_tlv>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <bld_end_tlv@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <pack_tlv@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.packed_tlv = type { i32 }
%struct.unpacked_tlv = type { i32 }
define %struct.packed_tlv* @pack_end_tlv() {
%1 = alloca %struct.unpacked_tlv*
%2 = alloca %struct.packed_tlv*
%3 = call %struct.unpacked_tlv* (...) @bld_end_tlv()
store %struct.unpacked_tlv* %3, %struct.unpacked_tlv** %1
%4 = load %struct.unpacked_tlv*, %struct.unpacked_tlv** %1
%5 = call %struct.packed_tlv* @pack_tlv(%struct.unpacked_tlv* %4)
store %struct.packed_tlv* %5, %struct.packed_tlv** %2
%6 = load %struct.unpacked_tlv*, %struct.unpacked_tlv** %1
%7 = call i32 @free(%struct.unpacked_tlv* %6)
%8 = load %struct.packed_tlv*, %struct.packed_tlv** %2
ret %struct.packed_tlv* %8
}

LLVM IR (-O2):
%struct.packed_tlv = type { i32 }
%struct.unpacked_tlv = type { i32 }
define %struct.packed_tlv* @pack_end_tlv() {
%1 = tail call %struct.unpacked_tlv* (...) @bld_end_tlv()
%2 = tail call %struct.packed_tlv* @pack_tlv(%struct.unpacked_tlv* %1)
%3 = tail call i32 @free(%struct.unpacked_tlv* %1)
ret %struct.packed_tlv* %2
}
int xc6_bit2pin(int bit) {
  int pin = bit % (2 * 8);
  if (pin >= 8)
    return 15 - (pin - 8);
  return 7 - pin;
}


x86 assembly (clang, -O0):
<xc6_bit2pin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jl     1134 <xc6_bit2pin+0x34>
mov    -0xc(%rbp),%ecx
sub    $0x8,%ecx
mov    $0xf,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <xc6_bit2pin+0x3f>
mov    $0x7,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xc6_bit2pin>:
lea    0xf(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff0,%eax
sub    %eax,%edi
xor    %eax,%eax
cmp    $0x8,%edi
setge  %al
shl    $0x4,%eax
sub    %edi,%eax
add    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @xc6_bit2pin(i32 %0) {
%2 = srem i32 %0, 16
%3 = icmp sgt i32 %2, 7
%4 = select i1 %3, i32 23, i32 7
%5 = sub nsw i32 %4, %2
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *display;
};
struct TYPE_4__ {
  TYPE_1__ xcolormap;
};
typedef TYPE_2__ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XEvent_xcolormap_display(void *_p, void *_v) {
  ((XEvent *)_p)->xcolormap.display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xcolormap_display>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xcolormap_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
void rop3_242_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = *D & stk3;
  stk1 = T | stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_242_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_242_1_0>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
and    %sil,%r8b
mov    %esi,%eax
not    %al
and    %al,%cl
or     %dl,%cl
and    %al,%cl
or     %r8b,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_242_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = and i32 %35, %37
%39 = or i32 %32, %38
%40 = trunc i32 %39 to i8
%41 = load i8*, i8** %4
store i8 %40, i8* %41
ret void
}

LLVM IR (-O2):
define void @rop3_242_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = or i8 %6, %2
%8 = and i8 %5, %1
%9 = and i8 %7, %4
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ des_dec(void *, void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ des_enc(void *, void *, int /*<<< orphan*/ *);
void tdes_enc(void *out, void *in, const void *key) {
  des_enc(out, in, (uint8_t *)key + 0);
  des_dec(out, out, (uint8_t *)key + 8);
  des_enc(out, out, (uint8_t *)key + 16);
}


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

x86 assembly (clang, -O2):
<tdes_enc>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <des_enc@plt>
lea    0x20(%r14),%rdx
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1040 <des_dec@plt>
add    $0x40,%r14
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <des_enc@plt>

LLVM IR (-O0):
define void @tdes_enc(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i32*
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = call i32 @des_enc(i8* %7, i8* %8, i32* %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %4
%15 = load i8*, i8** %6
%16 = bitcast i8* %15 to i32*
%17 = getelementptr inbounds i32, i32* %16, i64 8
%18 = call i32 @des_dec(i8* %13, i8* %14, i32* %17)
%19 = load i8*, i8** %4
%20 = load i8*, i8** %4
%21 = load i8*, i8** %6
%22 = bitcast i8* %21 to i32*
%23 = getelementptr inbounds i32, i32* %22, i64 16
%24 = call i32 @des_enc(i8* %19, i8* %20, i32* %23)
ret void
}

LLVM IR (-O2):
define void @tdes_enc(i8* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @des_enc(i8* %0, i8* %1, i32* %4)
%6 = getelementptr inbounds i8, i8* %2, i64 32
%7 = bitcast i8* %6 to i32*
%8 = tail call i32 @des_dec(i8* %0, i8* %0, i32* %7)
%9 = getelementptr inbounds i8, i8* %2, i64 64
%10 = bitcast i8* %9 to i32*
%11 = tail call i32 @des_enc(i8* %0, i8* %0, i32* %10)
ret void
}
/* Variables and functions */
int strtol(char *, int /*<<< orphan*/ *, int);
int hex2num(char *str) {
  if (str == NULL)
    return 0;
  return strtol(str, NULL, 16);
}


x86 assembly (clang, -O0):
<hex2num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <hex2num+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1148 <hex2num+0x38>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2num>:
test   %rdi,%rdi
je     1121 <hex2num+0x11>
xor    %esi,%esi
mov    $0x10,%edx
jmp    1030 <strtol@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hex2num(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 16)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void do_get_packet() {}


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

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

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

LLVM IR (-O2):
define void @do_get_packet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parser_Abort(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void parser_Expected(char *s) {
  char ss[200];
  sprintf(ss, "%s esperado.", s);
  parser_Abort(ss);
}


x86 assembly (clang, -O0):
<parser_Expected>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <parser_Abort@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_Expected>:
push   %rbx
sub    $0xd0,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <parser_Abort@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s esperado.\00"
define void @parser_Expected(i8* %0) {
%2 = alloca i8*
%3 = alloca [200 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%8 = call i32 @parser_Abort(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s esperado.\00"
define void @parser_Expected(i8* %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @parser_Abort(i8* %3)
ret void
}
int of_open_args(const char *node_name, const char *in_args) {
  struct {
    const char *name;
    int num_args;
    int num_returns;
    const char *node_name;
    const char *args;
    int handle;
  } args;
  args.name = "open";
  args.num_args = 2;
  args.num_returns = 1;
  args.node_name = node_name;
  args.args = in_args;
  of(&args);
  return args.handle;
}


x86 assembly (clang, -O0):
<of_open_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x2,-0x30(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x38(%rbp),%rdi
mov    $0x0,%al
call   1030 <of@plt>
mov    -0x18(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<of_open_args>:
sub    $0x28,%rsp
lea    0xee5(%rip),%rax
mov    %rax,(%rsp)
movabs $0x100000002,%rax
mov    %rax,0x8(%rsp)
mov    %rdi,0x10(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <of@plt>
mov    0x20(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i32, i32, i8*, i8*, i32 }
@.str = [5 x i8] c"open\00"
define i32 @of_open_args(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.anon
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 1
store i32 2, i32* %7
%8 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 2
store i32 1, i32* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 3
store i8* %9, i8** %10
%11 = load i8*, i8** %4
%12 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 4
store i8* %11, i8** %12
%13 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @of to i32 (%struct.anon*, ...)*)(%struct.anon* %5)
%14 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 5
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
%struct.anon = type { i8*, i32, i32, i8*, i8*, i32 }
@.str = [5 x i8] c"open\00"
define i32 @of_open_args(i8* %0, i8* %1) {
%3 = alloca %struct.anon
%4 = bitcast %struct.anon* %3 to i8*
%5 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 1
store i32 2, i32* %6
%7 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 2
store i32 1, i32* %7
%8 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 3
store i8* %0, i8** %8
%9 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 4
store i8* %1, i8** %9
%10 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @of to i32 (%struct.anon*, ...)*)(%struct.anon* %3)
%11 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 5
%12 = load i32, i32* %11
ret i32 %12
}
void __mp_reinit(void) {}


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

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

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

LLVM IR (-O2):
define void @__mp_reinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void five(const int *x, const int *y) {
  if (*x == *y)
    printf("x and y are equal.\n");
  else
    printf("x and y are different.\n");
}


x86 assembly (clang, -O0):
<five>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    1143 <five+0x33>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <five+0x3f>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<five>:
mov    (%rdi),%eax
cmp    (%rsi),%eax
lea    0xefc(%rip),%rax
lea    0xede(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"x and y are equal.\0A\00"
@.str.1 = [24 x i8] c"x and y are different.\0A\00"
define void @five(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp eq i32 %6, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"x and y are different.\00"
@str.2 = [19 x i8] c"x and y are equal.\00"
define void @five(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
%6 = select i1 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ sys_wait4(int /*<<< orphan*/, int *, int,
                             int /*<<< orphan*/);
pid_t sys_waitpid(pid_t pid, int *status, int options) {
  return sys_wait4(pid, status, options, 0);
}


x86 assembly (clang, -O0):
<sys_waitpid>:
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   1030 <sys_wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_waitpid>:
xor    %ecx,%ecx
jmp    1030 <sys_wait4@plt>

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

LLVM IR (-O2):
define i32 @sys_waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @sys_wait4(i32 %0, i32* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
long syscall(int);
long get_barrier_syscall(void) { return syscall(337); }


x86 assembly (clang, -O0):
<get_barrier_syscall>:
push   %rbp
mov    %rsp,%rbp
mov    $0x151,%edi
call   1030 <syscall@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @get_barrier_syscall() {
%1 = call i64 @syscall(i32 337)
ret i64 %1
}

LLVM IR (-O2):
define i64 @get_barrier_syscall() {
%1 = tail call i64 @syscall(i32 337)
ret i64 %1
}
int decode_verify(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @decode_verify() {
ret i32 0
}
void RSunload(void) {}


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

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

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

LLVM IR (-O2):
define void @RSunload() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int a = 3;
  float b = 4.5;
  double c = 5.25;
  float sum;
  sum = (a + b + c);
  printf("The sum of a, b, and c is %f.", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movss  0xeda(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"The sum of a, b, and c is %f.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca double
%5 = alloca float
store i32 0, i32* %1
store i32 3, i32* %2
store float 4.500000e+00, float* %3
store double 5.250000e+00, double* %4
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to float
%8 = load float, float* %3
%9 = fadd float %7, %8
%10 = fpext float %9 to double
%11 = load double, double* %4
%12 = fadd double %10, %11
%13 = fptrunc double %12 to float
store float %13, float* %5
%14 = load float, float* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), float %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"The sum of a, b, and c is %f.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), float 1.275000e+01)
ret i32 0
}