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

/* Variables and functions */
int /*<<< orphan*/ geteuid();
int /*<<< orphan*/ getgid();
int getpeereid(int s, uid_t *euid, gid_t *gid) {
  *euid = geteuid();
  *gid = getgid();
  return (0);
}


x86 assembly (clang, -O0):
<getpeereid>:
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 <geteuid@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1040 <getgid@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpeereid>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <geteuid@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1040 <getgid@plt>
mov    %eax,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @getpeereid(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 = call i32 (...) @geteuid()
%8 = load i32*, i32** %5
store i32 %7, i32* %8
%9 = call i32 (...) @getgid()
%10 = load i32*, i32** %6
store i32 %9, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @getpeereid(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 (...) @geteuid()
store i32 %4, i32* %1
%5 = tail call i32 (...) @getgid()
store i32 %5, i32* %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit_manager_req();
int d2mce_exit() {
  exit_manager_req();
  return 1;
}


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

x86 assembly (clang, -O2):
<d2mce_exit>:
push   %rax
xor    %eax,%eax
call   1030 <exit_manager_req@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @d2mce_exit() {
%1 = call i32 (...) @exit_manager_req()
ret i32 1
}

LLVM IR (-O2):
define i32 @d2mce_exit() {
%1 = tail call i32 (...) @exit_manager_req()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_mod(void) {
  gen_pop();
  gen_call("_mod");
}


x86 assembly (clang, -O0):
<gen_mod>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_mod>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"_mod\00"
define void @gen_mod() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"_mod\00"
define void @gen_mod() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t mbrtowc(int /*<<< orphan*/ *, char const *, size_t,
               int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) size_t
softboundmpx_mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) {
  return mbrtowc(pwc, s, n, ps);
}


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

x86 assembly (clang, -O2):
<softboundmpx_mbrtowc>:
jmp    1030 <mbrtowc@plt>

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

LLVM IR (-O2):
define weak i64 @softboundmpx_mbrtowc(i32* %0, i8* %1, i64 %2, i32* %3) {
%5 = tail call i64 @mbrtowc(i32* %0, i8* %1, i64 %2, i32* %3)
ret i64 %5
}
const char *get_lame_url(void) {
  static const char *const str = "http://www.mp3dev.org/";
  return str;
}


x86 assembly (clang, -O0):
<get_lame_url>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lame_url>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@get_lame_url.str = internal constant i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0)
@.str = [23 x i8] c"http://www.mp3dev.org/\00"
define i8* @get_lame_url() {
ret i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [23 x i8] c"http://www.mp3dev.org/\00"
define i8* @get_lame_url() {
ret i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void kernel__Float__output(double self) {
  printf("%f\n", self);
RET_LABEL:;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define void @kernel__Float__output(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
br label %5
5: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @kernel__Float__output(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
adrreg0imm1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (p0[10000000]) = 33; }


x86 assembly (clang, -O0):
<adrreg0imm1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movw   $0x21,0x1312d00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0imm1_set>:
movw   $0x21,0x1312d00(%r8)
ret

LLVM IR (-O0):
define i32 @adrreg0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = getelementptr inbounds i16, i16* %16, i64 10000000
store i16 33, i16* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @adrreg0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
store i16 33, i16* %7
ret i32 undef
}
int f(int a) { return a / 10; }


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

x86 assembly (clang, -O2):
<f>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = sdiv i32 %0, 10
ret i32 %2
}
/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ fs_exsists(char const *);
int /*<<< orphan*/ fs_mode(char const *);
int fs_is_dir(const char *restrict filepath) {
  if (fs_exsists(filepath) && S_ISDIR(fs_mode(filepath))) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fs_is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <fs_exsists@plt>
cmp    $0x0,%rax
je     1175 <fs_is_dir+0x45>
mov    -0x10(%rbp),%rdi
call   1030 <fs_mode@plt>
mov    %eax,%edi
call   1040 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1175 <fs_is_dir+0x45>
movl   $0x1,-0x4(%rbp)
jmp    117c <fs_is_dir+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_is_dir>:
push   %rbx
mov    %rdi,%rbx
call   1050 <fs_exsists@plt>
test   %rax,%rax
je     115c <fs_is_dir+0x2c>
mov    %rbx,%rdi
call   1030 <fs_mode@plt>
mov    %eax,%edi
call   1040 <S_ISDIR@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     115c <fs_is_dir+0x2c>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fs_is_dir(i8* noalias %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @fs_exsists(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @fs_mode(i8* %8)
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7
store i32 1, i32* %2
br label %14
13: ; preds = %7, %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @fs_is_dir(i8* noalias %0) {
%2 = tail call i64 @fs_exsists(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @fs_mode(i8* %0)
%6 = tail call i64 @S_ISDIR(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 0, %8 ], [ 1, %4 ]
ret i32 %10
}
char *element_prompt_data_get_heading(char *element_name, char *heading) {
  if (heading)
    return heading;
  else
    return element_name;
}


x86 assembly (clang, -O0):
<element_prompt_data_get_heading>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1124 <element_prompt_data_get_heading+0x24>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <element_prompt_data_get_heading+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<element_prompt_data_get_heading>:
mov    %rdi,%rax
test   %rsi,%rsi
cmovne %rsi,%rax
ret

LLVM IR (-O0):
define i8* @element_prompt_data_get_heading(i8* %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** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i8*, i8** %5
store i8* %9, i8** %3
br label %12
10: ; preds = %2
%11 = load i8*, i8** %4
store i8* %11, i8** %3
br label %12
12: ; preds = %10, %8
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @element_prompt_data_get_heading(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %1, null
%4 = select i1 %3, i8* %0, i8* %1
ret i8* %4
}
void tap_result_stop_run(struct test_result *result) {}


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

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

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

LLVM IR (-O2):
%struct.test_result = type opaque
define void @tap_result_stop_run(%struct.test_result* nocapture %0) {
ret void
}
unsigned short unsignedshort_ignoring_longint(unsigned short x, long int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshort_ignoring_longint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @unsignedshort_ignoring_longint(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshort_ignoring_longint(i16 returned zeroext %0, i64 %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ file_close_all();
void dw_quit(void) { file_close_all(); }


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

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

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

LLVM IR (-O2):
define void @dw_quit() {
%1 = tail call i32 (...) @file_close_all()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void Debug(char *mesg, int terminate) {
  if (0 || terminate)
    printf("%s\n", mesg);
  if (terminate)
    exit(1);
}


x86 assembly (clang, -O0):
<Debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1149 <Debug+0x29>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     115d <Debug+0x3d>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Debug>:
test   %esi,%esi
jne    1125 <Debug+0x5>
ret
push   %rax
mov    %rdi,%rax
lea    0xed0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @Debug(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void print_int_compare(char *title, int v1, int v2, char *cont) {
  if (v1 != v2) {
    printf("FAILED - %10s\n", title);
    strcpy(cont, "P");
  } else
    printf("%-10s ......OK \n", title);
}


x86 assembly (clang, -O0):
<print_int_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1167 <print_int_compare+0x47>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1177 <print_int_compare+0x57>
mov    -0x8(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int_compare>:
mov    %rdi,%rax
cmp    %edx,%esi
jne    1136 <print_int_compare+0x16>
lea    0xee3(%rip),%rdi
mov    %rax,%rsi
jmp    1040 <printf@plt>
push   %rbx
mov    %rcx,%rbx
lea    0xebf(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"FAILED - %10s\0A\00"
@.str.1 = [2 x i8] c"P\00"
@.str.2 = [17 x i8] c"%-10s ......OK \0A\00"
define void @print_int_compare(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %8
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
17: ; preds = %4
%18 = load i8*, i8** %5
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %17, %12
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"FAILED - %10s\0A\00"
@.str.1 = [2 x i8] c"P\00"
@.str.2 = [17 x i8] c"%-10s ......OK \0A\00"
define void @print_int_compare(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %1, %2
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %4
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %11
11: ; preds = %9, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ usb_sendall_len(char *, int /*<<< orphan*/);
void usb_sendall(char *buf) { usb_sendall_len(buf, strlen(buf)); }


x86 assembly (clang, -O0):
<usb_sendall>:
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   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <usb_sendall_len@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_sendall>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <usb_sendall_len@plt>

LLVM IR (-O0):
define void @usb_sendall(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 @usb_sendall_len(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @usb_sendall(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @usb_sendall_len(i8* %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int /*<<< orphan*/ const *, int);
unsigned _get_short(const uint8_t *buf) {
  uint16_t _tmp;
  memcpy(&_tmp, buf, 2);
  return _tmp;
}


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

x86 assembly (clang, -O2):
<_get_short>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_get_short(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
struct player {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ player_get_sprite(struct player *);
int /*<<< orphan*/ sprite_set_col(int /*<<< orphan*/, int);
int /*<<< orphan*/ sprite_set_row(int /*<<< orphan*/, int);
void player_set_pos(struct player *p, int new_col, int new_row) {
  if (p == NULL)
    return;
  sprite_set_col(player_get_sprite(p), new_col);
  sprite_set_row(player_get_sprite(p), new_row);
}


x86 assembly (clang, -O0):
<player_set_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1152 <player_set_pos+0x22>
jmp    1178 <player_set_pos+0x48>
mov    -0x8(%rbp),%rdi
call   1030 <player_get_sprite@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1050 <sprite_set_col@plt>
mov    -0x8(%rbp),%rdi
call   1030 <player_get_sprite@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%esi
call   1040 <sprite_set_row@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<player_set_pos>:
test   %rdi,%rdi
je     1165 <player_set_pos+0x35>
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <player_get_sprite@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1050 <sprite_set_col@plt>
mov    %rbx,%rdi
call   1030 <player_get_sprite@plt>
mov    %eax,%edi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sprite_set_row@plt>
ret

LLVM IR (-O0):
%struct.player = type { i32 }
define void @player_set_pos(%struct.player* %0, i32 %1, i32 %2) {
%4 = alloca %struct.player*
%5 = alloca i32
%6 = alloca i32
store %struct.player* %0, %struct.player** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.player*, %struct.player** %4
%8 = icmp eq %struct.player* %7, null
br i1 %8, label %9, label %10
9: ; preds = %3
br label %19
10: ; preds = %3
%11 = load %struct.player*, %struct.player** %4
%12 = call i32 @player_get_sprite(%struct.player* %11)
%13 = load i32, i32* %5
%14 = call i32 @sprite_set_col(i32 %12, i32 %13)
%15 = load %struct.player*, %struct.player** %4
%16 = call i32 @player_get_sprite(%struct.player* %15)
%17 = load i32, i32* %6
%18 = call i32 @sprite_set_row(i32 %16, i32 %17)
br label %19
19: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
%struct.player = type { i32 }
define void @player_set_pos(%struct.player* %0, i32 %1, i32 %2) {
%4 = icmp eq %struct.player* %0, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i32 @player_get_sprite(%struct.player* %0)
%7 = tail call i32 @sprite_set_col(i32 %6, i32 %1)
%8 = tail call i32 @player_get_sprite(%struct.player* %0)
%9 = tail call i32 @sprite_set_row(i32 %8, i32 %2)
br label %10
10: ; preds = %3, %5
ret void
}
int main(argc, argv)
int argc;
char **argv;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ function_parent();
int /*<<< orphan*/ putchar(char);
int main(void) {
  int element = 10;
  while (--element)
    function_parent();
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1154 <main+0x34>
mov    $0x0,%al
call   1040 <function_parent@plt>
jmp    1136 <main+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <function_parent@plt>
xor    %eax,%eax
call   1040 <function_parent@plt>
xor    %eax,%eax
call   1040 <function_parent@plt>
xor    %eax,%eax
call   1040 <function_parent@plt>
xor    %eax,%eax
call   1040 <function_parent@plt>
xor    %eax,%eax
call   1040 <function_parent@plt>
xor    %eax,%eax
call   1040 <function_parent@plt>
xor    %eax,%eax
call   1040 <function_parent@plt>
xor    %eax,%eax
call   1040 <function_parent@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @function_parent()
br label %3
9: ; preds = %3
%10 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @function_parent()
%2 = tail call i32 (...) @function_parent()
%3 = tail call i32 (...) @function_parent()
%4 = tail call i32 (...) @function_parent()
%5 = tail call i32 (...) @function_parent()
%6 = tail call i32 (...) @function_parent()
%7 = tail call i32 (...) @function_parent()
%8 = tail call i32 (...) @function_parent()
%9 = tail call i32 (...) @function_parent()
%10 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
long __ccaprice_syscall_args_3(long A0, long A1, long A2, long A3) {
  unsigned long R;
  __asm__ __volatile__("int $0x80"
                       : "=a"(R)
                       : "a"(A0), "b"(A1), "c"(A2), "d"(A3)
                       : "memory");
  return R;
}


x86 assembly (clang, -O0):
<__ccaprice_syscall_args_3>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rbx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rdx
int    $0x80
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ccaprice_syscall_args_3>:
push   %rbx
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %r8,%rdx
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__ccaprice_syscall_args_3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = call i64 asm sideeffect "int $$0x80", "={ax},{ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %10, i64 %11, i64 %12, i64 %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @__ccaprice_syscall_args_3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 asm sideeffect "int $$0x80", "={ax},{ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3)
ret i64 %5
}
void dm_uevent_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @dm_uevent_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stepGame();
void timerHandler(void) { stepGame(); }


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

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

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

LLVM IR (-O2):
define void @timerHandler() {
%1 = tail call i32 (...) @stepGame()
ret void
}
/* Variables and functions */
long double exp10l(long double);
long double test1l(long double x) { return exp10l(x); }


x86 assembly (clang, -O0):
<test1l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <exp10l@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1l>:
jmp    1030 <exp10l@plt>

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

LLVM IR (-O2):
define x86_fp80 @test1l(x86_fp80 %0) {
%2 = tail call x86_fp80 @exp10l(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ cblas_ccopy(int const, void const *, int const, void *,
                               int const);
void c_ccopy(const int N, const void *X, const int strideX, void *Y,
             const int strideY) {
  cblas_ccopy(N, X, strideX, Y, strideY);
}


x86 assembly (clang, -O0):
<c_ccopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <cblas_ccopy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_ccopy>:
jmp    1030 <cblas_ccopy@plt>

LLVM IR (-O0):
define void @c_ccopy(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = call i32 @cblas_ccopy(i32 %11, i8* %12, i32 %13, i8* %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @c_ccopy(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @cblas_ccopy(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4)
ret void
}
double CalcKaiserWidth(const double rejection, const int order) {
  double w_t = 2.0 * (3.14159265358979323846);
  if (rejection > 21.0)
    return (rejection - 7.95) / (order * 2.285 * w_t);
  return 5.79 / (order * w_t);
}


x86 assembly (clang, -O0):
<CalcKaiserWidth>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeda(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1165 <CalcKaiserWidth+0x65>
movsd  -0x10(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xeca(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <CalcKaiserWidth+0x80>
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  0xe99(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcKaiserWidth>:
movapd %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
ucomisd %xmm0,%xmm1
cvtsi2sd %edi,%xmm2
movsd  0xeec(%rip),%xmm3
addsd  %xmm1,%xmm3
jbe    112a <CalcKaiserWidth+0x2a>
mulsd  0xee6(%rip),%xmm2
cmpltsd %xmm1,%xmm0
andpd  %xmm0,%xmm3
movsd  0xedd(%rip),%xmm1
andnpd %xmm1,%xmm0
orpd   %xmm3,%xmm0
mulsd  0xed5(%rip),%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @CalcKaiserWidth(double %0, i32 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
store double %0, double* %4
store i32 %1, i32* %5
store double 0x401921FB54442D18, double* %6
%7 = load double, double* %4
%8 = fcmp ogt double %7, 2.100000e+01
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load double, double* %4
%11 = fsub double %10, 7.950000e+00
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 2.285000e+00
%15 = load double, double* %6
%16 = fmul double %14, %15
%17 = fdiv double %11, %16
store double %17, double* %3
br label %24
18: ; preds = %2
%19 = load i32, i32* %5
%20 = sitofp i32 %19 to double
%21 = load double, double* %6
%22 = fmul double %20, %21
%23 = fdiv double 5.790000e+00, %22
store double %23, double* %3
br label %24
24: ; preds = %18, %9
%25 = load double, double* %3
ret double %25
}

LLVM IR (-O2):
define double @CalcKaiserWidth(double %0, i32 %1) {
%3 = fcmp ogt double %0, 2.100000e+01
%4 = sitofp i32 %1 to double
%5 = fadd double %0, -7.950000e+00
%6 = sitofp i32 %1 to double
%7 = fmul double %6, 2.285000e+00
%8 = select i1 %3, double %7, double %4
%9 = select i1 %3, double %5, double 5.790000e+00
%10 = fmul double %8, 0x401921FB54442D18
%11 = fdiv double %9, %10
ret double %11
}
int lqtvq_clamp32767S(int x) {
  return ((x < (-32767)) ? (-32767) : ((x > 32767) ? 32767 : x));
}


x86 assembly (clang, -O0):
<lqtvq_clamp32767S>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffff8001,-0x4(%rbp)
jge    1121 <lqtvq_clamp32767S+0x21>
mov    $0xffff8001,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <lqtvq_clamp32767S+0x47>
cmpl   $0x7fff,-0x4(%rbp)
jle    113b <lqtvq_clamp32767S+0x3b>
mov    $0x7fff,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <lqtvq_clamp32767S+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lqtvq_clamp32767S>:
cmp    $0x7fff,%edi
mov    $0x7fff,%ecx
cmovl  %edi,%ecx
cmp    $0xffff8002,%ecx
mov    $0xffff8001,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @lqtvq_clamp32767S(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, -32767
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 32767
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ 32767, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi i32 [ -32767, %5 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @lqtvq_clamp32767S(i32 %0) {
%2 = icmp slt i32 %0, 32767
%3 = select i1 %2, i32 %0, i32 32767
%4 = icmp sgt i32 %3, -32767
%5 = select i1 %4, i32 %3, i32 -32767
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Oburni();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Vuvedete Izrechenie/Duma: ");
  Oburni();
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [27 x i8] c"Vuvedete Izrechenie/Duma: \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @Oburni()
ret i32 0
}
int putchr(ch)
int ch;
{ return putchar(ch); }


x86 assembly (clang, -O0):
<putchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @putchr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @putchr(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef char int32_t;

/* Variables and functions */
scalar_t__ LexIsDigit(char);
int32_t GetHexValue(char ch) {
  if (LexIsDigit(ch)) {
    return ch - '0';
  } else {
    if ('A' <= ch && ch <= 'F') {
      return ch - 'A' + 10;
    } else {
      return ch - 'a' + 10;
    }
  }
}


x86 assembly (clang, -O0):
<GetHexValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <LexIsDigit@plt>
cmp    $0x0,%rax
je     1140 <GetHexValue+0x30>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    117d <GetHexValue+0x6d>
movsbl -0x2(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1170 <GetHexValue+0x60>
movsbl -0x2(%rbp),%eax
cmp    $0x46,%eax
jg     1170 <GetHexValue+0x60>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    117d <GetHexValue+0x6d>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetHexValue>:
push   %rbx
mov    %edi,%ebx
call   1030 <LexIsDigit@plt>
lea    -0x41(%rbx),%ecx
cmp    $0x6,%cl
setb   %cl
shl    $0x5,%cl
add    $0xa9,%cl
test   %rax,%rax
movzbl %cl,%ecx
mov    $0xd0,%eax
cmove  %ecx,%eax
add    %bl,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @GetHexValue(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @LexIsDigit(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 48
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %32
12: ; preds = %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sle i32 65, %14
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 70
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 65
%24 = add nsw i32 %23, 10
%25 = trunc i32 %24 to i8
store i8 %25, i8* %2
br label %32
26: ; preds = %16, %12
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = sub nsw i32 %28, 97
%30 = add nsw i32 %29, 10
%31 = trunc i32 %30 to i8
store i8 %31, i8* %2
br label %32
32: ; preds = %26, %20, %7
%33 = load i8, i8* %2
ret i8 %33
}

LLVM IR (-O2):
define signext i8 @GetHexValue(i8 signext %0) {
%2 = tail call i64 @LexIsDigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 6
%6 = select i1 %5, i8 -55, i8 -87
%7 = select i1 %3, i8 %6, i8 -48
%8 = add i8 %7, %0
ret i8 %8
}
int comp_descend_int(const void *s1, const void *s2) {
  int *ss1, *ss2;
  ss1 = (int *)s1;
  ss2 = (int *)s2;
  if ((ss1)[0] > (ss2)[0]) {
    return -1;
  } else if ((ss1)[0] < (ss2)[0]) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<comp_descend_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    113a <comp_descend_int+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <comp_descend_int+0x64>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    1158 <comp_descend_int+0x58>
movl   $0x1,-0x4(%rbp)
jmp    1164 <comp_descend_int+0x64>
jmp    115d <comp_descend_int+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_descend_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp_descend_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = icmp slt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
struct metasurface {
  int dummy;
};

/* Variables and functions */
scalar_t__ msurf_is_enabled(struct metasurface *, int);
int msurf_get_inside(struct metasurface *ms) {
  return msurf_is_enabled(ms, 1) ? 0 : 1;
}


x86 assembly (clang, -O0):
<msurf_get_inside>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <msurf_is_enabled@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msurf_get_inside>:
push   %rax
mov    $0x1,%esi
call   1030 <msurf_is_enabled@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.metasurface = type { i32 }
define i32 @msurf_get_inside(%struct.metasurface* %0) {
%2 = alloca %struct.metasurface*
store %struct.metasurface* %0, %struct.metasurface** %2
%3 = load %struct.metasurface*, %struct.metasurface** %2
%4 = call i64 @msurf_is_enabled(%struct.metasurface* %3, i32 1)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 1
ret i32 %7
}

LLVM IR (-O2):
%struct.metasurface = type { i32 }
define i32 @msurf_get_inside(%struct.metasurface* %0) {
%2 = tail call i64 @msurf_is_enabled(%struct.metasurface* %0, i32 1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *safe_raw_allocate(size_t, int);
int /*<<< orphan*/ safe_raw_copy(void *, void const *, size_t, int);
void *clone_memory(const void *pointer, size_t size) {
  void *result = safe_raw_allocate(size, 1);
  safe_raw_copy(result, pointer, size, 1);
  return result;
}


x86 assembly (clang, -O0):
<clone_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <safe_raw_allocate@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <safe_raw_copy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clone_memory>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
mov    $0x1,%esi
call   1040 <safe_raw_allocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x1,%ecx
call   1030 <safe_raw_copy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @clone_memory(i8* %0, i64 %1) {
%3 = tail call i8* @safe_raw_allocate(i64 %1, i32 1)
%4 = tail call i32 @safe_raw_copy(i8* %3, i8* %0, i64 %1, i32 1)
ret i8* %3
}
int test_imm_F0int32_reg(int val) { return ((val) & (0xF0 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_F0int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xf0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_F0int32_reg(i32 %0) {
%2 = and i32 %0, 240
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct cgts_program {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cgts_program *);
void cgts_program_free(struct cgts_program *program) { free(program); }


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

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

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

LLVM IR (-O2):
%struct.cgts_program = type { i32 }
define void @cgts_program_free(%struct.cgts_program* nocapture %0) {
%2 = tail call i32 @free(%struct.cgts_program* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIST_POINT_NAME;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ DIST_POINT_NAME_it;
int i2d_DIST_POINT_NAME(DIST_POINT_NAME *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &DIST_POINT_NAME_it);
}


x86 assembly (clang, -O0):
<i2d_DIST_POINT_NAME>:
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    0x2ec1(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_DIST_POINT_NAME>:
mov    0x2ed9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@DIST_POINT_NAME_it = global i32 0
define i32 @i2d_DIST_POINT_NAME(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @DIST_POINT_NAME_it)
ret i32 %3
}
void fsl_udc_clk_suspend(void) {}


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

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

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

LLVM IR (-O2):
define void @fsl_udc_clk_suspend() {
ret void
}
/* Variables and functions */
int eql(char *, char *);
int mystrcmp(const void *p1, const void *p2) {
  return eql((char *)p1, (char *)p2);
}


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

x86 assembly (clang, -O2):
<mystrcmp>:
jmp    1030 <eql@plt>

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

LLVM IR (-O2):
define i32 @mystrcmp(i8* %0, i8* %1) {
%3 = tail call i32 @eql(i8* %0, i8* %1)
ret i32 %3
}