xunge/DecIR huggingface dataset:
long C_a_i_bytevector(long **ptr, int c, long num) {
  long *p = *ptr, *p0;
  int n = ((num) >> 1);
  p0 = p;
  *(p++) =
      (0x00000000 | 0x4000000000000000L | 0x1000000000000000L) | ((n) << 3);
  *ptr = p + n;
  return (long)p0;
}


x86 assembly (clang, -O0):
<C_a_i_bytevector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
sar    $0x1,%rax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
shl    $0x3,%eax
movslq %eax,%rcx
movabs $0x5000000000000000,%rax
or     %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_a_i_bytevector>:
mov    (%rdi),%rax
shr    %rdx
lea    0x0(,%rdx,8),%ecx
movslq %ecx,%rcx
movabs $0x5000000000000000,%rsi
or     %rcx,%rsi
mov    %rsi,(%rax)
movslq %edx,%rcx
lea    (%rax,%rcx,8),%rcx
add    $0x8,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i64 @C_a_i_bytevector(i64** %0, i32 %1, i64 %2) {
%4 = alloca i64**
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i32
store i64** %0, i64*** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%10 = load i64**, i64*** %4
%11 = load i64*, i64** %10
store i64* %11, i64** %7
%12 = load i64, i64* %6
%13 = ashr i64 %12, 1
%14 = trunc i64 %13 to i32
store i32 %14, i32* %9
%15 = load i64*, i64** %7
store i64* %15, i64** %8
%16 = load i32, i32* %9
%17 = shl i32 %16, 3
%18 = sext i32 %17 to i64
%19 = or i64 5764607523034234880, %18
%20 = load i64*, i64** %7
%21 = getelementptr inbounds i64, i64* %20, i32 1
store i64* %21, i64** %7
store i64 %19, i64* %20
%22 = load i64*, i64** %7
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i64, i64* %22, i64 %24
%26 = load i64**, i64*** %4
store i64* %25, i64** %26
%27 = load i64*, i64** %8
%28 = ptrtoint i64* %27 to i64
ret i64 %28
}

