xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int, char const *);
int /*<<< orphan*/ stderr;
void _gstc_assert(int cond, const char *scond, const char *file,
                  const char *function, int line) {
  if (0 == cond) {
    fprintf(stderr, "**libgstc**: %s:%s:%d: \"%s\" failed!\n", file, function,
            line, scond);
    ;
  }
}


x86 assembly (clang, -O0):
<_gstc_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jne    115b <_gstc_assert+0x4b>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x10(%rbp),%r9
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gstc_assert>:
test   %edi,%edi
je     1115 <_gstc_assert+0x5>
ret
mov    %rsi,%r9
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"**libgstc**: %s:%s:%d: \22%s\22 failed!\0A\00"
define void @_gstc_assert(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = icmp eq i32 0, %11
br i1 %12, label %13, label %20
13: ; preds = %5
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i32, i32* %10
%18 = load i8*, i8** %7
%19 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16, i32 %17, i8* %18)
br label %20
20: ; preds = %13, %5
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"**libgstc**: %s:%s:%d: \22%s\22 failed!\0A\00"
define void @_gstc_assert(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = icmp eq i32 %0, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i32 %4, i8* %1)
br label %10
10: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_IO(int /*<<< orphan*/);
int gen_IO() { handle_IO(0); }


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

x86 assembly (clang, -O2):
<gen_IO>:
xor    %edi,%edi
jmp    1030 <handle_IO@plt>

