xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    ft_putchar('\n');
    return (0);
  }
  ft_putstr(argv[1]);
  ft_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1156 <main+0x36>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
movl   $0x0,-0x4(%rbp)
jmp    1174 <main+0x54>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     112f <main+0xf>
mov    0x8(%rsi),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @ft_putstr(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ __check_printsym_format(char const *, char *);
__attribute__((always_)) void print_symbol(const char *fmt, ptrdiff_t addr) {
  __check_printsym_format(fmt, "");
}


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

x86 assembly (clang, -O2):
<print_symbol>:
lea    0xee9(%rip),%rsi
jmp    1030 <__check_printsym_format@plt>

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @print_symbol(i8* %0, i32 %1) {
%3 = tail call i32 @__check_printsym_format(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
void gdk_color_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_color_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perrordie(char *);
char *strdup(char const *);
char *safe_strdup(const char *s) {
  char *r = strdup(s);
  if (r == NULL)
    perrordie("strdup");
  return r;
}


x86 assembly (clang, -O0):
<safe_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <safe_strdup+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <perrordie@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <safe_strdup+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <perrordie@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"strdup\00"
define i8* @safe_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perrordie(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
define noalias i8* @safe_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perrordie(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void INT_Excep_MTU2_TGIU2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU2_TGIU2() {
ret void
}
/* Variables and functions */
int rand();
char createChar(int ratio) {
  char isLower = rand() % 100;
  if (isLower < ratio)
    isLower = 0;
  else
    isLower = 1;
  char letter = rand() % 26 + 1;
  return 0x40 + isLower * 0x20 + letter;
}


x86 assembly (clang, -O0):
<createChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1145 <createChar+0x35>
movb   $0x0,-0x5(%rbp)
jmp    1149 <createChar+0x39>
movb   $0x1,-0x5(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %dl,%al
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
shl    $0x5,%eax
add    $0x40,%eax
movsbl -0x6(%rbp),%ecx
add    %ecx,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createChar>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
xor    %ebp,%ebp
cmp    %ebx,%eax
setge  %bpl
shl    $0x5,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    %ebp,%eax
add    $0x41,%al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @createChar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 %0, i32* %2
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 100
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %1
store i8 0, i8* %3
br label %14
13: ; preds = %1
store i8 1, i8* %3
br label %14
14: ; preds = %13, %12
%15 = call i32 (...) @rand()
%16 = srem i32 %15, 26
%17 = add nsw i32 %16, 1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %4
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = mul nsw i32 %20, 32
%22 = add nsw i32 64, %21
%23 = load i8, i8* %4
%24 = sext i8 %23 to i32
%25 = add nsw i32 %22, %24
%26 = trunc i32 %25 to i8
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @createChar(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 100
%4 = icmp slt i32 %3, %0
%5 = select i1 %4, i32 64, i32 96
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 26
%8 = add nsw i32 %7, 1
%9 = add nsw i32 %8, %5
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ SETHLm(int);
void SET0HLm() { SETHLm(0x01); }


x86 assembly (clang, -O0):
<SET0HLm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <SETHLm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SET0HLm>:
mov    $0x1,%edi
jmp    1030 <SETHLm@plt>

LLVM IR (-O0):
define void @SET0HLm() {
%1 = call i32 @SETHLm(i32 1)
ret void
}

LLVM IR (-O2):
define void @SET0HLm() {
%1 = tail call i32 @SETHLm(i32 1)
ret void
}
/* Variables and functions */
int cfg_processor_get_addr(char *, char *);
int cfg_basic_timer_get_ifg_addr(void) {
  return cfg_processor_get_addr("basictimer", "ifg");
}


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

x86 assembly (clang, -O2):
<cfg_basic_timer_get_ifg_addr>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <cfg_processor_get_addr@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"basictimer\00"
@.str.1 = [4 x i8] c"ifg\00"
define i32 @cfg_basic_timer_get_ifg_addr() {
%1 = call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"basictimer\00"
@.str.1 = [4 x i8] c"ifg\00"
define i32 @cfg_basic_timer_get_ifg_addr() {
%1 = tail call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t sign_extend16(uint32_t v) {
  if (v & 0x8000)
    v |= 0xffff0000;
  return v;
}


x86 assembly (clang, -O0):
<sign_extend16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1123 <sign_extend16+0x23>
mov    -0x4(%rbp),%eax
or     $0xffff0000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_extend16>:
mov    %edi,%eax
or     $0xffff0000,%eax
test   $0x8000,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @sign_extend16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 32768
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = or i32 %7, -65536
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @sign_extend16(i32 %0) {
%2 = and i32 %0, 32768
%3 = icmp eq i32 %2, 0
%4 = or i32 %0, -65536
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free_cells();
int /*<<< orphan*/ free_spheres();
void endgame(void) {
  free_cells();
  free_spheres();
}


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

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

LLVM IR (-O0):
define void @endgame() {
%1 = call i32 (...) @free_cells()
%2 = call i32 (...) @free_spheres()
ret void
}

LLVM IR (-O2):
define void @endgame() {
%1 = tail call i32 (...) @free_cells()
%2 = tail call i32 (...) @free_spheres()
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ strncat_template(char *, char *, int);
int main() {
  char *buffer_4 = "C";
  strncat_template(buffer_4, " is cool", 8);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncat_template@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee3(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncat_template@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"C\00"
@.str.1 = [9 x i8] c" is cool\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncat_template(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@.str = [2 x i8] c"C\00"
@.str.1 = [9 x i8] c" is cool\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @strncat_template(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ mk_MD5Update(void *, unsigned char const *, unsigned int);
void md5_update(void *context, unsigned char const *buf, unsigned int len) {
  mk_MD5Update(context, buf, len);
}


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

x86 assembly (clang, -O2):
<md5_update>:
jmp    1030 <mk_MD5Update@plt>

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

LLVM IR (-O2):
define void @md5_update(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @mk_MD5Update(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ service();
void service_setup(int lfd, int connfd, int ruid) { service(); }


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

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

LLVM IR (-O0):
define void @service_setup(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 (...) @service()
ret void
}

LLVM IR (-O2):
define void @service_setup(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @service()
ret void
}
int fn(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @fn() {
ret i32 3
}

LLVM IR (-O2):
define i32 @fn() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fakeFunction() {
  printf("some androids has buggy native loader, so i should check size of "
         "libs in java to know that native library is correct. So each changed "
         "native library should has diffrent size in different app versions. "
         "This function will increase lib size for few bytes :)");
  printf("");
}


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

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

LLVM IR (-O0):
@.str = [255 x i8] c"some androids has buggy native loader, so i should check size of libs in java to know that native library is correct. So each changed native library should has diffrent size in different app versions. This function will increase lib size for few bytes :)\00"
@.str.1 = [1 x i8] zeroinitializer
define void @fakeFunction() {
%1 = call i32 @printf(i8* getelementptr inbounds ([255 x i8], [255 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [255 x i8] c"some androids has buggy native loader, so i should check size of libs in java to know that native library is correct. So each changed native library should has diffrent size in different app versions. This function will increase lib size for few bytes :)\00"
define void @fakeFunction() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([255 x i8], [255 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double CDFNormal(double);
double PDFNormal(double, int /*<<< orphan*/, int);
double PDFSkewN(double x, double loc, double scale, double shape) {
  double z = (x - loc) / scale, pdf = 2 / scale;
  pdf *= PDFNormal(z, 0, 1) * CDFNormal(shape * z);
  return pdf;
}


x86 assembly (clang, -O0):
<PDFSkewN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xea8(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <PDFNormal@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <CDFNormal@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDFSkewN>:
sub    $0x28,%rsp
movsd  %xmm3,0x20(%rsp)
subsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xec0(%rip),%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,0x18(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <PDFNormal@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
call   1040 <CDFNormal@plt>
mulsd  0x10(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @PDFSkewN(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %5
%12 = load double, double* %6
%13 = fsub double %11, %12
%14 = load double, double* %7
%15 = fdiv double %13, %14
store double %15, double* %9
%16 = load double, double* %7
%17 = fdiv double 2.000000e+00, %16
store double %17, double* %10
%18 = load double, double* %9
%19 = call double @PDFNormal(double %18, i32 0, i32 1)
%20 = load double, double* %8
%21 = load double, double* %9
%22 = fmul double %20, %21
%23 = call double @CDFNormal(double %22)
%24 = fmul double %19, %23
%25 = load double, double* %10
%26 = fmul double %25, %24
store double %26, double* %10
%27 = load double, double* %10
ret double %27
}

LLVM IR (-O2):
define double @PDFSkewN(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %1
%6 = fdiv double %5, %2
%7 = fdiv double 2.000000e+00, %2
%8 = tail call double @PDFNormal(double %6, i32 0, i32 1)
%9 = fmul double %6, %3
%10 = tail call double @CDFNormal(double %9)
%11 = fmul double %8, %10
%12 = fmul double %7, %11
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void read_err(char *fname) {
  fprintf(stderr, "Unexpected read error on file %s. Aborting\n", fname);
  exit(1);
}


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

x86 assembly (clang, -O2):
<read_err>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Unexpected read error on file %s. Aborting\0A\00"
define void @read_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Unexpected read error on file %s. Aborting\0A\00"
define void @read_err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned char dxl_read_byte(unsigned char, int);
unsigned char getCWComplianceSlope(unsigned char id) {
  return dxl_read_byte(id, (26));
}


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

x86 assembly (clang, -O2):
<getCWComplianceSlope>:
mov    $0x1a,%esi
jmp    1030 <dxl_read_byte@plt>

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

LLVM IR (-O2):
define zeroext i8 @getCWComplianceSlope(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_byte(i8 zeroext %0, i32 26)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_vd42();
int /*<<< orphan*/ take_struct_vd42(int /*<<< orphan*/);
void test_struct_vd42() { take_struct_vd42(return_struct_vd42()); }


x86 assembly (clang, -O0):
<test_struct_vd42>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_vd42@plt>
mov    %eax,%edi
call   1030 <take_struct_vd42@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_vd42>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_vd42@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_vd42@plt>

LLVM IR (-O0):
define void @test_struct_vd42() {
%1 = call i32 (...) @return_struct_vd42()
%2 = call i32 @take_struct_vd42(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_vd42() {
%1 = tail call i32 (...) @return_struct_vd42()
%2 = tail call i32 @take_struct_vd42(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pdfluria(double, double, int, double *);
void luria_R_wrapper(double *m, double *phi, int *k, double *result) {
  pdfluria(*m, *phi, *k, result);
}


x86 assembly (clang, -O0):
<luria_R_wrapper>:
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),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rsi
call   1030 <pdfluria@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<luria_R_wrapper>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    (%rdx),%edi
mov    %rcx,%rsi
jmp    1030 <pdfluria@plt>

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

LLVM IR (-O2):
define void @luria_R_wrapper(double* nocapture %0, double* nocapture %1, i32* nocapture %2, double* %3) {
%5 = load double, double* %0
%6 = load double, double* %1
%7 = load i32, i32* %2
%8 = tail call i32 @pdfluria(double %5, double %6, i32 %7, double* %3)
ret void
}
void print_inst_LS_RS_RS_RD(char *mnemonic, int rd, int rs1, int rs2) { ; }


x86 assembly (clang, -O0):
<print_inst_LS_RS_RS_RD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @print_inst_LS_RS_RS_RD(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @print_inst_LS_RS_RS_RD(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Type definitions */
typedef int fexcept_t;

/* Variables and functions */
int /*<<< orphan*/ feclearexcept(int const);
int /*<<< orphan*/ feraiseexcept(int const);
int fesetexceptflag(const fexcept_t *fp, int mask) {
  feclearexcept(~*fp & mask);
  feraiseexcept(*fp & mask);
  return 0;
}


x86 assembly (clang, -O0):
<fesetexceptflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    $0xffffffff,%edi
and    -0xc(%rbp),%edi
call   1040 <feclearexcept@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
and    -0xc(%rbp),%edi
call   1030 <feraiseexcept@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetexceptflag>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    (%rdi),%edi
not    %edi
and    %esi,%edi
call   1040 <feclearexcept@plt>
and    (%r14),%ebx
mov    %ebx,%edi
call   1030 <feraiseexcept@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fesetexceptflag(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* %5
%7 = xor i32 %6, -1
%8 = load i32, i32* %4
%9 = and i32 %7, %8
%10 = call i32 @feclearexcept(i32 %9)
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32, i32* %4
%14 = and i32 %12, %13
%15 = call i32 @feraiseexcept(i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @fesetexceptflag(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = xor i32 %3, -1
%5 = and i32 %4, %1
%6 = tail call i32 @feclearexcept(i32 %5)
%7 = load i32, i32* %0
%8 = and i32 %7, %1
%9 = tail call i32 @feraiseexcept(i32 %8)
ret i32 0
}
/* Variables and functions */
scalar_t__ unknown_function();
void recover_integer_underflow_Bad() {
  for (unsigned int i = 0; i < 10; i++) {
    if (unknown_function()) {
      i -= 2;
    }
  }
}


x86 assembly (clang, -O0):
<recover_integer_underflow_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jae    1156 <recover_integer_underflow_Bad+0x46>
mov    $0x0,%al
call   1030 <unknown_function@plt>
cmp    $0x0,%rax
je     1143 <recover_integer_underflow_Bad+0x33>
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <recover_integer_underflow_Bad+0x38>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <recover_integer_underflow_Bad+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recover_integer_underflow_Bad>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <unknown_function@plt>
lea    -0x2(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0xa,%ecx
jb     1120 <recover_integer_underflow_Bad+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @recover_integer_underflow_Bad() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* %1
%4 = icmp ult i32 %3, 10
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = call i64 (...) @unknown_function()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %1
%10 = sub i32 %9, 2
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %5
br label %12
12: ; preds = %11
%13 = load i32, i32* %1
%14 = add i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @recover_integer_underflow_Bad() {
br label %2
1: ; preds = %2
ret void
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %8, %2 ]
%4 = tail call i64 (...) @unknown_function()
%5 = icmp eq i64 %4, 0
%6 = add nsw i32 %3, -2
%7 = select i1 %5, i32 %3, i32 %6
%8 = add nsw i32 %7, 1
%9 = icmp ult i32 %8, 10
br i1 %9, label %2, label %1
}
unsigned int one_hash(const void *key) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @one_hash(i8* nocapture readnone %0) {
ret i32 1
}
float MAG_FloatSwap(float f) {
  union {
    float f;
    unsigned char b[4];
  } dat1, dat2;
  dat1.f = f;
  dat2.b[0] = dat1.b[3];
  dat2.b[1] = dat1.b[2];
  dat2.b[2] = dat1.b[1];
  dat2.b[3] = dat1.b[0];
  return dat2.f;
}


x86 assembly (clang, -O0):
<MAG_FloatSwap>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x10(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0xf(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0xd(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAG_FloatSwap>:
movd   %xmm0,%eax
bswap  %eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @MAG_FloatSwap(float %0) {
%2 = alloca float
%3 = alloca %union.anon
%4 = alloca %union.anon
store float %0, float* %2
%5 = load float, float* %2
%6 = bitcast %union.anon* %3 to float*
store float %5, float* %6
%7 = bitcast %union.anon* %3 to [4 x i8]*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 3
%9 = load i8, i8* %8
%10 = bitcast %union.anon* %4 to [4 x i8]*
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
store i8 %9, i8* %11
%12 = bitcast %union.anon* %3 to [4 x i8]*
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 2
%14 = load i8, i8* %13
%15 = bitcast %union.anon* %4 to [4 x i8]*
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 1
store i8 %14, i8* %16
%17 = bitcast %union.anon* %3 to [4 x i8]*
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %17, i64 0, i64 1
%19 = load i8, i8* %18
%20 = bitcast %union.anon* %4 to [4 x i8]*
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %20, i64 0, i64 2
store i8 %19, i8* %21
%22 = bitcast %union.anon* %3 to [4 x i8]*
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %22, i64 0, i64 0
%24 = load i8, i8* %23
%25 = bitcast %union.anon* %4 to [4 x i8]*
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %25, i64 0, i64 3
store i8 %24, i8* %26
%27 = bitcast %union.anon* %4 to float*
%28 = load float, float* %27
ret float %28
}

LLVM IR (-O2):
define float @MAG_FloatSwap(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
double digit_reverse(int x, int base) {
  double result;
  int inverse_multiplier;
  result = 0.;
  inverse_multiplier = base;
  while (x) {
    result += (double)(x % base) / (double)inverse_multiplier;
    inverse_multiplier *= base;
    x /= base;
  }
  return (result);
}


x86 assembly (clang, -O0):
<digit_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115b <digit_reverse+0x5b>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cvtsi2sd %edx,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1118 <digit_reverse+0x18>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_reverse>:
test   %edi,%edi
je     1131 <digit_reverse+0x31>
mov    %edi,%eax
xorpd  %xmm0,%xmm0
mov    %esi,%ecx
nopl   0x0(%rax)
cltd
idiv   %esi
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sd %ecx,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
imul   %esi,%ecx
test   %eax,%eax
jne    1110 <digit_reverse+0x10>
ret
xorps  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @digit_reverse(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %13, %4 ], [ %1, %2 ]
%6 = phi double [ %12, %4 ], [ 0.000000e+00, %2 ]
%7 = phi i32 [ %14, %4 ], [ %0, %2 ]
%8 = srem i32 %7, %1
%9 = sitofp i32 %8 to double
%10 = sitofp i32 %5 to double
%11 = fdiv double %9, %10
%12 = fadd double %6, %11
%13 = mul nsw i32 %5, %1
%14 = sdiv i32 %7, %1
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %2
%17 = phi double [ 0.000000e+00, %2 ], [ %12, %4 ]
ret double %17
}
int getByte(int x, int n) {
  int bits = n << 3;
  int after = x >> bits;
  return 0xFF & after;
}


x86 assembly (clang, -O0):
<getByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getByte>:
lea    0x0(,%rsi,8),%ecx
sar    %cl,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @getByte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = shl i32 %7, 3
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = ashr i32 %9, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = and i32 255, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @getByte(i32 %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = ashr i32 %0, %3
%5 = and i32 %4, 255
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg8setBank1(int);
void m82setParams7EFB(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank1((val & 0xFC) << 11);
}


x86 assembly (clang, -O0):
<m82setParams7EFB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0xfc,%edi
shl    $0xb,%edi
call   1030 <prg8setBank1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m82setParams7EFB>:
mov    %esi,%edi
shl    $0xb,%edi
and    $0x7e000,%edi
jmp    1030 <prg8setBank1@plt>

LLVM IR (-O0):
define void @m82setParams7EFB(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 = and i32 %6, 252
%8 = shl i32 %7, 11
%9 = call i32 @prg8setBank1(i32 %8)
ret void
}

LLVM IR (-O2):
define void @m82setParams7EFB(i32 %0, i32 %1) {
%3 = shl i32 %1, 11
%4 = and i32 %3, 516096
%5 = tail call i32 @prg8setBank1(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
int sum(int);
int main() {
  int s = sum(10);
  printf("sum(10) = %d\n", s);
  fflush(stdout);
  return s;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <sum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <sum@plt>
mov    %eax,%ebx
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"sum(10) = %d\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sum(i32 10)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [14 x i8] c"sum(10) = %d\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 @sum(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret i32 %1
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double timer() {
  struct timeval tv;
  struct timezone tz;
  double walltime;
  gettimeofday(&tv, &tz);
  walltime = tv.tv_sec + tv.tv_usec * 1.0e-6;
  return (walltime);
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
%struct.timezone = type { i32 }
define double @timer() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = alloca double
%4 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load double, double* %7
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %6)
store double %9, double* %3
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
%struct.timezone = type { i32 }
define double @timer() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ term_printf(char const *);
void term_print_filename(const char *filename) { term_printf(filename); }


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

x86 assembly (clang, -O2):
<term_print_filename>:
jmp    1030 <term_printf@plt>

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

LLVM IR (-O2):
define void @term_print_filename(i8* %0) {
%2 = tail call i32 @term_printf(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
scalar_t__ readIRBit();
void blockUntilMessage() {
  while (readIRBit() == 0) {
    delay(5);
  }
}


x86 assembly (clang, -O0):
<blockUntilMessage>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <blockUntilMessage+0x9>
mov    $0x0,%al
call   1030 <readIRBit@plt>
cmp    $0x0,%rax
jne    1149 <blockUntilMessage+0x29>
mov    $0x5,%edi
call   1040 <delay@plt>
jmp    1129 <blockUntilMessage+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blockUntilMessage>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <readIRBit@plt>
test   %rax,%rax
jne    1148 <blockUntilMessage+0x28>
mov    $0x5,%edi
call   1040 <delay@plt>
jmp    1130 <blockUntilMessage+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @blockUntilMessage() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @readIRBit()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 @delay(i32 5)
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @blockUntilMessage() {
%1 = tail call i64 (...) @readIRBit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 @delay(i32 5)
%5 = tail call i64 (...) @readIRBit()
%6 = icmp eq i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3, %0
ret void
}
/* Variables and functions */
scalar_t__ pct(int);
int confuz() {
  int msg;
  msg = 60;
  if (pct(50))
    msg = 61;
  if (pct(33))
    msg = 13;
  if (pct(25))
    msg = 347;
  if (pct(20))
    msg = 195;
  return (msg);
}


x86 assembly (clang, -O0):
<confuz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3c,-0x4(%rbp)
mov    $0x32,%edi
call   1030 <pct@plt>
cmp    $0x0,%rax
je     113a <confuz+0x2a>
movl   $0x3d,-0x4(%rbp)
mov    $0x21,%edi
call   1030 <pct@plt>
cmp    $0x0,%rax
je     1155 <confuz+0x45>
movl   $0xd,-0x4(%rbp)
mov    $0x19,%edi
call   1030 <pct@plt>
cmp    $0x0,%rax
je     1170 <confuz+0x60>
movl   $0x15b,-0x4(%rbp)
mov    $0x14,%edi
call   1030 <pct@plt>
cmp    $0x0,%rax
je     118b <confuz+0x7b>
movl   $0xc3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confuz>:
push   %rbp
push   %rbx
push   %rax
mov    $0x32,%edi
call   1030 <pct@plt>
cmp    $0x1,%rax
mov    $0x3d,%ebx
sbb    $0x0,%ebx
mov    $0x21,%edi
call   1030 <pct@plt>
test   %rax,%rax
mov    $0xd,%ebp
cmove  %ebx,%ebp
mov    $0x19,%edi
call   1030 <pct@plt>
test   %rax,%rax
mov    $0x15b,%ebx
cmove  %ebp,%ebx
mov    $0x14,%edi
call   1030 <pct@plt>
test   %rax,%rax
mov    $0xc3,%eax
cmove  %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @confuz() {
%1 = alloca i32
store i32 60, i32* %1
%2 = call i64 @pct(i32 50)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 61, i32* %1
br label %5
5: ; preds = %4, %0
%6 = call i64 @pct(i32 33)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 13, i32* %1
br label %9
9: ; preds = %8, %5
%10 = call i64 @pct(i32 25)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 347, i32* %1
br label %13
13: ; preds = %12, %9
%14 = call i64 @pct(i32 20)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 195, i32* %1
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @confuz() {
%1 = tail call i64 @pct(i32 50)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i32 60, i32 61
%4 = tail call i64 @pct(i32 33)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 %3, i32 13
%7 = tail call i64 @pct(i32 25)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i32 %6, i32 347
%10 = tail call i64 @pct(i32 20)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i32 %9, i32 195
ret i32 %12
}
int pinconf_apply_setting(const struct pinctrl_setting *setting) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pinctrl_setting = type opaque
define i32 @pinconf_apply_setting(%struct.pinctrl_setting* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char getc(int /*<<< orphan*/ *);
unsigned short read_word(FILE *fp) {
  unsigned char b0, b1;
  b0 = getc(fp);
  b1 = getc(fp);
  return ((b1 << 8) | b0);
}


x86 assembly (clang, -O0):
<read_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
shl    $0x8,%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_word>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
movzbl %al,%ecx
shl    $0x8,%ecx
movzbl %bpl,%eax
or     %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @read_word(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
%4 = alloca i8
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call zeroext i8 @getc(i32* %5)
store i8 %6, i8* %3
%7 = load i32*, i32** %2
%8 = call zeroext i8 @getc(i32* %7)
store i8 %8, i8* %4
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @read_word(i32* nocapture %0) {
%2 = tail call zeroext i8 @getc(i32* %0)
%3 = tail call zeroext i8 @getc(i32* %0)
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
%6 = zext i8 %2 to i16
%7 = or i16 %5, %6
ret i16 %7
}
double ceil(double input) { return ((double)((int)(input + 1.0))); }


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
addsd  0xef8(%rip),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
char *strncat(char *dst, const char *src, size_t n) {
__ESBMC_HIDE:
  return dst;
}


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

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

LLVM IR (-O0):
define i8* @strncat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
br label %7
7: ; preds = %3
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
define i8* @strncat(i8* readnone returned %0, i8* nocapture readnone %1, i64 %2) {
ret i8* %0
}