LLVM IR (-O2):
define i64 @C_a_i_bytevector(i64** nocapture %0, i32 %1, i64 %2) {
%4 = load i64*, i64** %0
%5 = lshr i64 %2, 1
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 3
%8 = sext i32 %7 to i64
%9 = or i64 %8, 5764607523034234880
%10 = getelementptr inbounds i64, i64* %4, i64 1
store i64 %9, i64* %4
%11 = shl i64 %5, 32
%12 = ashr exact i64 %11, 32
%13 = getelementptr inbounds i64, i64* %10, i64 %12
store i64* %13, i64** %0
%14 = ptrtoint i64* %4 to i64
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ clock();
int /*<<< orphan*/ wStackPushNumber(int /*<<< orphan*/);
void wBuiltinTicks() { wStackPushNumber(clock()); }


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

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

LLVM IR (-O0):
define void @wBuiltinTicks() {
%1 = call i32 (...) @clock()
%2 = call i32 @wStackPushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @wBuiltinTicks() {
%1 = tail call i32 (...) @clock()
%2 = tail call i32 @wStackPushNumber(i32 %1)
ret void
}
int HashString2(const char *s) {
  int hval = 0;
  while (*s) {
    hval = (hval * 729 + *s * 37) ^ (hval >> 1);
    s++;
  }
  return hval;
}


x86 assembly (clang, -O0):
<HashString2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <HashString2+0x4b>
imul   $0x2d9,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
imul   $0x25,%ecx,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <HashString2+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashString2>:
mov    (%rdi),%cl
test   %cl,%cl
je     1131 <HashString2+0x31>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x2d9,%eax,%edx
movsbl %cl,%ecx
lea    (%rcx,%rcx,8),%esi
lea    (%rcx,%rsi,4),%ecx
add    %edx,%ecx
sar    %eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <HashString2+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @HashString2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i32 [ %13, %4 ], [ 0, %1 ]
%7 = phi i8* [ %14, %4 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 729
%9 = sext i8 %5 to i32
%10 = mul nsw i32 %9, 37
%11 = add nsw i32 %10, %8
%12 = ashr i32 %6, 1
%13 = xor i32 %11, %12
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4, %1
%18 = phi i32 [ 0, %1 ], [ %13, %4 ]
ret i32 %18
}
void kill() {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <kill+0x9>
jmp    1109 <kill+0x9>

x86 assembly (clang, -O2):
<kill>:
jmp    1100 <kill>

LLVM IR (-O0):
define void @kill() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @kill() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fcomp_preg32_dword(int reg32) {
  put8(0xD8);
  put8(0x18 + reg32);
}


x86 assembly (clang, -O0):
<fcomp_preg32_dword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xd8,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0x18,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcomp_preg32_dword>:
push   %rbx
mov    %edi,%ebx
mov    $0xd8,%edi
call   1030 <put8@plt>
add    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fcomp_preg32_dword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 216)
%4 = load i32, i32* %2
%5 = add nsw i32 24, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fcomp_preg32_dword(i32 %0) {
%2 = tail call i32 @put8(i32 216)
%3 = add nsw i32 %0, 24
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Variables and functions */
_Bool isalpha(unsigned char);
_Bool dns_isalpha(unsigned char c) { return isalpha(c); }


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

x86 assembly (clang, -O2):
<dns_isalpha>:
jmp    1030 <isalpha@plt>

LLVM IR (-O0):
define zeroext i1 @dns_isalpha(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i1 @isalpha(i8 zeroext %3)
ret i1 %4
}

LLVM IR (-O2):
define zeroext i1 @dns_isalpha(i8 zeroext %0) {
%2 = tail call zeroext i1 @isalpha(i8 zeroext %0)
ret i1 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo) {
  printf("reader: get signal\n");
  return;
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"reader: get signal\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"reader: get signal\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *config_path(char *);
char *agent_socket_path(void) { return config_path("agent.sock"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"agent.sock\00"
define i8* @agent_socket_path() {
%1 = call i8* @config_path(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"agent.sock\00"
define i8* @agent_socket_path() {
%1 = tail call i8* @config_path(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
double logl(int);
long double atanhl(long double x) { return 0.5 * logl((1. + x) / (1. - x)); }


x86 assembly (clang, -O0):
<atanhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld1
fld    %st(1)
fadd   %st(1),%st
fxch   %st(1)
fsubp  %st,%st(2)
fdivp  %st,%st(1)
fnstcw -0x22(%rbp)
movzwl -0x22(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x24(%rbp)
fldcw  -0x24(%rbp)
fistpl -0x14(%rbp)
fldcw  -0x22(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <logl@plt>
movsd  0xeaa(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
fldl   -0x20(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanhl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fld1
fld    %st(1)
fadd   %st(1),%st
fxch   %st(1)
fsubp  %st,%st(2)
fdivp  %st,%st(1)
fnstcw 0x8(%rsp)
movzwl 0x8(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0xa(%rsp)
fldcw  0xa(%rsp)
fistpl 0xc(%rsp)
fldcw  0x8(%rsp)
mov    0xc(%rsp),%edi
call   1030 <logl@plt>
mulsd  0xeac(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
fldl   0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @atanhl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fadd x86_fp80 0xK3FFF8000000000000000, %3
%5 = load x86_fp80, x86_fp80* %2
%6 = fsub x86_fp80 0xK3FFF8000000000000000, %5
%7 = fdiv x86_fp80 %4, %6
%8 = fptosi x86_fp80 %7 to i32
%9 = call double @logl(i32 %8)
%10 = fmul double 5.000000e-01, %9
%11 = fpext double %10 to x86_fp80
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @atanhl(x86_fp80 %0) {
%2 = fadd x86_fp80 %0, 0xK3FFF8000000000000000
%3 = fsub x86_fp80 0xK3FFF8000000000000000, %0
%4 = fdiv x86_fp80 %2, %3
%5 = fptosi x86_fp80 %4 to i32
%6 = tail call double @logl(i32 %5)
%7 = fmul double %6, 5.000000e-01
%8 = fpext double %7 to x86_fp80
ret x86_fp80 %8
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorCode();
int dxl_read_word(int, int);
int getCurrentPos(int Id) {
  int CurrentPos;
  CurrentPos = dxl_read_word(Id, 36);
  PrintErrorCode();
  return CurrentPos;
}


x86 assembly (clang, -O0):
<getCurrentPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x24,%esi
call   1030 <dxl_read_word@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <PrintErrorCode@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentPos>:
push   %rbx
mov    $0x24,%esi
call   1030 <dxl_read_word@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <PrintErrorCode@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getCurrentPos(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dxl_read_word(i32 %4, i32 36)
store i32 %5, i32* %3
%6 = call i32 (...) @PrintErrorCode()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @getCurrentPos(i32 %0) {
%2 = tail call i32 @dxl_read_word(i32 %0, i32 36)
%3 = tail call i32 (...) @PrintErrorCode()
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int uint16_t;

/* Variables and functions */
bool USBLPMRemoteWakeEnabled(uint32_t ui32Base) {
  ;
  if ((*((volatile uint16_t *)(ui32Base + 0x00000360))) & 0x00000100) {
    return (true);
  }
  return (false);
}


x86 assembly (clang, -O0):
<USBLPMRemoteWakeEnabled>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x360(%rax),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     112c <USBLPMRemoteWakeEnabled+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <USBLPMRemoteWakeEnabled+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBLPMRemoteWakeEnabled>:
mov    0x360(%rdi),%eax
shr    $0x8,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @USBLPMRemoteWakeEnabled(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = add nsw i64 %4, 864
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 256
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @USBLPMRemoteWakeEnabled(i64 %0) {
%2 = add nsw i64 %0, 864
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = lshr i32 %4, 8
%6 = and i32 %5, 1
ret i32 %6
}
/* Type definitions */
struct File_t {
  int dummy;
};

/* Variables and functions */
unsigned int getAbsCluNr(struct File_t *);
unsigned int func2(void *Stream) {
  struct File_t *This = (struct File_t *)Stream;
  return getAbsCluNr(This);
}


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

x86 assembly (clang, -O2):
<func2>:
jmp    1030 <getAbsCluNr@plt>

LLVM IR (-O0):
%struct.File_t = type { i32 }
define i32 @func2(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.File_t*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.File_t*
store %struct.File_t* %5, %struct.File_t** %3
%6 = load %struct.File_t*, %struct.File_t** %3
%7 = call i32 @getAbsCluNr(%struct.File_t* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.File_t = type { i32 }
define i32 @func2(i8* %0) {
%2 = bitcast i8* %0 to %struct.File_t*
%3 = tail call i32 @getAbsCluNr(%struct.File_t* %2)
ret i32 %3
}
double activate_linear(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @activate_linear(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ vi_macro_reset();
int /*<<< orphan*/ x_flush();
int /*<<< orphan*/ x_putc(int);
void vi_error() {
  vi_macro_reset();
  x_putc(0x07);
  x_flush();
}


x86 assembly (clang, -O0):
<vi_error>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <vi_macro_reset@plt>
mov    $0x7,%edi
call   1040 <x_putc@plt>
mov    $0x0,%al
call   1030 <x_flush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vi_error>:
push   %rax
xor    %eax,%eax
call   1050 <vi_macro_reset@plt>
mov    $0x7,%edi
call   1040 <x_putc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <x_flush@plt>

LLVM IR (-O0):
define void @vi_error() {
%1 = call i32 (...) @vi_macro_reset()
%2 = call i32 @x_putc(i32 7)
%3 = call i32 (...) @x_flush()
ret void
}

LLVM IR (-O2):
define void @vi_error() {
%1 = tail call i32 (...) @vi_macro_reset()
%2 = tail call i32 @x_putc(i32 7)
%3 = tail call i32 (...) @x_flush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void dll_insert_master(int *a) { assert(0); }


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

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

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

LLVM IR (-O2):
define void @dll_insert_master(i32* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
char *__itoa(int, char *, int);
char *itoa(int value, char *str, int base) { return __itoa(value, str, base); }


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

x86 assembly (clang, -O2):
<itoa>:
jmp    1030 <__itoa@plt>

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

LLVM IR (-O2):
define i8* @itoa(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @__itoa(i32 %0, i8* %1, i32 %2)
ret i8* %4
}
int isGreater(int x, int y) { return ((x + ~(((x ^ y) >> 31) | y)) >> 31) + 1; }


x86 assembly (clang, -O0):
<isGreater>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    -0x8(%rbp),%ecx
sar    $0x1f,%ecx
or     -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
sar    $0x1f,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isGreater>:
mov    %esi,%eax
xor    %edi,%eax
sar    $0x1f,%eax
or     %esi,%eax
not    %eax
add    %edi,%eax
sar    $0x1f,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isGreater(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* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
%9 = ashr i32 %8, 31
%10 = load i32, i32* %4
%11 = or i32 %9, %10
%12 = xor i32 %11, -1
%13 = add nsw i32 %5, %12
%14 = ashr i32 %13, 31
%15 = add nsw i32 %14, 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @isGreater(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = ashr i32 %3, 31
%5 = or i32 %4, %1
%6 = xor i32 %5, -1
%7 = add nsw i32 %6, %0
%8 = ashr i32 %7, 31
%9 = add nsw i32 %8, 1
ret i32 %9
}
/* Variables and functions */
int random();
void _gfshare_fill_rand_using_random(unsigned char *buffer,
                                     unsigned int count) {
  unsigned int i;
  for (i = 0; i < count; ++i)
    buffer[i] = (random() & 0xff00) >> 8;
}


x86 assembly (clang, -O0):
<_gfshare_fill_rand_using_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    115b <_gfshare_fill_rand_using_random+0x4b>
mov    $0x0,%al
call   1030 <random@plt>
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <_gfshare_fill_rand_using_random+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gfshare_fill_rand_using_random>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     1139 <_gfshare_fill_rand_using_random+0x29>
mov    %esi,%r14d
xor    %ebp,%ebp
nopl   (%rax)
xor    %eax,%eax
mov    %rdi,%rbx
call   1030 <random@plt>
mov    %rbx,%rdi
mov    %ah,(%rbx,%rbp,1)
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1120 <_gfshare_fill_rand_using_random+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @_gfshare_fill_rand_using_random(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = call i32 (...) @random()
%12 = and i32 %11, 65280
%13 = ashr i32 %12, 8
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 %14, i8* %18
br label %19
19: ; preds = %10
%20 = load i32, i32* %5
%21 = add i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @_gfshare_fill_rand_using_random(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = tail call i32 (...) @random()
%9 = lshr i32 %8, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %10, i8* %11
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
double asdouble(uint64_t i) {
  union {
    uint64_t i;
    double f;
  } u = {i};
  return u.f;
}


x86 assembly (clang, -O0):
<asdouble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<asdouble>:
mov    %edi,%eax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @asdouble(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = bitcast %union.anon* %3 to i32*
%5 = load i32, i32* %2
store i32 %5, i32* %4
%6 = bitcast %union.anon* %3 to double*
%7 = load double, double* %6
ret double %7
}

LLVM IR (-O2):
define double @asdouble(i32 %0) {
%2 = zext i32 %0 to i64
%3 = bitcast i64 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, int);
void sig_handler(int signo) { errx(1, "Exiting on signal %d", signo); }


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xed6(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
mov    %edi,%edx
lea    0xee7(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Exiting on signal %d\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @errx(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Exiting on signal %d\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int read_dword(const char *ptr, unsigned int *value) {
  ;
  *value = *(const int *)ptr;
  return sizeof(int);
}


x86 assembly (clang, -O0):
<read_dword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_dword>:
mov    (%rdi),%eax
mov    %eax,(%rsi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @read_dword(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret i32 4
}

LLVM IR (-O2):
define i32 @read_dword(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
store i32 %4, i32* %1
ret i32 4
}
void unixEnterMutex(void) {}


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

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

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

LLVM IR (-O2):
define void @unixEnterMutex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i();
int main() { i(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @i()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @i()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_init(pthread_mutexattr_t *attr) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_init(i32* nocapture readnone %0) {
ret i32 -1
}
int io_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @io_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @io_init() {
ret i32 0
}
/* Variables and functions */
__attribute__((always_)) size_t clamp_size_t(size_t a, size_t b, size_t c) {
  return a < b ? b : a > c ? c : a;
}


x86 assembly (clang, -O0):
<clamp_size_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    112b <clamp_size_t+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1156 <clamp_size_t+0x56>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1146 <clamp_size_t+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    114e <clamp_size_t+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_size_t>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovbe %rdi,%rax
cmp    %rsi,%rdi
cmovb  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @clamp_size_t(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i64, i64* %5
br label %22
12: ; preds = %3
%13 = load i64, i64* %4
%14 = load i64, i64* %6
%15 = icmp ugt i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i64, i64* %6
br label %20
18: ; preds = %12
%19 = load i64, i64* %4
br label %20
20: ; preds = %18, %16
%21 = phi i64 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i64 [ %11, %10 ], [ %21, %20 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @clamp_size_t(i64 %0, i64 %1, i64 %2) {
%4 = icmp ult i64 %0, %1
%5 = icmp ugt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Type definitions */
struct bpf_insn {
  int dummy;
};
typedef enum bpf_prog_type { ____Placeholder_bpf_prog_type } bpf_prog_type;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int bpf_load_program_name(int, int /*<<< orphan*/ *, struct bpf_insn const *,
                          size_t, char const *, int /*<<< orphan*/, char *,
                          size_t);
int bpf_load_program(enum bpf_prog_type type, const struct bpf_insn *insns,
                     size_t insns_cnt, const char *license, __u32 kern_version,
                     char *log_buf, size_t log_buf_sz) {
  return bpf_load_program_name(type, NULL, insns, insns_cnt, license,
                               kern_version, log_buf, log_buf_sz);
}


x86 assembly (clang, -O0):
<bpf_load_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
xor    %esi,%esi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <bpf_load_program_name@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_load_program>:
push   %rax
mov    %r9,%rax
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
push   0x10(%rsp)
push   %rax
call   1030 <bpf_load_program_name@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.bpf_insn = type { i32 }
define i32 @bpf_load_program(i32 %0, %struct.bpf_insn* %1, i64 %2, i8* %3, i32 %4, i8* %5, i64 %6) {
%8 = alloca i32
%9 = alloca %struct.bpf_insn*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i64
store i32 %0, i32* %8
store %struct.bpf_insn* %1, %struct.bpf_insn** %9
store i64 %2, i64* %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i64 %6, i64* %14
%15 = load i32, i32* %8
%16 = load %struct.bpf_insn*, %struct.bpf_insn** %9
%17 = load i64, i64* %10
%18 = load i8*, i8** %11
%19 = load i32, i32* %12
%20 = load i8*, i8** %13
%21 = load i64, i64* %14
%22 = call i32 @bpf_load_program_name(i32 %15, i32* null, %struct.bpf_insn* %16, i64 %17, i8* %18, i32 %19, i8* %20, i64 %21)
ret i32 %22
}

LLVM IR (-O2):
%struct.bpf_insn = type { i32 }
define i32 @bpf_load_program(i32 %0, %struct.bpf_insn* %1, i64 %2, i8* %3, i32 %4, i8* %5, i64 %6) {
%8 = tail call i32 @bpf_load_program_name(i32 %0, i32* null, %struct.bpf_insn* %1, i64 %2, i8* %3, i32 %4, i8* %5, i64 %6)
ret i32 %8
}
int test_imm_F9int64_lowword_reg(long long val) {
  return ((val) & (0xF9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F9int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 249
%5 = icmp ne i64 %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_F9int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 249
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CTFResetFlag(int);
void CTFResetFlags(void) {
  CTFResetFlag(0);
  CTFResetFlag(1);
}


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

x86 assembly (clang, -O2):
<CTFResetFlags>:
push   %rax
xor    %edi,%edi
call   1030 <CTFResetFlag@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <CTFResetFlag@plt>

LLVM IR (-O0):
define void @CTFResetFlags() {
%1 = call i32 @CTFResetFlag(i32 0)
%2 = call i32 @CTFResetFlag(i32 1)
ret void
}

LLVM IR (-O2):
define void @CTFResetFlags() {
%1 = tail call i32 @CTFResetFlag(i32 0)
%2 = tail call i32 @CTFResetFlag(i32 1)
ret void
}
/* Variables and functions */
int aeron_properties_setenv(char const *, char const *);
int set_property(void *clientd, const char *name, const char *value) {
  return aeron_properties_setenv(name, value);
}


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

x86 assembly (clang, -O2):
<set_property>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <aeron_properties_setenv@plt>

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

LLVM IR (-O2):
define i32 @set_property(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = tail call i32 @aeron_properties_setenv(i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int log(int);
int calcularNumBits(double min, double max, double precisao) {
  int total = (max - min) / precisao;
  int aux = (int)(log(total) / log(2) + 1);
  return aux;
}


x86 assembly (clang, -O0):
<calcularNumBits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <log@plt>
mov    %eax,-0x24(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcularNumBits>:
push   %rbx
subsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <log@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @calcularNumBits(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %5
%10 = load double, double* %4
%11 = fsub double %9, %10
%12 = load double, double* %6
%13 = fdiv double %11, %12
%14 = fptosi double %13 to i32
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = call i32 @log(i32 %15)
%17 = call i32 @log(i32 2)
%18 = sdiv i32 %16, %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %8
%20 = load i32, i32* %8
ret i32 %20
}

LLVM IR (-O2):
define i32 @calcularNumBits(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = fdiv double %4, %2
%6 = fptosi double %5 to i32
%7 = tail call i32 @log(i32 %6)
%8 = tail call i32 @log(i32 2)
%9 = sdiv i32 %7, %8
%10 = add nsw i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
int main() {
  float fac(float n);
  float i;
  for (i = 1; i <= 20; i++)
    printf("%.f!=%.f\n", i, fac(i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec0(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     118d <main+0x6d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fac@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
movss  0xe82(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <main+0x1c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
lea    0xed1(%rip),%rbx
nop
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x4(%rsp)
call   1030 <fac@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movss  0x4(%rsp),%xmm0
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x15,%ebp
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%.f!=%.f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 1.000000e+00, float* %2
br label %3
3: ; preds = %11, %0
%4 = load float, float* %2
%5 = fcmp ole float %4, 2.000000e+01
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load float, float* %2
%8 = load float, float* %2
%9 = call float @fac(float %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %7, float %9)
br label %11
11: ; preds = %6
%12 = load float, float* %2
%13 = fadd float %12, 1.000000e+00
store float %13, float* %2
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%.f!=%.f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = sitofp i32 %2 to float
%4 = tail call float @fac(float %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %3, float %4)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 21
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
void __attribute__((aarch64_vector_pcs)) h(int *a) { f(a); }


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

x86 assembly (clang, -O2):
<h>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @h(i32* %0) {
%2 = tail call i32 @f(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int vixPlaybackFrameSelect(unsigned int frame) {
  printf("[genfb-demo-driver] "
         "frameselect: %d\n",
         frame);
  return (0);
}


x86 assembly (clang, -O0):
<vixPlaybackFrameSelect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vixPlaybackFrameSelect>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"[genfb-demo-driver] frameselect: %d\0A\00"
define i32 @vixPlaybackFrameSelect(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"[genfb-demo-driver] frameselect: %d\0A\00"
define i32 @vixPlaybackFrameSelect(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
extern void SetChar(signed char *chr) { *chr = 97; }


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

x86 assembly (clang, -O2):
<SetChar>:
movb   $0x61,(%rdi)
ret

LLVM IR (-O0):
define void @SetChar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8 97, i8* %3
ret void
}

LLVM IR (-O2):
define void @SetChar(i8* nocapture writeonly %0) {
store i8 97, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msim_setWestWall(unsigned int, unsigned int, int);
void msim_setEastWall(unsigned int x, unsigned int y, int existsWall) {
  msim_setWestWall(x + 1, y, existsWall);
}


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

x86 assembly (clang, -O2):
<msim_setEastWall>:
add    $0x1,%edi
jmp    1030 <msim_setWestWall@plt>

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

LLVM IR (-O2):
define void @msim_setEastWall(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, 1
%5 = tail call i32 @msim_setWestWall(i32 %4, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x = 0;
  {
    int x = 1;
    {
      int x = 2;
      {
        int x = 3;
        assert(x == 3);
      }
      assert(x == 2);
    }
    assert(x == 1);
  }
  assert(x == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i32 2, i32* %4
store i32 3, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 3
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 2
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 1
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, char *, int, char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  int a = argc + 1;
  printf("%s running with pid=%i argv1=%s\n", argv[0], getpid(), argv[1]);
  while (1) {
    sleep(1);
    a += 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    %eax,-0x14(%rbp)
jmp    117b <main+0x4b>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%r14
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x8(%rbx),%rcx
lea    0xeb4(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [33 x i8] c"%s running with pid=%i argv1=%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 (...) @getpid()
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i8* %15)
br label %17
17: ; preds = %2, %17
%18 = call i32 @sleep(i32 1)
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %17
}

LLVM IR (-O2):
@.str = [33 x i8] c"%s running with pid=%i argv1=%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 (...) @getpid()
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4, i8* %6)
br label %8
8: ; preds = %8, %2
%9 = tail call i32 @sleep(i32 1)
br label %8
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void sys_error_warn(const char *msg) {
  perror(msg);
  return;
}


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

x86 assembly (clang, -O2):
<sys_error_warn>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @sys_error_warn(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Type definitions */
typedef char uint8_t;
struct utf8lite_render {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ utf8lite_encode_utf8(int /*<<< orphan*/, char **);
int utf8lite_render_string(struct utf8lite_render *, char const *);
int utf8lite_render_char(struct utf8lite_render *r, int32_t ch) {
  uint8_t buf[5];
  uint8_t *ptr = buf;
  utf8lite_encode_utf8(ch, &ptr);
  *ptr = '\0';
  return utf8lite_render_string(r, (const char *)buf);
}


x86 assembly (clang, -O0):
<utf8lite_render_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x11(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1030 <utf8lite_encode_utf8@plt>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x11(%rbp),%rsi
call   1040 <utf8lite_render_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8lite_render_char>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%eax
mov    %rdi,%rbx
lea    0x13(%rsp),%r14
mov    %r14,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %eax,%edi
call   1030 <utf8lite_encode_utf8@plt>
mov    0x8(%rsp),%rax
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <utf8lite_render_string@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.utf8lite_render = type { i32 }
define i32 @utf8lite_render_char(%struct.utf8lite_render* %0, i32 %1) {
%3 = alloca %struct.utf8lite_render*
%4 = alloca i32
%5 = alloca [5 x i8]
%6 = alloca i8*
store %struct.utf8lite_render* %0, %struct.utf8lite_render** %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
store i8* %7, i8** %6
%8 = load i32, i32* %4
%9 = call i32 @utf8lite_encode_utf8(i32 %8, i8** %6)
%10 = load i8*, i8** %6
store i8 0, i8* %10
%11 = load %struct.utf8lite_render*, %struct.utf8lite_render** %3
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%13 = call i32 @utf8lite_render_string(%struct.utf8lite_render* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.utf8lite_render = type { i32 }
define i32 @utf8lite_render_char(%struct.utf8lite_render* %0, i32 %1) {
%3 = alloca [5 x i8]
%4 = alloca i8*
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%6 = bitcast i8** %4 to i8*
store i8* %5, i8** %4
%7 = call i32 @utf8lite_encode_utf8(i32 %1, i8** %4)
%8 = load i8*, i8** %4
store i8 0, i8* %8
%9 = call i32 @utf8lite_render_string(%struct.utf8lite_render* %0, i8* %5)
ret i32 %9
}