LLVM IR (-O0):
define i32 @gen_IO() {
%1 = alloca i32
%2 = call i32 @handle_IO(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_IO() {
%1 = tail call i32 @handle_IO(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, const char *argv[]) {
  char my_string[4];
  my_string[0] = 'H';
  my_string[1] = 'E';
  my_string[2] = 'L';
  my_string[3] = 'O';
  printf("%s\n", my_string);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x48,-0x14(%rbp)
movb   $0x45,-0x13(%rbp)
movb   $0x4c,-0x12(%rbp)
movb   $0x4f,-0x11(%rbp)
lea    -0x14(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x4f4c4548,0x4(%rsp)
4f
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 72, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 69, i8* %5
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 76, i8* %6
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 79, i8* %7
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
void delet2Darray_int_continuousMem(int **tmp, int a1, int a2) {
  free(tmp[0]);
  free(tmp);
}


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

x86 assembly (clang, -O2):
<delet2Darray_int_continuousMem>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @delet2Darray_int_continuousMem(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 = getelementptr inbounds i32*, i32** %7, i64 0
%9 = load i32*, i32** %8
%10 = bitcast i32* %9 to i8*
%11 = load i32**, i32*** %4
%12 = bitcast i32** %11 to i8*
ret void
}

LLVM IR (-O2):
define void @delet2Darray_int_continuousMem(i32** nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i32** %0 to i8**
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = bitcast i32** %0 to i8*
tail call void @free(i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ SOCK_STREAM;
int Socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int NewTCPSocket() { return Socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); }


x86 assembly (clang, -O0):
<NewTCPSocket>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
call   1030 <Socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NewTCPSocket>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
jmp    1030 <Socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
define i32 @NewTCPSocket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = load i32, i32* @IPPROTO_TCP
%4 = call i32 @Socket(i32 %1, i32 %2, i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
define i32 @NewTCPSocket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = load i32, i32* @IPPROTO_TCP
%4 = tail call i32 @Socket(i32 %1, i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void QMFree(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @QMFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void switch2() {
  int x = 6;
  switch (x) {
  case 1:
    puts("valor de x == 1");
    break;
  case 2:
    puts("valor de x == 2");
    break;
  default:
    puts("valor de x != 1 y x != 2");
    break;
  }
}


x86 assembly (clang, -O0):
<switch2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1144 <switch2+0x34>
jmp    1133 <switch2+0x23>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1155 <switch2+0x45>
jmp    1166 <switch2+0x56>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
jmp    1172 <switch2+0x62>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
jmp    1172 <switch2+0x62>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"valor de x == 1\00"
@.str.1 = [16 x i8] c"valor de x == 2\00"
@.str.2 = [25 x i8] c"valor de x != 1 y x != 2\00"
define void @switch2() {
%1 = alloca i32
store i32 6, i32* %1
%2 = load i32, i32* %1
switch i32 %2, label %7 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %0
%4 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5, %3
ret void
}

LLVM IR (-O2):
@.str.2 = [25 x i8] c"valor de x != 1 y x != 2\00"
define void @switch2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int aeron_idle_strategy_init_null(void **state) {
  *state = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<aeron_idle_strategy_init_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_idle_strategy_init_null>:
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @aeron_idle_strategy_init_null(i8** nocapture writeonly %0) {
store i8* null, i8** %0
ret i32 0
}
/* Variables and functions */
scalar_t__ en_AU_isupper(int);
int en_AU_tolower(int c) {
  { return en_AU_isupper(c) ? (c - 'A' + 'a') : c; }
}


x86 assembly (clang, -O0):
<en_AU_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <en_AU_isupper@plt>
cmp    $0x0,%rax
je     113e <en_AU_tolower+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <en_AU_tolower+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @en_AU_tolower(i32 %0) {
%2 = tail call i64 @en_AU_isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ clog_flush(int *);
void CLOG_FLUSH_(int *flag) { clog_flush(flag); }


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

x86 assembly (clang, -O2):
<CLOG_FLUSH_>:
jmp    1030 <clog_flush@plt>

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

LLVM IR (-O2):
define void @CLOG_FLUSH_(i32* %0) {
%2 = tail call i32 @clog_flush(i32* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ save_unders;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
int get_Screen_save_unders(void *_p) {
  return (int)((Screen *)_p)->save_unders;
}


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

x86 assembly (clang, -O2):
<get_Screen_save_unders>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_Screen_save_unders(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *jv_mem_realloc(void *, size_t);
void *jq_yyrealloc(void *p, size_t sz, void *extra) {
  return jv_mem_realloc(p, sz);
}


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

x86 assembly (clang, -O2):
<jq_yyrealloc>:
jmp    1030 <jv_mem_realloc@plt>

LLVM IR (-O0):
define i8* @jq_yyrealloc(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @jv_mem_realloc(i8* %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @jq_yyrealloc(i8* %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call i8* @jv_mem_realloc(i8* %0, i64 %1)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
scalar_t__ ptsname_r(int, char *, int);
char *ptsname(int fd) {
  static char buffer[sizeof("/dev/pts/") + 20];
  return ptsname_r(fd, buffer, sizeof(buffer)) != 0 ? NULL : buffer;
}


x86 assembly (clang, -O0):
<ptsname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f1b(%rip),%rsi
mov    $0x1e,%edx
call   1030 <ptsname_r@plt>
mov    %rax,%rdx
lea    0x2f07(%rip),%rax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptsname>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rsi
mov    $0x1e,%edx
call   1030 <ptsname_r@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ptsname.buffer = internal global [30 x i8] zeroinitializer
define i8* @ptsname(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ptsname_r(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @ptsname.buffer, i64 0, i64 0), i32 30)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* null, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @ptsname.buffer, i64 0, i64 0)
ret i8* %7
}

LLVM IR (-O2):
@ptsname.buffer = internal global [30 x i8] zeroinitializer
define i8* @ptsname(i32 %0) {
%2 = tail call i64 @ptsname_r(i32 %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @ptsname.buffer, i64 0, i64 0), i32 30)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @ptsname.buffer, i64 0, i64 0), i8* null
ret i8* %4
}
/* Variables and functions */
int cc(int, int);
int count_change(int amount) { return cc(amount, 5); }


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

x86 assembly (clang, -O2):
<count_change>:
mov    $0x5,%esi
jmp    1030 <cc@plt>

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

LLVM IR (-O2):
define i32 @count_change(i32 %0) {
%2 = tail call i32 @cc(i32 %0, i32 5)
ret i32 %2
}
void rop3_224_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | S;
  stk1 = T & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_224_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%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    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%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_224_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_224_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
char UpperCase(char);
char ToUpper(char a) { return UpperCase(a); }


x86 assembly (clang, -O0):
<ToUpper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <UpperCase@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToUpper>:
jmp    1030 <UpperCase@plt>

LLVM IR (-O0):
define signext i8 @ToUpper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @UpperCase(i8 signext %3)
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @ToUpper(i8 signext %0) {
%2 = tail call signext i8 @UpperCase(i8 signext %0)
ret i8 %2
}
void I420AlphaToARGB() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_can_insert() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ns2ticks(uint32_t ns) { return ns / 1; }


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

x86 assembly (clang, -O2):
<ns2ticks>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ns2ticks(i32 returned %0) {
ret i32 %0
}
double func(double x, double y, double z) { return -y; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
movaps %xmm1,%xmm0
xorps  0xef6(%rip),%xmm0
ret

LLVM IR (-O0):
define double @func(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = fneg double %7
ret double %8
}

LLVM IR (-O2):
define double @func(double %0, double %1, double %2) {
%4 = fneg double %1
ret double %4
}
/* Variables and functions */
long lseek(int, long, int);
int /*<<< orphan*/ syssuerr(char *, char *);
long elseek(int fd, long offset, int origin) {
  long position;
  if (-1 == (position = lseek(fd, offset, origin)))
    syssuerr("%s: elseek: lseek failed",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/"
             "trip/iwave/sucore/src/syscalls.c");
  return position;
}


x86 assembly (clang, -O0):
<elseek>:
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
call   1030 <lseek@plt>
mov    %rax,%rcx
mov    %rcx,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rcx,%rax
jne    116b <elseek+0x4b>
lea    0xea1(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <syssuerr@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elseek>:
push   %rbx
call   1030 <lseek@plt>
mov    %rax,%rbx
cmp    $0xffffffffffffffff,%rax
jne    1142 <elseek+0x22>
lea    0xeca(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1040 <syssuerr@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"%s: elseek: lseek failed\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c\00"
define i64 @elseek(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i64, i64* %5
%10 = load i32, i32* %6
%11 = call i64 @lseek(i32 %8, i64 %9, i32 %10)
store i64 %11, i64* %7
%12 = icmp eq i64 -1, %11
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @syssuerr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i64, i64* %7
ret i64 %16
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s: elseek: lseek failed\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c\00"
define i64 @elseek(i32 %0, i64 %1, i32 %2) {
%4 = tail call i64 @lseek(i32 %0, i64 %1, i32 %2)
%5 = icmp eq i64 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @syssuerr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ reply(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strlen(char *);
void error_reply(int sts) {
  char buf[10];
  sprintf(buf, "E%02x", sts);
  reply(buf, strlen(buf));
}


x86 assembly (clang, -O0):
<error_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0xe(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xe(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <reply@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_reply>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
lea    0xec2(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <reply@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"E%02x\00"
define void @error_reply(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @reply(i8* %7, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"E%02x\00"
define void @error_reply(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @strlen(i8* %3)
%6 = call i32 @reply(i8* %3, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ operand(int, int);
store() { operand(2, (0x04 | 0x08 | 0x10)); }


x86 assembly (clang, -O0):
<store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x1c,%esi
call   1030 <operand@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store>:
mov    $0x2,%edi
mov    $0x1c,%esi
jmp    1030 <operand@plt>

LLVM IR (-O0):
define i32 @store() {
%1 = alloca i32
%2 = call i32 @operand(i32 2, i32 28)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @store() {
%1 = tail call i32 @operand(i32 2, i32 28)
ret i32 undef
}
int iswordsplitter(int c) { return c == '\n' || c == '\t' || c == ' '; }


x86 assembly (clang, -O0):
<iswordsplitter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <iswordsplitter+0x2f>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <iswordsplitter+0x2f>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswordsplitter>:
lea    -0x9(%rdi),%eax
cmp    $0x2,%eax
setb   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @iswordsplitter(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 2
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
int unsignedCmpFn(const void *p1, const void *p2) {
  unsigned v1, v2;
  v1 = *((unsigned *)p1);
  v2 = *((unsigned *)p2);
  if (v1 == v2)
    return 0;
  return (v1 < v2) ? -1 : +1;
}


x86 assembly (clang, -O0):
<unsignedCmpFn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1136 <unsignedCmpFn+0x36>
movl   $0x0,-0x4(%rbp)
jmp    114e <unsignedCmpFn+0x4e>
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovb  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedCmpFn>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setae  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @unsignedCmpFn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = icmp ult i32 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t uint48_decode(const uint8_t *p_encoded_data) {
  return ((((uint64_t)((uint8_t *)p_encoded_data)[0]) << 0) |
          (((uint64_t)((uint8_t *)p_encoded_data)[1]) << 8) |
          (((uint64_t)((uint8_t *)p_encoded_data)[2]) << 16) |
          (((uint64_t)((uint8_t *)p_encoded_data)[3]) << 24) |
          (((uint64_t)((uint8_t *)p_encoded_data)[4]) << 32) |
          (((uint64_t)((uint8_t *)p_encoded_data)[5]) << 40));
}


x86 assembly (clang, -O0):
<uint48_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x0,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x20(%rcx),%rcx
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x28(%rcx),%rcx
mov    %ecx,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @uint48_decode(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 0
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 8
%13 = or i32 %7, %12
%14 = load i64*, i64** %2
%15 = getelementptr inbounds i64, i64* %14, i64 2
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 16
%19 = or i32 %13, %18
%20 = load i64*, i64** %2
%21 = getelementptr inbounds i64, i64* %20, i64 3
%22 = load i64, i64* %21
%23 = trunc i64 %22 to i32
%24 = shl i32 %23, 24
%25 = or i32 %19, %24
%26 = load i64*, i64** %2
%27 = getelementptr inbounds i64, i64* %26, i64 4
%28 = load i64, i64* %27
%29 = trunc i64 %28 to i32
%30 = shl i32 %29, 32
%31 = or i32 %25, %30
%32 = load i64*, i64** %2
%33 = getelementptr inbounds i64, i64* %32, i64 5
%34 = load i64, i64* %33
%35 = trunc i64 %34 to i32
%36 = shl i32 %35, 40
%37 = or i32 %31, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @uint48_decode(i64* nocapture readnone %0) {
ret i32 poison
}
/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ strncat(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void string_append(int which, char *new_part, char *string) {
  if (which == 0) {
    strncpy(string, new_part, BUFSIZ);
  } else {
    strncat(string, "/", 2);
    strncat(string, new_part, BUFSIZ);
  }
}


x86 assembly (clang, -O0):
<string_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1158 <string_append+0x38>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
call   1030 <strncpy@plt>
jmp    1183 <string_append+0x63>
mov    -0x18(%rbp),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e64(%rip),%rax
mov    (%rax),%edx
call   1040 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_append>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
test   %edi,%edi
je     115d <string_append+0x3d>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1040 <strncat@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strncat@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [2 x i8] c"/\00"
define void @string_append(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = load i32, i32* @BUFSIZ
%13 = call i32 @strncpy(i8* %10, i8* %11, i32 %12)
br label %21
14: ; preds = %3
%15 = load i8*, i8** %6
%16 = call i32 @strncat(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 2)
%17 = load i8*, i8** %6
%18 = load i8*, i8** %5
%19 = load i32, i32* @BUFSIZ
%20 = call i32 @strncat(i8* %17, i8* %18, i32 %19)
br label %21
21: ; preds = %14, %9
ret void
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str = [2 x i8] c"/\00"
define void @string_append(i32 %0, i8* %1, i8* %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i32, i32* @BUFSIZ
%7 = tail call i32 @strncpy(i8* %2, i8* %1, i32 %6)
br label %12
8: ; preds = %3
%9 = tail call i32 @strncat(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 2)
%10 = load i32, i32* @BUFSIZ
%11 = tail call i32 @strncat(i8* %2, i8* %1, i32 %10)
br label %12
12: ; preds = %8, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
void delim(int i) {
  puts("");
  while (--i)
    putchar('=');
  puts("");
}


x86 assembly (clang, -O0):
<delim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1158 <delim+0x38>
mov    $0x3d,%edi
call   1030 <putchar@plt>
jmp    1137 <delim+0x17>
lea    0xea1(%rip),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delim>:
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
nopl   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
je     1131 <delim+0x21>
mov    $0x3d,%edi
jmp    1120 <delim+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @delim(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 @putchar(i8 signext 61)
br label %4
10: ; preds = %4
%11 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @delim(i32 %0) {
%2 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ %3, %1 ]
%7 = tail call i32 @putchar(i8 signext 61)
%8 = add nsw i32 %6, -1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %1
%11 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret void
}
void dbg_message(int level, const char *format, ...) {}


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

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

LLVM IR (-O0):
define void @dbg_message(i32 %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @dbg_message(i32 %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int dlink_insert_first(void *);
int push(void *p) { return dlink_insert_first(p); }


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

x86 assembly (clang, -O2):
<push>:
jmp    1030 <dlink_insert_first@plt>

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

LLVM IR (-O2):
define i32 @push(i8* %0) {
%2 = tail call i32 @dlink_insert_first(i8* %0)
ret i32 %2
}
unsigned int of_clk_get_parent_count(struct device_node *np) { return 0; }


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

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

LLVM IR (-O0):
%struct.device_node = type opaque
define i32 @of_clk_get_parent_count(%struct.device_node* %0) {
%2 = alloca %struct.device_node*
store %struct.device_node* %0, %struct.device_node** %2
ret i32 0
}

LLVM IR (-O2):
%struct.device_node = type opaque
define i32 @of_clk_get_parent_count(%struct.device_node* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *strDLeader(char *, char, size_t);
char *strDDotLeader(char *st, size_t len) { return strDLeader(st, '.', len); }


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

x86 assembly (clang, -O2):
<strDDotLeader>:
mov    %rsi,%rdx
mov    $0x2e,%esi
jmp    1030 <strDLeader@plt>

LLVM IR (-O0):
define i8* @strDDotLeader(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @strDLeader(i8* %5, i8 signext 46, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @strDDotLeader(i8* %0, i64 %1) {
%3 = tail call i8* @strDLeader(i8* %0, i8 signext 46, i64 %1)
ret i8* %3
}
int map_getcolvert(int vert) { return vert % 6; }


x86 assembly (clang, -O0):
<map_getcolvert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_getcolvert>:
movslq %edi,%rax
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @map_getcolvert(i32 %0) {
%2 = srem i32 %0, 6
ret i32 %2
}
/* Variables and functions */
int O_NOCTTY;
int O_RDWR;
int O_SYNC;
int open(char const *, int);
int open_serial_interface(const char *devicename) {
  int filedesc = open(devicename, O_RDWR | O_NOCTTY | O_SYNC);
  return filedesc;
}


x86 assembly (clang, -O0):
<open_serial_interface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
or     (%rax),%esi
mov    0x2ea7(%rip),%rax
or     (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_serial_interface>:
mov    0x2ed1(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2eb7(%rip),%rax
or     (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_SYNC = global i32 0
define i32 @open_serial_interface(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_NOCTTY
%7 = or i32 %5, %6
%8 = load i32, i32* @O_SYNC
%9 = or i32 %7, %8
%10 = call i32 @open(i8* %4, i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_SYNC = global i32 0
define i32 @open_serial_interface(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_NOCTTY
%4 = or i32 %3, %2
%5 = load i32, i32* @O_SYNC
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* %0, i32 %6)
ret i32 %7
}
void stosl(void *addr, int data, int cnt) {
  asm volatile("cld; rep stosl"
               : "=D"(addr), "=c"(cnt)
               : "0"(addr), "1"(cnt), "a"(data)
               : "memory", "cc");
}


x86 assembly (clang, -O0):
<stosl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
cld
rep stos %eax,%es:(%rdi)
mov    %rdi,-0x8(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stosl>:
mov    %edx,%ecx
mov    %esi,%eax
cld
rep stos %eax,%es:(%rdi)
ret

LLVM IR (-O0):
define void @stosl(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = call { i8*, i32 } asm sideeffect "cld; rep stosl", "={di},={cx},0,1,{ax},~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i8* %7, i32 %8, i32 %9)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %4
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @stosl(i8* %0, i32 %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "cld; rep stosl", "={di},={cx},0,1,{ax},~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 %2, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
char *ModelicaAllocateStringWithErrorReturn(size_t len) {
  char *res = (char *)malloc(len + 1);
  if (res != NULL) {
    res[len] = '\0';
  }
  return res;
}


x86 assembly (clang, -O0):
<ModelicaAllocateStringWithErrorReturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1144 <ModelicaAllocateStringWithErrorReturn+0x34>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ModelicaAllocateStringWithErrorReturn>:
push   %rbx
mov    %rdi,%rbx
add    $0x1,%rdi
call   1030 <malloc@plt>
test   %rax,%rax
je     1126 <ModelicaAllocateStringWithErrorReturn+0x16>
movb   $0x0,(%rax,%rbx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ModelicaAllocateStringWithErrorReturn(i64 %0) {
%2 = add i64 %0, 1
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %4, i64 %0
store i8 0, i8* %7
br label %8
8: ; preds = %6, %1
ret i8* %4
}
void ft_strrev(char *start, char *end) {
  char tmp;
  while (start < --end) {
    tmp = *start;
    *start++ = *end;
    *end = tmp;
  }
}


x86 assembly (clang, -O0):
<ft_strrev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    %rcx,%rax
jae    1153 <ft_strrev+0x53>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    110c <ft_strrev+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strrev>:
add    $0xffffffffffffffff,%rsi
cmp    %rdi,%rsi
jbe    112c <ft_strrev+0x2c>
add    $0x1,%rdi
nopl   (%rax)
movzbl -0x1(%rdi),%eax
movzbl (%rsi),%ecx
mov    %cl,-0x1(%rdi)
mov    %al,(%rsi)
add    $0xffffffffffffffff,%rsi
lea    0x1(%rdi),%rax
cmp    %rsi,%rdi
mov    %rax,%rdi
jb     1110 <ft_strrev+0x10>
ret

LLVM IR (-O0):
define void @ft_strrev(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %11, %2
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 -1
store i8* %9, i8** %4
%10 = icmp ult i8* %7, %9
br i1 %10, label %11, label %20
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
store i8 %13, i8* %5
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
store i8 %15, i8* %16
%18 = load i8, i8* %5
%19 = load i8*, i8** %4
store i8 %18, i8* %19
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ft_strrev(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 -1
%4 = icmp ugt i8* %3, %0
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i8* [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = load i8, i8* %6
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %9, i8* %7
store i8 %8, i8* %6
%11 = getelementptr inbounds i8, i8* %6, i64 -1
%12 = icmp ult i8* %10, %11
br i1 %12, label %5, label %13
13: ; preds = %5, %2
ret void
}