xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ db_query(char *, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ perror(char *);
int db_create() {
  char *sql = "CREATE TABLE IF NOT EXISTS Quotes(              'id' INTEGER "
              "PRIMARY KEY AUTOINCREMENT NOT NULL,              'quote' TEXT);";
  if (db_query(sql, 12) != 0) {
    perror("Can't create db table");
    free(sql);
    return 34;
  }
  return 0;
}


x86 assembly (clang, -O0):
<db_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xc,%esi
call   1050 <db_query@plt>
cmp    $0x0,%rax
je     117c <db_create+0x4c>
lea    0xf1b(%rip),%rdi
call   1040 <perror@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x22,-0x4(%rbp)
jmp    1183 <db_create+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_create>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0xc,%esi
call   1050 <db_query@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    114e <db_create+0x1e>
pop    %rcx
ret
lea    0xf28(%rip),%rdi
call   1040 <perror@plt>
lea    0xe9f(%rip),%rdi
call   1030 <free@plt>
mov    $0x22,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [125 x i8] c"CREATE TABLE IF NOT EXISTS Quotes( 'id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 'quote' TEXT);\00"
@.str.1 = [22 x i8] c"Can't create db table\00"
define i32 @db_create() {
%1 = alloca i32
%2 = alloca i8*
store i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @db_query(i8* %3, i32 12)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
store i32 34, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [125 x i8] c"CREATE TABLE IF NOT EXISTS Quotes( 'id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 'quote' TEXT);\00"
@.str.1 = [22 x i8] c"Can't create db table\00"
define i32 @db_create() {
%1 = tail call i64 @db_query(i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @free(i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ 34, %3 ], [ 0, %0 ]
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
size_t aes_getwritecount();
uint32_t aescnt_checkwrite() {
  size_t ret = aes_getwritecount();
  return (ret > 0xF);
}


x86 assembly (clang, -O0):
<aescnt_checkwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <aes_getwritecount@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0xf,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aescnt_checkwrite>:
push   %rax
xor    %eax,%eax
call   1030 <aes_getwritecount@plt>
xor    %ecx,%ecx
cmp    $0x10,%rax
setae  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @aescnt_checkwrite() {
%1 = alloca i64
%2 = call i64 (...) @aes_getwritecount()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp ugt i64 %3, 15
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @aescnt_checkwrite() {
%1 = tail call i64 (...) @aes_getwritecount()
%2 = icmp ugt i64 %1, 15
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ekg_oom_handler();
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *xmalloc(size_t size) {
  void *tmp = malloc(size);
  if (!tmp)
    ekg_oom_handler();
  memset(tmp, 0, size);
  return tmp;
}


x86 assembly (clang, -O0):
<xmalloc>:
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    115b <xmalloc+0x2b>
mov    $0x0,%al
call   1050 <ekg_oom_handler@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <xmalloc+0x1b>
xor    %eax,%eax
call   1050 <ekg_oom_handler@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xmalloc(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 ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @ekg_oom_handler()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = load i64, i64* %2
%13 = call i32 @memset(i8* %11, i32 0, i64 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @ekg_oom_handler()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
int primitiveTypes() {
  int age = 40;
  double gpa = 3.6;
  char grade = 'A';
  char phrase[] = "Giraffe Academy";
  return 0;
}


x86 assembly (clang, -O0):
<primitiveTypes>:
push   %rbp
mov    %rsp,%rbp
movl   $0x28,-0x4(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movb   $0x41,-0x11(%rbp)
mov    0xeed(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.primitiveTypes.phrase = [16 x i8] c"Giraffe Academy\00"
define i32 @primitiveTypes() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i8
%4 = alloca [16 x i8]
store i32 40, i32* %1
store double 3.600000e+00, double* %2
store i8 65, i8* %3
%5 = bitcast [16 x i8]* %4 to i8*
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ nrf_802154_transmitted_raw(int /*<<< orphan*/ const *,
                                              int /*<<< orphan*/ *,
                                              int /*<<< orphan*/,
                                              int /*<<< orphan*/);
void nrf_802154_notify_transmitted(const uint8_t *p_frame, uint8_t *p_ack,
                                   int8_t power, int8_t lqi) {
  nrf_802154_transmitted_raw(p_frame, p_ack, power, lqi);
}


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

x86 assembly (clang, -O2):
<nrf_802154_notify_transmitted>:
jmp    1030 <nrf_802154_transmitted_raw@plt>

LLVM IR (-O0):
define void @nrf_802154_notify_transmitted(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @nrf_802154_transmitted_raw(i32* %9, i32* %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @nrf_802154_notify_transmitted(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @nrf_802154_transmitted_raw(i32* %0, i32* %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void valstr_version() {
  puts("@"
       "(#)"
       "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
       "2022-01-22/02-19-57/repos/PawelNabe/EOS/refs/heads/master/SRC/valstr.c"
       " "
       "Sat Jan 22 08:19:10 2022"
       " compiled: "
       "Mar 15 2022"
       " "
       "22:47:49");
}


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

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

LLVM IR (-O0):
@.str = [195 x i8] c"@(#)/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PawelNabe/EOS/refs/heads/master/SRC/valstr.c Sat Jan 22 08:19:10 2022 compiled: Mar 15 2022 22:47:49\00"
define void @valstr_version() {
%1 = call i32 @puts(i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [195 x i8] c"@(#)/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PawelNabe/EOS/refs/heads/master/SRC/valstr.c Sat Jan 22 08:19:10 2022 compiled: Mar 15 2022 22:47:49\00"
define void @valstr_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([195 x i8], [195 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_B1int64_lowword_reg(long long val) {
  return ((val) & (0xB1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B1int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xb1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B1int64_lowword_reg>:
test   $0xb1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B1int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 177
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_B1int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 177
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ get_alphabetic_length(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, len = 0;
  for (i = 1; i <= 1000; i++) {
    len += get_alphabetic_length(i);
  }
  printf("\ntotal length: %d\n", len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jg     116d <main+0x4d>
mov    -0x8(%rbp),%edi
call   1030 <get_alphabetic_length@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <get_alphabetic_length@plt>
add    %eax,%ebx
add    $0x1,%ebp
cmp    $0x3e9,%ebp
jne    1130 <main+0x10>
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0Atotal length: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 1, i32* %2
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 1000
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i64 @get_alphabetic_length(i32 %8)
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %3
br label %14
14: ; preds = %7
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %4
17: ; preds = %4
%18 = load i32, i32* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0Atotal length: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i32 [ 1, %0 ], [ %7, %1 ]
%4 = tail call i64 @get_alphabetic_length(i32 %3)
%5 = trunc i64 %4 to i32
%6 = add i32 %2, %5
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 1001
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int pf_socket();
int pf_socket_dgram();
int pf_socket_type(uint32_t type) {
  switch (type) {
  case 113:
    return pf_socket_dgram();
  default:
    return pf_socket();
  }
}


x86 assembly (clang, -O0):
<pf_socket_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x71,%eax
jne    114b <pf_socket_type+0x2b>
jmp    113c <pf_socket_type+0x1c>
mov    $0x0,%al
call   1040 <pf_socket_dgram@plt>
mov    %eax,-0x4(%rbp)
jmp    1155 <pf_socket_type+0x35>
mov    $0x0,%al
call   1030 <pf_socket@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pf_socket_type>:
xor    %eax,%eax
cmp    $0x71,%edi
jne    112c <pf_socket_type+0xc>
jmp    1040 <pf_socket_dgram@plt>
jmp    1030 <pf_socket@plt>

LLVM IR (-O0):
define i32 @pf_socket_type(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 113, label %5
]
5: ; preds = %1
%6 = call i32 (...) @pf_socket_dgram()
store i32 %6, i32* %2
br label %9
7: ; preds = %1
%8 = call i32 (...) @pf_socket()
store i32 %8, i32* %2
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @pf_socket_type(i32 %0) {
%2 = icmp eq i32 %0, 113
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @pf_socket_dgram()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @pf_socket()
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Type definitions */
struct mainwindow {
  int dummy;
};

/* Variables and functions */
int catchup_feed(struct mainwindow *);
int handle_catchup_feed(struct mainwindow *mw) { return catchup_feed(mw); }


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

x86 assembly (clang, -O2):
<handle_catchup_feed>:
jmp    1030 <catchup_feed@plt>

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

LLVM IR (-O2):
%struct.mainwindow = type { i32 }
define i32 @handle_catchup_feed(%struct.mainwindow* %0) {
%2 = tail call i32 @catchup_feed(%struct.mainwindow* %0)
ret i32 %2
}
/* Variables and functions */
int qsort_stable(void *, size_t, size_t, int (*)(void const *, void const *),
                 int);
int qsort_s2(void *base, size_t nelem, size_t es,
             int (*compar)(const void *, const void *)) {
  return qsort_stable(base, nelem, es, compar, 2);
}


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

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

LLVM IR (-O0):
define i32 @qsort_s2(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%13 = call i32 @qsort_stable(i8* %9, i64 %10, i64 %11, i32 (i8*, i8*)* %12, i32 2)
ret i32 %13
}

LLVM IR (-O2):
define i32 @qsort_s2(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = tail call i32 @qsort_stable(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3, i32 2)
ret i32 %5
}
int ToUpper(x)
int x;
{ return (islower(x) ? toupper(x) : x); }


x86 assembly (clang, -O0):
<ToUpper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
je     114c <ToUpper+0x2c>
mov    -0x4(%rbp),%edi
call   1040 <toupper@plt>
mov    %eax,-0x8(%rbp)
jmp    1152 <ToUpper+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToUpper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
test   %eax,%eax
je     1134 <ToUpper+0x14>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <toupper@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ToUpper(i32 %0) {
%2 = tail call i32 @islower(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @toupper(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Type definitions */
struct atrf_dsc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void atben(struct atrf_dsc *dsc, const char *pattern, const char *next) {
  fprintf(stderr, "not compiled with ATBEN support\n");
  exit(1);
}


x86 assembly (clang, -O0):
<atben>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
%struct.atrf_dsc = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"not compiled with ATBEN support\0A\00"
define void @atben(%struct.atrf_dsc* %0, i8* %1, i8* %2) {
%4 = alloca %struct.atrf_dsc*
%5 = alloca i8*
%6 = alloca i8*
store %struct.atrf_dsc* %0, %struct.atrf_dsc** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
%struct.atrf_dsc = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"not compiled with ATBEN support\0A\00"
define void @atben(%struct.atrf_dsc* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct Testing {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RequireTrue(struct Testing *, int);
void TestHuffmanEncode(struct Testing *t) { RequireTrue(t, 1); }


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

x86 assembly (clang, -O2):
<TestHuffmanEncode>:
mov    $0x1,%esi
jmp    1030 <RequireTrue@plt>

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

LLVM IR (-O2):
%struct.Testing = type { i32 }
define void @TestHuffmanEncode(%struct.Testing* %0) {
%2 = tail call i32 @RequireTrue(%struct.Testing* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_debug(char *);
int init_module(void) {
  pr_debug("Hello World!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @init_module() {
%1 = call i32 @pr_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @init_module() {
%1 = tail call i32 @pr_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int mod255(int c) {
  char *cp = (char *)(&c);
  char *end_cp = cp + sizeof(c);
  int r = 0;
  while (cp < end_cp) {
    r += *(unsigned char *)(cp++);
  }
  while (r >= 255)
    r -= 255;
  return r;
}


x86 assembly (clang, -O0):
<mod255>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114d <mod255+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1122 <mod255+0x22>
jmp    1152 <mod255+0x52>
cmpl   $0xff,-0x1c(%rbp)
jl     116f <mod255+0x6f>
mov    -0x1c(%rbp),%eax
sub    $0xff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1152 <mod255+0x52>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod255>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %edi,%edx
movzbl %ah,%esi
shr    $0x18,%eax
shr    $0x10,%edx
add    %ecx,%esi
movzbl %dl,%ecx
add    %esi,%ecx
add    %eax,%ecx
imul   $0x8081,%ecx,%eax
shr    $0x17,%eax
mov    %eax,%edx
shl    $0x8,%edx
sub    %edx,%eax
add    %ecx,%eax
movzwl %ax,%eax
ret

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

LLVM IR (-O2):
define i32 @mod255(i32 %0) {
%2 = and i32 %0, 255
%3 = lshr i32 %0, 24
%4 = lshr i32 %0, 16
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = add nuw nsw i32 %2, %6
%8 = and i32 %4, 255
%9 = add nuw nsw i32 %7, %8
%10 = add nuw nsw i32 %9, %3
%11 = trunc i32 %10 to i16
%12 = urem i16 %11, 255
%13 = zext i16 %12 to i32
ret i32 %13
}
const char *stb__strchr(const char *str, int ch) {
  for (; *str; ++str)
    if (*str == ch)
      return str;
  return 0;
}


x86 assembly (clang, -O0):
<stb__strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <stb__strchr+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <stb__strchr+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <stb__strchr+0x53>
jmp    113a <stb__strchr+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <stb__strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb__strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <stb__strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <stb__strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <stb__strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @stb__strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
u_int32_t get_nxflat32(u_int32_t *addr32) { return ntohl(*addr32); }


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

x86 assembly (clang, -O2):
<get_nxflat32>:
mov    (%rdi),%edi
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @get_nxflat32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ntohl(i32 %2)
ret i32 %3
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *skyeye_mm_zero(size_t sz) {
  void *result = malloc(sz);
  memset(result, 0, sz);
  return result;
}


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

x86 assembly (clang, -O2):
<skyeye_mm_zero>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @skyeye_mm_zero(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 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @skyeye_mm_zero(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_DEL;
int /*<<< orphan*/ epoll_ctl(int, int /*<<< orphan*/, int,
                             int /*<<< orphan*/ *);
void poll_del(int poll_fd, int fd) {
  epoll_ctl(poll_fd, EPOLL_CTL_DEL, fd, NULL);
}


x86 assembly (clang, -O0):
<poll_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <epoll_ctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poll_del>:
mov    %esi,%edx
mov    0x2edf(%rip),%rax
mov    (%rax),%esi
xor    %ecx,%ecx
jmp    1030 <epoll_ctl@plt>

LLVM IR (-O0):
@EPOLL_CTL_DEL = global i32 0
define void @poll_del(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* @EPOLL_CTL_DEL
%7 = load i32, i32* %4
%8 = call i32 @epoll_ctl(i32 %5, i32 %6, i32 %7, i32* null)
ret void
}

LLVM IR (-O2):
@EPOLL_CTL_DEL = global i32 0
define void @poll_del(i32 %0, i32 %1) {
%3 = load i32, i32* @EPOLL_CTL_DEL
%4 = tail call i32 @epoll_ctl(i32 %0, i32 %3, i32 %1, i32* null)
ret void
}
void EC_KEY_set_group(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_KEY_set_group() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_rmsdist(int, char **);
int main(int argc, char *argv[]) {
  gmx_rmsdist(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_rmsdist(i32 %0, i8** %1)
ret i32 0
}
void foo_1_2_2_2_2_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_2_1_1_1_1() {
ret void
}
void FlushCOM(int portnum) {}


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

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

LLVM IR (-O0):
define void @FlushCOM(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @FlushCOM(i32 %0) {
ret void
}
/* Variables and functions */
int g();
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d\n", g()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <g@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @g()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ parse_path();
void setup_exec() { parse_path(); }


x86 assembly (clang, -O0):
<setup_exec>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <parse_path@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @setup_exec() {
%1 = call i32 (...) @parse_path()
ret void
}

LLVM IR (-O2):
define void @setup_exec() {
%1 = tail call i32 (...) @parse_path()
ret void
}
/* Variables and functions */
int geteuid();
int getuid();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("uid : %d \n", getuid());
  printf("euid : %d \n", geteuid());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"uid : %d \0A\00"
@.str.1 = [12 x i8] c"euid : %d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @geteuid()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_peek() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_peek"
         "\n");
}


x86 assembly (clang, -O0):
<pa_memblockq_peek>:
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_memblockq_peek>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_memblockq_peek\00"
define i32 @pa_memblockq_peek() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int k = 0;
  printf("Hello World");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef size_t uint16_t;

/* Variables and functions */
size_t strlen(const char *str) {
  uint16_t i = 0;
  while (str[i++] != 0)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1135 <strlen+0x35>
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %4, %2 ]
%4 = add i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ doTests();
int main(void) { doTests(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @doTests()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @doTests()
ret i32 0
}
void g_async_queue_pop() {}


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

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

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

LLVM IR (-O2):
define void @g_async_queue_pop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mapreduce_deinit();
int /*<<< orphan*/ mapreduce_init();
int /*<<< orphan*/ purge_tests();
int /*<<< orphan*/ view_tests();
int main() {
  mapreduce_init();
  view_tests();
  purge_tests();
  mapreduce_deinit();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <mapreduce_init@plt>
xor    %eax,%eax
call   1040 <view_tests@plt>
xor    %eax,%eax
call   1050 <purge_tests@plt>
xor    %eax,%eax
call   1060 <mapreduce_deinit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @mapreduce_init()
%3 = call i32 (...) @view_tests()
%4 = call i32 (...) @purge_tests()
%5 = call i32 (...) @mapreduce_deinit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mapreduce_init()
%2 = tail call i32 (...) @view_tests()
%3 = tail call i32 (...) @purge_tests()
%4 = tail call i32 (...) @mapreduce_deinit()
ret i32 0
}
void lfds700_misc_prng_internal_hash_murmurhash3(
    int long long unsigned *murmurhash3_state) {
  assert(murmurhash3_state != ((void *)0));
  *murmurhash3_state ^= *murmurhash3_state >> 33;
  *murmurhash3_state *= 0xff51afd7ed558ccdULL;
  *murmurhash3_state ^= *murmurhash3_state >> 33;
  *murmurhash3_state *= 0xc4ceb9fe1a85ec53ULL;
  *murmurhash3_state ^= *murmurhash3_state >> 33;
  return;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
shr    $0x21,%rcx
mov    -0x8(%rbp),%rax
xor    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
movabs $0xff51afd7ed558ccd,%rcx
af 51 ff
imul   (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
shr    $0x21,%rcx
mov    -0x8(%rbp),%rax
xor    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
movabs $0xc4ceb9fe1a85ec53,%rcx
b9 ce c4
imul   (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
shr    $0x21,%rcx
mov    -0x8(%rbp),%rax
xor    (%rax),%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
xor    %eax,%eax
call   1030 <assert@plt>
mov    (%rbx),%rax
mov    %rax,%rcx
shr    $0x21,%rcx
xor    %rax,%rcx
movabs $0xff51afd7ed558ccd,%rax
af 51 ff
imul   %rcx,%rax
mov    %rax,%rcx
shr    $0x21,%rcx
xor    %rax,%rcx
movabs $0xc4ceb9fe1a85ec53,%rax
b9 ce c4
imul   %rcx,%rax
mov    %rax,%rcx
shr    $0x21,%rcx
xor    %rax,%rcx
mov    %rcx,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @lfds700_misc_prng_internal_hash_murmurhash3(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = icmp ne i64* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %5)
%7 = load i64*, i64** %2
%8 = load i64, i64* %7
%9 = lshr i64 %8, 33
%10 = load i64*, i64** %2
%11 = load i64, i64* %10
%12 = xor i64 %11, %9
store i64 %12, i64* %10
%13 = load i64*, i64** %2
%14 = load i64, i64* %13
%15 = mul i64 %14, -49064778989728563
store i64 %15, i64* %13
%16 = load i64*, i64** %2
%17 = load i64, i64* %16
%18 = lshr i64 %17, 33
%19 = load i64*, i64** %2
%20 = load i64, i64* %19
%21 = xor i64 %20, %18
store i64 %21, i64* %19
%22 = load i64*, i64** %2
%23 = load i64, i64* %22
%24 = mul i64 %23, -4265267296055464877
store i64 %24, i64* %22
%25 = load i64*, i64** %2
%26 = load i64, i64* %25
%27 = lshr i64 %26, 33
%28 = load i64*, i64** %2
%29 = load i64, i64* %28
%30 = xor i64 %29, %27
store i64 %30, i64* %28
ret void
}

LLVM IR (-O2):
define void @lfds700_misc_prng_internal_hash_murmurhash3(i64* %0) {
%2 = icmp ne i64* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %3)
%5 = load i64, i64* %0
%6 = lshr i64 %5, 33
%7 = xor i64 %6, %5
%8 = mul i64 %7, -49064778989728563
%9 = lshr i64 %8, 33
%10 = xor i64 %9, %8
%11 = mul i64 %10, -4265267296055464877
%12 = lshr i64 %11, 33
%13 = xor i64 %12, %11
store i64 %13, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: cps_test <num_files> <file 1> <file 2> .... <file n>\n");
  printf("\t<file> is swap replay dump file from sr_collect\n");
  exit(0);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"Usage: cps_test <num_files> <file 1> <file 2> .... <file n>\0A\00"
@.str.1 = [50 x i8] c"\09<file> is swap replay dump file from sr_collect\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [60 x i8] c"Usage: cps_test <num_files> <file 1> <file 2> .... <file n>\00"
@str.2 = [49 x i8] c"\09<file> is swap replay dump file from sr_collect\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ convertir_peones_reinas(char *);
void realizar_jugada(char *ptablero, int fi, int ci, int ff, int cf) {
  ptablero[ff * 8 + cf] = ptablero[fi * 8 + ci];
  ptablero[fi * 8 + ci] = ' ';
  convertir_peones_reinas(ptablero);
}


x86 assembly (clang, -O0):
<realizar_jugada>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1030 <convertir_peones_reinas@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realizar_jugada>:
lea    (%rdx,%rsi,8),%eax
cltq
mov    (%rdi,%rax,1),%dl
lea    (%r8,%rcx,8),%ecx
movslq %ecx,%rcx
mov    %dl,(%rdi,%rcx,1)
movb   $0x20,(%rdi,%rax,1)
jmp    1030 <convertir_peones_reinas@plt>

LLVM IR (-O0):
define void @realizar_jugada(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = mul nsw i32 %12, 8
%14 = load i32, i32* %8
%15 = add nsw i32 %13, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %11, i64 %16
%18 = load i8, i8* %17
%19 = load i8*, i8** %6
%20 = load i32, i32* %9
%21 = mul nsw i32 %20, 8
%22 = load i32, i32* %10
%23 = add nsw i32 %21, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %19, i64 %24
store i8 %18, i8* %25
%26 = load i8*, i8** %6
%27 = load i32, i32* %7
%28 = mul nsw i32 %27, 8
%29 = load i32, i32* %8
%30 = add nsw i32 %28, %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %26, i64 %31
store i8 32, i8* %32
%33 = load i8*, i8** %6
%34 = call i32 @convertir_peones_reinas(i8* %33)
ret void
}

LLVM IR (-O2):
define void @realizar_jugada(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = shl nsw i32 %1, 3
%7 = add nsw i32 %6, %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = shl nsw i32 %3, 3
%12 = add nsw i32 %11, %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 %10, i8* %14
store i8 32, i8* %9
%15 = tail call i32 @convertir_peones_reinas(i8* %0)
ret void
}