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

/* Variables and functions */
int /*<<< orphan*/ _update_proc_tree();
void sigupdate_handler(int sig, siginfo_t *si, void *uc) {
  _update_proc_tree();
}


x86 assembly (clang, -O0):
<sigupdate_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <_update_proc_tree@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sigupdate_handler(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = call i32 (...) @_update_proc_tree()
ret void
}

LLVM IR (-O2):
define void @sigupdate_handler(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @_update_proc_tree()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ptext(char const *);
int /*<<< orphan*/ put_crlf();
void ptextln(const char *s) {
  ptext(s);
  put_crlf();
}


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

x86 assembly (clang, -O2):
<ptextln>:
push   %rax
call   1030 <ptext@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <put_crlf@plt>

LLVM IR (-O0):
define void @ptextln(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ptext(i8* %3)
%5 = call i32 (...) @put_crlf()
ret void
}

LLVM IR (-O2):
define void @ptextln(i8* %0) {
%2 = tail call i32 @ptext(i8* %0)
%3 = tail call i32 (...) @put_crlf()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print(char *statement) { puts(statement); }


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

x86 assembly (clang, -O2):
<print>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
int command_calendar(int argc, char *argv[]) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @command_calendar(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
char *strchr(char *, char);
int at_tok_start(char **p_cur) {
  if (*p_cur == NULL) {
    return -1;
  }
  *p_cur = strchr(*p_cur, ':');
  if (*p_cur == NULL) {
    return -1;
  }
  (*p_cur)++;
  return 0;
}


x86 assembly (clang, -O0):
<at_tok_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1136 <at_tok_start+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <at_tok_start+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    116b <at_tok_start+0x5b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <at_tok_start+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_tok_start>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0xffffffff,%ebp
test   %rdi,%rdi
je     113e <at_tok_start+0x2e>
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     113e <at_tok_start+0x2e>
add    $0x1,%rax
mov    %rax,(%rbx)
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @at_tok_start(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i8* @strchr(i8* %2, i8 signext 58)
store i8* %5, i8** %0
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %8, i8** %0
br label %9
9: ; preds = %4, %1, %7
%10 = phi i32 [ 0, %7 ], [ -1, %1 ], [ -1, %4 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ sfd_fix_indentation(char *);
scalar_t__ sfd_fix_line_endings(char *);
int sfd_fix_code_style(char *fname) {
  return !((sfd_fix_line_endings(fname) == 0) &&
           (sfd_fix_indentation(fname) == 0));
}


x86 assembly (clang, -O0):
<sfd_fix_code_style>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sfd_fix_line_endings@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <sfd_fix_code_style+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <sfd_fix_indentation@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfd_fix_code_style>:
push   %rbx
mov    %rdi,%rbx
call   1040 <sfd_fix_line_endings@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <sfd_fix_code_style+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <sfd_fix_indentation@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @sfd_fix_code_style(i8* %0) {
%2 = tail call i64 @sfd_fix_line_endings(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @sfd_fix_indentation(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ portRead(char *, int, int);
scalar_t__ portWrite(char *);
int get_TemmaLST(char *local_buffer) {
  if (portWrite("g") < 0)
    return -1;
  portRead(local_buffer, -1, 1);
  if (local_buffer[0] == 'g') {
    return 0;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<get_TemmaLST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <portWrite@plt>
cmp    $0x0,%rax
jge    114e <get_TemmaLST+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <get_TemmaLST+0x64>
mov    -0x10(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1040 <portRead@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x67,%eax
jne    117d <get_TemmaLST+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1184 <get_TemmaLST+0x64>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_TemmaLST>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <portWrite@plt>
test   %rax,%rax
js     1153 <get_TemmaLST+0x33>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1040 <portRead@plt>
xor    %eax,%eax
cmpb   $0x67,(%rbx)
setne  %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"g\00"
define i32 @get_TemmaLST(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 @portWrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %17
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @portRead(i8* %8, i32 -1, i32 1)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 103
br i1 %14, label %15, label %16
15: ; preds = %7
store i32 0, i32* %2
br label %17
16: ; preds = %7
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %15, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"g\00"
define i32 @get_TemmaLST(i8* %0) {
%2 = tail call i64 @portWrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @portRead(i8* %0, i32 -1, i32 1)
%6 = load i8, i8* %0
%7 = icmp ne i8 %6, 103
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ -1, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ _fail(char const *const, int const);
int /*<<< orphan*/ integer_in_range_display_error(int const, int const,
                                                  int const);
void _assert_in_range(const int value, const int minimum, const int maximum,
                      const char *const file, const int line) {
  if (!integer_in_range_display_error(value, minimum, maximum)) {
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_in_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <integer_in_range_display_error@plt>
cmp    $0x0,%eax
jne    115c <_assert_in_range+0x3c>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_in_range>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %rcx,%rbx
call   1040 <integer_in_range_display_error@plt>
test   %eax,%eax
je     1139 <_assert_in_range+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_fail@plt>

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

LLVM IR (-O2):
define void @_assert_in_range(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @integer_in_range_display_error(i32 %0, i32 %1, i32 %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @_fail(i8* %3, i32 %4)
br label %10
10: ; preds = %8, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void version(const char *progname) {
  printf("%s "
         "1.4.1"
         "\n",
         progname);
}


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

x86 assembly (clang, -O2):
<version>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s 1.4.1\0A\00"
define void @version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TestIfGoodThingHitsBadThing(int, int, int);
void TestIfPlayerRunsIntoBadThing(int x, int y, int move_dir) {
  TestIfGoodThingHitsBadThing(x, y, move_dir);
}


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

x86 assembly (clang, -O2):
<TestIfPlayerRunsIntoBadThing>:
jmp    1030 <TestIfGoodThingHitsBadThing@plt>

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

LLVM IR (-O2):
define void @TestIfPlayerRunsIntoBadThing(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @TestIfGoodThingHitsBadThing(i32 %0, i32 %1, i32 %2)
ret void
}
void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr) {}


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

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

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

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
define void @brcmf_proto_bcdc_detach(%struct.brcmf_pub* nocapture %0) {
ret void
}
void _vFlushKey(void) {}


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

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

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

LLVM IR (-O2):
define void @_vFlushKey() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void version() {
  printf("%s\n", "zsbc 0.2.1");
  printf("Copyright 2015 Sébastien Millet.\n");
  printf("This is free software with ABSOLUTELY NO WARRANTY.\n");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"zsbc 0.2.1\00"
@.str.2 = [35 x i8] c"Copyright 2015 S\C3\A9bastien Millet.\0A\00"
@.str.3 = [52 x i8] c"This is free software with ABSOLUTELY NO WARRANTY.\0A\00"
define void @version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"zsbc 0.2.1\00"
@str = [34 x i8] c"Copyright 2015 S\C3\A9bastien Millet.\00"
@str.4 = [51 x i8] c"This is free software with ABSOLUTELY NO WARRANTY.\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.4, i64 0, i64 0))
ret void
}
void RTAvlroGCPtrGetRoot(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPtrGetRoot() {
ret void
}
int strLen(char str[]) {
  int i;
  for (i = 0; str[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <strLen+0x37>
jmp    1129 <strLen+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strLen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strLen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strLen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strLen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int lcm(int firstNumber, int secondNumber) {
  int current_lcm = 0, gcd = 0, temp = 0;
  int g1 = firstNumber, g2 = secondNumber;
  while (g1 != 0) {
    temp = g1;
    g1 = g2 % g1;
    g2 = temp;
  }
  gcd = g2;
  if (gcd != 0)
    current_lcm = (secondNumber / gcd) * firstNumber;
  return current_lcm;
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1150 <lcm+0x50>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <lcm+0x2b>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     116e <lcm+0x6e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
mov    %esi,%ecx
test   %edi,%edi
je     111b <lcm+0x1b>
mov    %esi,%eax
mov    %edi,%edx
nopw   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <lcm+0x10>
test   %ecx,%ecx
je     1128 <lcm+0x28>
mov    %esi,%eax
cltd
idiv   %ecx
imul   %edi,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @lcm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
%10 = load i32, i32* %3
store i32 %10, i32* %8
%11 = load i32, i32* %4
store i32 %11, i32* %9
br label %12
12: ; preds = %15, %2
%13 = load i32, i32* %8
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %8
store i32 %16, i32* %7
%17 = load i32, i32* %9
%18 = load i32, i32* %8
%19 = srem i32 %17, %18
store i32 %19, i32* %8
%20 = load i32, i32* %7
store i32 %20, i32* %9
br label %12
21: ; preds = %12
%22 = load i32, i32* %9
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %31
25: ; preds = %21
%26 = load i32, i32* %4
%27 = load i32, i32* %6
%28 = sdiv i32 %26, %27
%29 = load i32, i32* %3
%30 = mul nsw i32 %28, %29
store i32 %30, i32* %5
br label %31
31: ; preds = %25, %21
%32 = load i32, i32* %5
ret i32 %32
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %6, %4 ]
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = sdiv i32 %1, %10
%14 = mul nsw i32 %13, %0
br label %15
15: ; preds = %12, %9
%16 = phi i32 [ %14, %12 ], [ 0, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, short, int);
int cast_test() {
  int c;
  short b;
  char a;
  a = 68;
  b = a;
  c = b;
  printf("a = %d, b = %d, c= %d\n", a, b, c);
}


x86 assembly (clang, -O0):
<cast_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x44,-0xb(%rbp)
movsbl -0xb(%rbp),%eax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xb(%rbp),%dl
mov    -0xa(%rbp),%ax
mov    -0x8(%rbp),%ecx
lea    0xec4(%rip),%rdi
movsbl %dl,%esi
movswl %ax,%edx
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_test>:
lea    0xee9(%rip),%rdi
mov    $0x44,%esi
mov    $0x44,%edx
mov    $0x44,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"a = %d, b = %d, c= %d\0A\00"
define i32 @cast_test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
%4 = alloca i8
store i8 68, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i16
store i16 %6, i16* %3
%7 = load i16, i16* %3
%8 = sext i16 %7 to i32
store i32 %8, i32* %2
%9 = load i8, i8* %4
%10 = load i16, i16* %3
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 signext %9, i16 signext %10, i32 %11)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [23 x i8] c"a = %d, b = %d, c= %d\0A\00"
define i32 @cast_test() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 signext 68, i16 signext 68, i32 68)
ret i32 undef
}
void g_date_subtract_months() {}


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

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

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

LLVM IR (-O2):
define void @g_date_subtract_months() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void hit(void) { say("Owww, I could cut myself!", 1); }


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Owww, I could cut myself!\00"
define void @hit() {
%1 = call i32 @say(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Owww, I could cut myself!\00"
define void @hit() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t nsfGet_4568(uint16_t addr) {
  (void)addr;
  return 0x67;
}


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

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

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

LLVM IR (-O2):
define i32 @nsfGet_4568(i32 %0) {
ret i32 103
}
/* Variables and functions */
int isupper(int);
bool invalidFunctionArgBool_isupper(bool b, int c) {
  (void)isupper(b);
  return isupper(c != 0);
}


x86 assembly (clang, -O0):
<invalidFunctionArgBool_isupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <isupper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidFunctionArgBool_isupper>:
xor    %edi,%edi
test   %esi,%esi
setne  %dil
jmp    1030 <isupper@plt>

LLVM IR (-O0):
define i32 @invalidFunctionArgBool_isupper(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 = call i32 @isupper(i32 %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @isupper(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @invalidFunctionArgBool_isupper(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @isupper(i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t mp2vseqx_get_bitrate(const uint8_t *p_mp2vseqx) {
  return ((p_mp2vseqx[6] & 0x1f) << 7) | (p_mp2vseqx[7] >> 1);
}


x86 assembly (clang, -O0):
<mp2vseqx_get_bitrate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
and    $0x1f,%eax
shl    $0x7,%eax
mov    -0x8(%rbp),%rcx
mov    0x1c(%rcx),%ecx
sar    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_get_bitrate>:
mov    0x18(%rdi),%ecx
mov    0x1c(%rdi),%eax
and    $0x1f,%ecx
shl    $0x7,%ecx
sar    %eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mp2vseqx_get_bitrate(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
%5 = load i32, i32* %4
%6 = and i32 %5, 31
%7 = shl i32 %6, 7
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 7
%10 = load i32, i32* %9
%11 = ashr i32 %10, 1
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @mp2vseqx_get_bitrate(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = shl i32 %3, 7
%5 = and i32 %4, 3968
%6 = getelementptr inbounds i32, i32* %0, i64 7
%7 = load i32, i32* %6
%8 = ashr i32 %7, 1
%9 = or i32 %5, %8
ret i32 %9
}
/* Type definitions */
struct fdp1_context {
  int dummy;
};

/* Variables and functions */
scalar_t__ fdp1_pool_allocation_test(struct fdp1_context *);
int fdp1_allocation_tests(struct fdp1_context *fdp1) {
  unsigned int fail = 0;
  fail += fdp1_pool_allocation_test(fdp1);
  return fail;
}


x86 assembly (clang, -O0):
<fdp1_allocation_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fdp1_pool_allocation_test@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdp1_allocation_tests>:
jmp    1030 <fdp1_pool_allocation_test@plt>

LLVM IR (-O0):
%struct.fdp1_context = type { i32 }
define i32 @fdp1_allocation_tests(%struct.fdp1_context* %0) {
%2 = alloca %struct.fdp1_context*
%3 = alloca i32
store %struct.fdp1_context* %0, %struct.fdp1_context** %2
store i32 0, i32* %3
%4 = load %struct.fdp1_context*, %struct.fdp1_context** %2
%5 = call i64 @fdp1_pool_allocation_test(%struct.fdp1_context* %4)
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = add nsw i64 %7, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.fdp1_context = type { i32 }
define i32 @fdp1_allocation_tests(%struct.fdp1_context* %0) {
%2 = tail call i64 @fdp1_pool_allocation_test(%struct.fdp1_context* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int test_imm_29uint16_mem(unsigned short *val) {
  return ((*val) & (0x29 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_29uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x29,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_29uint16_mem>:
testb  $0x29,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_29uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 41
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void CopyRow_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @CopyRow_SSE2() {
ret void
}
extern int _open(const char *name, int flags, int mode) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_open(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ handle_34(int /*<<< orphan*/);
int gen_34() {
  handle_34(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_34>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_34@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_34() {
%1 = call i32 @handle_34(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_34() {
%1 = tail call i32 @handle_34(i32 0)
ret i32 0
}
/* Variables and functions */
int listxattr(const char *path, char *list, size_t size) { return 0; }


x86 assembly (clang, -O0):
<listxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @listxattr(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @listxattr(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_netstring_buffer_size();
int /*<<< orphan*/ test_netstring_encode_new();
int /*<<< orphan*/ test_netstring_read();
int main(void) {
  printf("Running test suite...\n");
  test_netstring_read();
  test_netstring_buffer_size();
  test_netstring_encode_new();
  printf("All tests passed!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <test_netstring_read@plt>
mov    $0x0,%al
call   1060 <test_netstring_buffer_size@plt>
mov    $0x0,%al
call   1040 <test_netstring_encode_new@plt>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test_netstring_read@plt>
xor    %eax,%eax
call   1060 <test_netstring_buffer_size@plt>
xor    %eax,%eax
call   1040 <test_netstring_encode_new@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Running test suite...\0A\00"
@.str.1 = [19 x i8] c"All tests passed!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test_netstring_read()
%4 = call i32 (...) @test_netstring_buffer_size()
%5 = call i32 (...) @test_netstring_encode_new()
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"Running test suite...\00"
@str.2 = [18 x i8] c"All tests passed!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_netstring_read()
%3 = tail call i32 (...) @test_netstring_buffer_size()
%4 = tail call i32 (...) @test_netstring_encode_new()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int test_imm_53uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x53 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_53uint64_lowword_mem>:
testb  $0x53,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_53uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 83
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct ui_file {
  int dummy;
};
struct cmd_list_element {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _(char *);
int /*<<< orphan*/ fprintf_filtered(struct ui_file *, int /*<<< orphan*/,
                                    char const *);
void show_target_charset_name(struct ui_file *file, int from_tty,
                              struct cmd_list_element *c, const char *value) {
  fprintf_filtered(file, _("The target character set is \"%s\".\n"), value);
}


x86 assembly (clang, -O0):
<show_target_charset_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <_@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    -0x20(%rbp),%rdx
call   1030 <fprintf_filtered@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_target_charset_name>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1040 <_@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf_filtered@plt>

LLVM IR (-O0):
%struct.ui_file = type { i32 }
%struct.cmd_list_element = type { i32 }
@.str = [35 x i8] c"The target character set is \22%s\22.\0A\00"
define void @show_target_charset_name(%struct.ui_file* %0, i32 %1, %struct.cmd_list_element* %2, i8* %3) {
%5 = alloca %struct.ui_file*
%6 = alloca i32
%7 = alloca %struct.cmd_list_element*
%8 = alloca i8*
store %struct.ui_file* %0, %struct.ui_file** %5
store i32 %1, i32* %6
store %struct.cmd_list_element* %2, %struct.cmd_list_element** %7
store i8* %3, i8** %8
%9 = load %struct.ui_file*, %struct.ui_file** %5
%10 = call i32 @_(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %8
%12 = call i32 @fprintf_filtered(%struct.ui_file* %9, i32 %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.ui_file = type { i32 }
%struct.cmd_list_element = type { i32 }
@.str = [35 x i8] c"The target character set is \22%s\22.\0A\00"
define void @show_target_charset_name(%struct.ui_file* %0, i32 %1, %struct.cmd_list_element* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @_(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @fprintf_filtered(%struct.ui_file* %0, i32 %5, i8* %3)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rol1(int);
int rol8(int);
uint32_t f(uint32_t x) {
  uint32_t x_rol1 = rol1(x);
  return x_rol1 & rol8(x) ^ rol1(x_rol1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <rol1@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <rol8@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <rol1@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <rol1@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <rol8@plt>
mov    %eax,%ebx
and    %ebp,%ebx
mov    %ebp,%edi
call   1030 <rol1@plt>
xor    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @rol1(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @rol8(i32 %7)
%9 = and i32 %6, %8
%10 = load i32, i32* %3
%11 = call i32 @rol1(i32 %10)
%12 = xor i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @rol1(i32 %0)
%3 = tail call i32 @rol8(i32 %0)
%4 = and i32 %3, %2
%5 = tail call i32 @rol1(i32 %2)
%6 = xor i32 %4, %5
ret i32 %6
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t rdtsc(void) {
  uint64_t res;
  asm volatile("rdtsc" : "=A"(res));
  return res;
}


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

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

LLVM IR (-O0):
define i8* @rdtsc() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @rdtsc() {
%1 = tail call i8* asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
unsigned int _Rand();
int /*<<< orphan*/ _Srand(unsigned int);
scalar_t__ getpid();
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void _AutoSrand() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  _Srand(_Rand() ^ (unsigned int)(tv.tv_sec) ^
         ((unsigned int)(tv.tv_usec) + (unsigned int)(getpid())));
}


x86 assembly (clang, -O0):
<_AutoSrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
mov    $0x0,%al
call   1030 <_Rand@plt>
mov    -0x8(%rbp),%rcx
xor    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0x18(%rbp),%edi
mov    %rax,%rcx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
xor    %eax,%edi
call   1060 <_Srand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_AutoSrand>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1050 <gettimeofday@plt>
xor    %eax,%eax
call   1030 <_Rand@plt>
mov    %eax,%ebx
xor    0x10(%rsp),%ebx
mov    0x8(%rsp),%ebp
xor    %eax,%eax
call   1040 <getpid@plt>
add    %eax,%ebp
xor    %ebx,%ebp
mov    %ebp,%edi
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <_Srand@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @_AutoSrand() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = call i32 (...) @_Rand()
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = xor i32 %3, %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = call i64 (...) @getpid()
%12 = trunc i64 %11 to i32
%13 = add i32 %10, %12
%14 = xor i32 %7, %13
%15 = call i32 @_Srand(i32 %14)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @_AutoSrand() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = tail call i32 (...) @_Rand()
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = xor i32 %4, %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = tail call i64 (...) @getpid()
%13 = trunc i64 %12 to i32
%14 = add i32 %13, %11
%15 = xor i32 %8, %14
%16 = tail call i32 @_Srand(i32 %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc10(void) {
  printf("Executing exitfunc10.\n");
  exit(0);
}


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc10.\00"
define void @exitfunc10() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct whoami_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ whoami_cmdline_parser_release(struct whoami_args_info *);
void whoami_cmdline_parser_free(struct whoami_args_info *args_info) {
  whoami_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<whoami_cmdline_parser_free>:
jmp    1030 <whoami_cmdline_parser_release@plt>

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

LLVM IR (-O2):
%struct.whoami_args_info = type { i32 }
define void @whoami_cmdline_parser_free(%struct.whoami_args_info* %0) {
%2 = tail call i32 @whoami_cmdline_parser_release(%struct.whoami_args_info* %0)
ret void
}
int test_imm_E2int16_mem(short *val) {
  return ((*val) & (0xE2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E2int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xe2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E2int16_mem>:
testb  $0xe2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E2int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 226
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
short int cast_ulong_short_fast(unsigned long int x) { return (short int)x; }


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

x86 assembly (clang, -O2):
<cast_ulong_short_fast>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define signext i16 @cast_ulong_short_fast(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @cast_ulong_short_fast(i64 %0) {
%2 = trunc i64 %0 to i16
ret i16 %2
}
void MT_trace_preempt_off(void) {}


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

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

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

LLVM IR (-O2):
define void @MT_trace_preempt_off() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flushbits(int, int *, int *);
unsigned int showbits(int, int, int, unsigned char *);
unsigned int getbits(int n, int *byte_index, int *bit_index,
                     unsigned char *buf) {
  unsigned int l;
  l = showbits(n, *byte_index, *bit_index, buf);
  flushbits(n, byte_index, bit_index);
  return l;
}


x86 assembly (clang, -O0):
<getbits>:
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    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rcx
call   1030 <showbits@plt>
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <flushbits@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbits>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%esi
mov    (%rdx),%edx
call   1030 <showbits@plt>
mov    %eax,%r15d
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <flushbits@plt>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getbits(i32 %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%10 = load i32, i32* %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i8*, i8** %8
%16 = call i32 @showbits(i32 %10, i32 %12, i32 %14, i8* %15)
store i32 %16, i32* %9
%17 = load i32, i32* %5
%18 = load i32*, i32** %6
%19 = load i32*, i32** %7
%20 = call i32 @flushbits(i32 %17, i32* %18, i32* %19)
%21 = load i32, i32* %9
ret i32 %21
}

LLVM IR (-O2):
define i32 @getbits(i32 %0, i32* %1, i32* %2, i8* %3) {
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = tail call i32 @showbits(i32 %0, i32 %5, i32 %6, i8* %3)
%8 = tail call i32 @flushbits(i32 %0, i32* %1, i32* %2)
ret i32 %7
}