xunge/DecIR huggingface dataset:
setNS(cp) char *cp;
{ set(cp, ""); }


x86 assembly (clang, -O0):
<setNS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <set@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setNS>:
lea    0xee9(%rip),%rsi
xor    %eax,%eax
jmp    1030 <set@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @setNS(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @set to i32 (i8*, i8*, ...)*)(i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @setNS(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @set to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
void screen_init(void) {
  initscr();
  noecho();
  cbreak();
  keypad(stdscr, TRUE);
  refresh();
}


x86 assembly (clang, -O0):
<screen_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1070 <noecho@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    0x2e67(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_init>:
push   %rax
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1070 <noecho@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <refresh@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define void @screen_init() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @noecho()
%3 = call i32 (...) @cbreak()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = call i32 @keypad(i32 %4, i32 %5)
%7 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define void @screen_init() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
%3 = tail call i32 (...) @cbreak()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = tail call i32 @keypad(i32 %4, i32 %5)
%7 = tail call i32 (...) @refresh()
ret void
}
void CC_PalLogInit(void) {}


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

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

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

LLVM IR (-O2):
define void @CC_PalLogInit() {
ret void
}
/* Variables and functions */
char *a();
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *b() {
  char *a_str = a();
  char *ret = (char *)malloc(strlen(a_str) + strlen(", world") + 1);
  strcpy(ret, a_str);
  strcat(ret, ", world");
  return ret;
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1060 <a@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
lea    0xe89(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <a@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1040 <strlen@plt>
lea    0x8(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
lea    0xe7c(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c", world\00"
define i8* @b() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @a()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @strlen(i8* %4)
%6 = call i64 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = add nsw i64 %5, %6
%8 = add nsw i64 %7, 1
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %2
%11 = load i8*, i8** %2
%12 = load i8*, i8** %1
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %2
%15 = call i32 @strcat(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [8 x i8] c", world\00"
define i8* @b() {
%1 = tail call i8* (...) @a()
%2 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%3 = add nsw i64 %2, 8
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
%7 = tail call i32 @strcat(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %5
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *);
void __func_minus_ptr(struct Var *avar, const char *areg, const char *lreg,
                      const char *rreg) {
  pA("%s = -%s;", areg, lreg);
}


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

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [10 x i8] c"%s = -%s;\00"
define void @__func_minus_ptr(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = call i32 @pA(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [10 x i8] c"%s = -%s;\00"
define void @__func_minus_ptr(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_clearsilver_comments() {
  test_parser_verify_parse(test_parser_sourcefile("clearsilver", " #comment"),
                           "clearsilver", "", "#comment", 0);
}


x86 assembly (clang, -O0):
<test_clearsilver_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec4(%rip),%rdx
lea    0xebf(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_clearsilver_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xecd(%rip),%rdx
lea    0xec8(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"clearsilver\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_clearsilver_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"clearsilver\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_clearsilver_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
int test_imm_7Auint16_mem(unsigned short *val) {
  return ((*val) & (-0x7A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Auint16_mem>:
movzwl (%rdi),%eax
test   $0xff86,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Auint16_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, -122
%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_7Auint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -122
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ff_hevc_put_hevc_uni_w_qpel_hv32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_hv32_12_sse4() {
ret void
}
/* Variables and functions */
int gsm_hexchar_to_int(char);
int gsm_hexchar_to_int0(char c) {
  int ret = gsm_hexchar_to_int(c);
  return (ret < 0) ? 0 : ret;
}


x86 assembly (clang, -O0):
<gsm_hexchar_to_int0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <gsm_hexchar_to_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    113e <gsm_hexchar_to_int0+0x2e>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <gsm_hexchar_to_int0+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsm_hexchar_to_int0>:
push   %rax
call   1030 <gsm_hexchar_to_int@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gsm_hexchar_to_int0(i8 signext %0) {
%2 = tail call i32 @gsm_hexchar_to_int(i8 signext %0)
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_usage(int code) {
  printf("usage: getscom [-c|--chip chip-id] addr\n");
  printf("       getscom -l|--list-chips\n");
  printf("       getscom -v|--version\n");
  exit(code);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"usage: getscom [-c|--chip chip-id] addr\0A\00"
@.str.1 = [32 x i8] c" getscom -l|--list-chips\0A\00"
@.str.2 = [29 x i8] c" getscom -v|--version\0A\00"
define void @print_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@str = [40 x i8] c"usage: getscom [-c|--chip chip-id] addr\00"
@str.3 = [31 x i8] c" getscom -l|--list-chips\00"
@str.4 = [28 x i8] c" getscom -v|--version\00"
define void @print_usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @exit(i32 %0)
unreachable
}
int compare(const char *s, const char *str, int len) {
  int i = 0;
  while (i < len && s[i] == str[i])
    i++;
  return i == len ? 1 : 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x19(%rbp)
jge    1147 <compare+0x47>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1157 <compare+0x57>
jmp    1165 <compare+0x65>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <compare+0x16>
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
test   %edx,%edx
jle    1127 <compare+0x27>
mov    %edx,%r8d
xor    %ecx,%ecx
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%eax
cmp    (%rsi,%rcx,1),%al
jne    1129 <compare+0x29>
add    $0x1,%rcx
cmp    %rcx,%r8
jne    1110 <compare+0x10>
mov    %r8d,%ecx
jmp    1129 <compare+0x29>
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %edx,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %28, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %26
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i8*, i8** %5
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %18, %24
br label %26
26: ; preds = %12, %8
%27 = phi i1 [ false, %8 ], [ %25, %12 ]
br i1 %27, label %28, label %31
28: ; preds = %26
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %8
31: ; preds = %26
%32 = load i32, i32* %7
%33 = load i32, i32* %6
%34 = icmp eq i32 %32, %33
%35 = zext i1 %34 to i64
%36 = select i1 %34, i32 1, i32 0
ret i32 %36
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %14
%8 = phi i64 [ 0, %5 ], [ %15, %14 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %1, i64 %8
%12 = load i8, i8* %11
%13 = icmp eq i8 %10, %12
br i1 %13, label %14, label %17
14: ; preds = %7
%15 = add nuw nsw i64 %8, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %19, label %7
17: ; preds = %7
%18 = trunc i64 %8 to i32
br label %19
19: ; preds = %14, %17, %3
%20 = phi i32 [ 0, %3 ], [ %18, %17 ], [ %2, %14 ]
%21 = icmp eq i32 %20, %2
%22 = zext i1 %21 to i32
ret i32 %22
}
/* Variables and functions */
int get16();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int show_ip() {
  int i, length;
  (void)get16();
  length = get16();
  printf("IP: length %d\n", length);
  for (i = 0; i < length - 4; i++)
    (void)getchar();
  return length;
}


x86 assembly (clang, -O0):
<show_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <get16@plt>
mov    $0x0,%al
call   1050 <get16@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x4,%ecx
cmp    %ecx,%eax
jge    1185 <show_ip+0x55>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115f <show_ip+0x2f>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_ip>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <get16@plt>
xor    %eax,%eax
call   1050 <get16@plt>
mov    %eax,%ebx
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
cmp    $0x5,%ebx
jl     116c <show_ip+0x3c>
mov    %ebx,%ebp
add    $0xfffffffc,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0xffffffff,%ebp
jne    1160 <show_ip+0x30>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"IP: length %d\0A\00"
define i32 @show_ip() {
%1 = tail call i32 (...) @get16()
%2 = tail call i32 (...) @get16()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add i32 %2, -4
%5 = icmp sgt i32 %2, 4
br i1 %5, label %6, label %11
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ 0, %0 ]
%8 = tail call i32 (...) @getchar()
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %4
br i1 %10, label %11, label %6
11: ; preds = %6, %0
ret i32 %2
}
/* Variables and functions */
size_t CountBitsInChar(void) {
  size_t count = 0;
  unsigned char bits = (unsigned char)-1;
  while (bits > 0) {
    bits >>= 1;
    ++count;
  }
  return count;
}


x86 assembly (clang, -O0):
<CountBitsInChar>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movb   $0xff,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jle    1138 <CountBitsInChar+0x38>
movzbl -0x9(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <CountBitsInChar+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @CountBitsInChar() {
ret i64 8
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int defines_str_32(int *, char const **);
int __attribute__((__unused__))
defines_str_16(int16_t *num, const char *argv[]) {
  int i, ret;
  ret = defines_str_32(&i, argv);
  *num = i;
  return ret;
}


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

x86 assembly (clang, -O2):
<defines_str_16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
call   1030 <defines_str_32@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @defines_str_16(i32* nocapture writeonly %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @defines_str_32(i32* %3, i8** %1)
%6 = load i32, i32* %3
store i32 %6, i32* %0
ret i32 %5
}
void Plain_RestoreGraphicState(void) {
  ;
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @Plain_RestoreGraphicState() {
ret void
}
int fprintf(fp, format)
char *format;
struct _buf *fp;
{
  int _fputc();
  return _spr(&format, &_fputc, fp);
}


x86 assembly (clang, -O0):
<fprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rsi
mov    $0x0,%al
call   1030 <_spr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprintf>:
push   %rax
mov    %rdi,%rdx
mov    %rsi,(%rsp)
mov    0x2ec1(%rip),%rsi
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <_spr@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct._buf = type opaque
define i32 @fprintf(%struct._buf* %0, i8* %1) {
%3 = alloca %struct._buf*
%4 = alloca i8*
store %struct._buf* %0, %struct._buf** %3
store i8* %1, i8** %4
%5 = load %struct._buf*, %struct._buf** %3
%6 = call i32 (i8**, i32 (...)*, %struct._buf*, ...) bitcast (i32 (...)* @_spr to i32 (i8**, i32 (...)*, %struct._buf*, ...)*)(i8** %4, i32 (...)* @_fputc, %struct._buf* %5)
ret i32 %6
}

LLVM IR (-O2):
%struct._buf = type opaque
define i32 @fprintf(%struct._buf* %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 (i8**, i32 (...)*, %struct._buf*, ...) bitcast (i32 (...)* @_spr to i32 (i8**, i32 (...)*, %struct._buf*, ...)*)(i8** %3, i32 (...)* @_fputc, %struct._buf* %0)
ret i32 %4
}
int unsignedCharCmpFn(const void *p1, const void *p2) {
  unsigned char v1, v2;
  v1 = *((unsigned char *)p1);
  v2 = *((unsigned char *)p2);
  if (v1 == v2)
    return 0;
  return (v1 < v2) ? -1 : +1;
}


x86 assembly (clang, -O0):
<unsignedCharCmpFn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jne    113a <unsignedCharCmpFn+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1154 <unsignedCharCmpFn+0x54>
movzbl -0x19(%rbp),%edx
movzbl -0x1a(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @unsignedCharCmpFn(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
%6 = icmp ult i8 %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
int test_imm_1Auint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x1A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Auint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 26
%7 = icmp ne i64 %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_1Auint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 111669149696
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
unsigned int htonl(unsigned int);
unsigned int make_mask(unsigned int length) {
  unsigned int res;
  if ((length < 8) || (length > 30))
    return -1;
  res = 0xFFFFFFFF;
  res = htonl(res << (32 - length));
  return res;
}


x86 assembly (clang, -O0):
<make_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jb     112f <make_mask+0x1f>
cmpl   $0x1e,-0x8(%rbp)
jbe    113b <make_mask+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <make_mask+0x4d>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edi
call   1030 <htonl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_mask>:
lea    -0x1f(%rdi),%eax
cmp    $0xffffffe9,%eax
jae    111e <make_mask+0xe>
mov    $0xffffffff,%eax
ret
neg    %dil
mov    $0xffffffff,%eax
mov    %edi,%ecx
shl    %cl,%eax
mov    %eax,%edi
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i32 @make_mask(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 8
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp ugt i32 %8, 30
br i1 %9, label %10, label %11
10: ; preds = %7, %1
store i32 -1, i32* %2
br label %18
11: ; preds = %7
store i32 -1, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sub i32 32, %13
%15 = shl i32 %12, %14
%16 = call i32 @htonl(i32 %15)
store i32 %16, i32* %4
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %11, %10
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @make_mask(i32 %0) {
%2 = add i32 %0, -31
%3 = icmp ult i32 %2, -23
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = sub nuw nsw i32 32, %0
%6 = shl nsw i32 -1, %5
%7 = tail call i32 @htonl(i32 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
void ASN1_UTCTIME_set(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_UTCTIME_set() {
ret void
}
void clearBuffer(char *buff) {
  int i;
  for (i = 0; i < 80; i++) {
    buff[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<clearBuffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x50,-0xc(%rbp)
jge    1133 <clearBuffer+0x33>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clearBuffer+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBuffer>:
xorps  %xmm0,%xmm0
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @clearBuffer(i8* nocapture writeonly %0) {
ret void
}
/* Variables and functions */
float powf(float, float);
float xpowf(float x) { return powf(x, 23.4f); }


x86 assembly (clang, -O0):
<xpowf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
call   1030 <powf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xpowf>:
movss  0xee8(%rip),%xmm1
jmp    1030 <powf@plt>

LLVM IR (-O0):
define float @xpowf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @powf(float %3, float 0x4037666660000000)
ret float %4
}

LLVM IR (-O2):
define float @xpowf(float %0) {
%2 = tail call float @powf(float %0, float 0x4037666660000000)
ret float %2
}
/* Variables and functions */
void __nv_sincospi(double, double *, double *);
void sincospi(double __a, double *__sptr, double *__cptr) {
  return __nv_sincospi(__a, __sptr, __cptr);
}


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

x86 assembly (clang, -O2):
<sincospi>:
jmp    1030 <__nv_sincospi@plt>

LLVM IR (-O0):
define void @sincospi(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* %4
%8 = load double*, double** %5
%9 = load double*, double** %6
ret void
}

LLVM IR (-O2):
define void @sincospi(double %0, double* %1, double* %2) {
tail call void @__nv_sincospi(double %0, double* %1, double* %2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t adjust_seed_7(uint32_t seed) { return seed ^ (seed << 7); }


x86 assembly (clang, -O0):
<adjust_seed_7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x7,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_seed_7>:
mov    %edi,%eax
shl    $0x7,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @adjust_seed_7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 7
%6 = xor i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @adjust_seed_7(i32 %0) {
%2 = shl i32 %0, 7
%3 = xor i32 %2, %0
ret i32 %3
}
int do_696() { return 696; }


x86 assembly (clang, -O0):
<do_696>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_696() {
ret i32 696
}

LLVM IR (-O2):
define i32 @do_696() {
ret i32 696
}
int emac2_ifouterrors_set(unsigned int dev_id,
                          union emac2_ifouterrors_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac2_ifouterrors_u = type opaque
define i32 @emac2_ifouterrors_set(i32 %0, %union.emac2_ifouterrors_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_ifouterrors_u*
store i32 %0, i32* %3
store %union.emac2_ifouterrors_u* %1, %union.emac2_ifouterrors_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_ifouterrors_u = type opaque
define i32 @emac2_ifouterrors_set(i32 %0, %union.emac2_ifouterrors_u* nocapture readnone %1) {
ret i32 1
}
void add_suites() {
  extern void _add_suite_tests_check_tests(void);
  _add_suite_tests_check_tests();
  ;
  extern void _add_suite_tests_hydrogen_tests(void);
  _add_suite_tests_hydrogen_tests();
  ;
  extern void _add_suite_tests_bug_tests(void);
  _add_suite_tests_bug_tests();
  ;
}


x86 assembly (clang, -O0):
<add_suites>:
push   %rbp
mov    %rsp,%rbp
call   1040 <_add_suite_tests_check_tests@plt>
call   1030 <_add_suite_tests_hydrogen_tests@plt>
call   1050 <_add_suite_tests_bug_tests@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_suites>:
push   %rax
call   1040 <_add_suite_tests_check_tests@plt>
call   1030 <_add_suite_tests_hydrogen_tests@plt>
pop    %rax
jmp    1050 <_add_suite_tests_bug_tests@plt>

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

LLVM IR (-O2):
define void @add_suites() {
tail call void @_add_suite_tests_check_tests()
tail call void @_add_suite_tests_hydrogen_tests()
tail call void @_add_suite_tests_bug_tests()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int do_i2b_bio(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk) {
  return do_i2b_bio(out, pk, 0);
}


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

x86 assembly (clang, -O2):
<i2b_PrivateKey_bio>:
xor    %edx,%edx
jmp    1030 <do_i2b_bio@plt>

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

LLVM IR (-O2):
define i32 @i2b_PrivateKey_bio(i32* %0, i32* %1) {
%3 = tail call i32 @do_i2b_bio(i32* %0, i32* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
int puts(char *s) {
  write(1, s, strlen(s));
  write(1, "\n", 1);
  return 1;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xea7(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xec1(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
%7 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 1
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 1
}
unsigned int WYG_get_frame_dims() {
  return ((28 & 0xFF) << 24) | ((4 & 0xFF) << 16) | ((4 & 0xFF) << 8) |
         (4 & 0xFF);
}


x86 assembly (clang, -O0):
<WYG_get_frame_dims>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c040404,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @WYG_get_frame_dims() {
ret i32 470025220
}

LLVM IR (-O2):
define i32 @WYG_get_frame_dims() {
ret i32 470025220
}
unsigned int shift(unsigned int value, int n) {
  if (n > 0)
    value <<= n;
  else
    value >>= -n;
  return value;
}


x86 assembly (clang, -O0):
<shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1124 <shift+0x24>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <shift+0x31>
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift>:
mov    %edi,%eax
mov    %esi,%ecx
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
test   %esi,%esi
cmovle %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @shift(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = shl i32 %0, %1
%5 = sub nsw i32 0, %1
%6 = lshr i32 %0, %5
%7 = select i1 %3, i32 %4, i32 %6
ret i32 %7
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, char *);
int read_line(char *, int);
int /*<<< orphan*/ reverse(char *, int);
int main() {
  char buf[1000 + 1];
  int len;
  while ((len = read_line(buf, 1000)) != EOF) {
    reverse(buf, len);
    printf("%s\n", buf);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <read_line@plt>
mov    %eax,-0x3f4(%rbp)
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%eax
je     1192 <main+0x62>
lea    -0x3f0(%rbp),%rdi
mov    -0x3f4(%rbp),%esi
call   1030 <reverse@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <read_line@plt>
mov    0x2e98(%rip),%r15
cmp    (%r15),%eax
je     1187 <main+0x57>
mov    %rsp,%rbx
lea    0xea1(%rip),%r14
nop
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <read_line@plt>
cmp    (%r15),%eax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1001 x i8]
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %9, %0
%5 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%6 = call i32 @read_line(i8* %5, i32 1000)
store i32 %6, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%11 = load i32, i32* %3
%12 = call i32 @reverse(i8* %10, i32 %11)
%13 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %4
15: ; preds = %4
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1001 x i8]
%2 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 0
%3 = call i32 @read_line(i8* %2, i32 1000)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %3, %0 ]
%8 = call i32 @reverse(i8* %2, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%10 = call i32 @read_line(i8* %2, i32 1000)
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %6
13: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int uriFilenameToUriStringW(int /*<<< orphan*/ const *, int /*<<< orphan*/ *,
                            int);
int uriUnixFilenameToUriStringW(const wchar_t *filename, wchar_t *uriString) {
  return uriFilenameToUriStringW(filename, uriString, 1);
}


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

x86 assembly (clang, -O2):
<uriUnixFilenameToUriStringW>:
mov    $0x1,%edx
jmp    1030 <uriFilenameToUriStringW@plt>

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

LLVM IR (-O2):
define i32 @uriUnixFilenameToUriStringW(i32* %0, i32* %1) {
%3 = tail call i32 @uriFilenameToUriStringW(i32* %0, i32* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char LoadRegister(char offset, char *registers) {
  if (offset == 0b00010110) {
    printf("accessing PC/CR violated.~\n\r");
    return 0x00;
  }
  return registers[(int)offset];
}


x86 assembly (clang, -O0):
<LoadRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x16,%eax
jne    1144 <LoadRegister+0x34>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movb   $0x0,-0x1(%rbp)
jmp    1155 <LoadRegister+0x45>
mov    -0x10(%rbp),%rax
movsbl -0x2(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoadRegister>:
push   %rax
cmp    $0x16,%dil
jne    1127 <LoadRegister+0x17>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
movsbq %dil,%rax
mov    (%rsi,%rax,1),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"accessing PC/CR violated.~\0A\0D\00"
define signext i8 @LoadRegister(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8*
store i8 %0, i8* %4
store i8* %1, i8** %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 22
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i8 0, i8* %3
br label %18
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
store i8 %17, i8* %3
br label %18
18: ; preds = %11, %9
%19 = load i8, i8* %3
ret i8 %19
}

LLVM IR (-O2):
@.str = [29 x i8] c"accessing PC/CR violated.~\0A\0D\00"
define signext i8 @LoadRegister(i8 signext %0, i8* nocapture %1) {
%3 = icmp eq i8 %0, 22
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = sext i8 %0 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
br label %10
10: ; preds = %6, %4
%11 = phi i8 [ 0, %4 ], [ %9, %6 ]
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_banner() {
  printf(
      "MiniZip 0.15, demo of zLib + Zip package written by Gilles Vollant\n");
  printf("more info at http://wwww.winimage/zLibDll/unzip.htm\n\n");
}


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

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

LLVM IR (-O0):
@.str = [68 x i8] c"MiniZip 0.15, demo of zLib + Zip package written by Gilles Vollant\0A\00"
@.str.1 = [54 x i8] c"more info at http://wwww.winimage/zLibDll/unzip.htm\0A\0A\00"
define void @do_banner() {
%1 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [67 x i8] c"MiniZip 0.15, demo of zLib + Zip package written by Gilles Vollant\00"
@str.2 = [53 x i8] c"more info at http://wwww.winimage/zLibDll/unzip.htm\0A\00"
define void @do_banner() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.2, i64 0, i64 0))
ret void
}
int always(int i, struct ks10_uinsn *insn) { return 1; }


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

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

LLVM IR (-O0):
%struct.ks10_uinsn = type opaque
define i32 @always(i32 %0, %struct.ks10_uinsn* %1) {
%3 = alloca i32
%4 = alloca %struct.ks10_uinsn*
store i32 %0, i32* %3
store %struct.ks10_uinsn* %1, %struct.ks10_uinsn** %4
ret i32 1
}

LLVM IR (-O2):
%struct.ks10_uinsn = type opaque
define i32 @always(i32 %0, %struct.ks10_uinsn* nocapture readnone %1) {
ret i32 1
}