xunge/DecIR huggingface dataset:
/* Variables and functions */
int rand();
double randn() { return (((double)(rand() % 2000) / 1000.0) - 1.0); }


x86 assembly (clang, -O0):
<randn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x7d0,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xed9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xec5(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randn>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x7d0,%ecx,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
divsd  0xebe(%rip),%xmm0
addsd  0xebe(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @randn() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 2000
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 1.000000e+03
%5 = fsub double %4, 1.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @randn() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 2000
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 1.000000e+03
%5 = fadd double %4, -1.000000e+00
ret double %5
}
/* Variables and functions */
long factorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  printf("Enter a number: ");
  scanf("%d", &num);
  long int f;
  f = factorial(num);
  printf("The factorial of %d is %ld.\n", num, f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <factorial@plt>
mov    0x4(%rsp),%esi
lea    0xeb0(%rip),%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"The factorial of %d is %ld.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i64 @factorial(i32 %6)
store i64 %7, i64* %3
%8 = load i32, i32* %2
%9 = load i64, i64* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %8, i64 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"The factorial of %d is %ld.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @factorial(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %7, i64 %6)
ret i32 0
}
/* Variables and functions */
char *calloc(int, scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *apesq__strdup(char *src) {
  char *dest = calloc(1, strlen(src) + 1);
  strcpy(dest, src);
  return dest;
}


x86 assembly (clang, -O0):
<apesq__strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
add    $0x1,%rsi
mov    $0x1,%edi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apesq__strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
mov    $0x1,%edi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @apesq__strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @calloc(i32 1, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @apesq__strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @calloc(i32 1, i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void irc_message(char *target, char *message) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s :%s", "PRIVMSG", target, message);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    $0x1fd,%esi
lea    0xeb2(%rip),%rdx
lea    0xeb5(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_message>:
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r9
mov    %rdi,%r8
lea    0xecb(%rip),%rdx
lea    0xece(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%s %s :%s\00"
@.str.1 = [8 x i8] c"PRIVMSG\00"
define void @irc_message(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [509 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 509, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%11 = call i32 @net_send(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s %s :%s\00"
@.str.1 = [8 x i8] c"PRIVMSG\00"
define void @irc_message(i8* %0, i8* %1) {
%3 = alloca [509 x i8]
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 509, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @net_send(i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ pow(double, double);
unsigned int SYS32_TstBit(unsigned short bit, unsigned int value) {
  return (((value & (unsigned int)(pow(2.0, (double)bit))) >> bit));
}


x86 assembly (clang, -O0):
<SYS32_TstBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movzwl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xec8(%rip),%xmm0
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
movzwl -0x2(%rbp),%ecx
shr    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SYS32_TstBit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
cvtsi2sd %edi,%xmm1
movsd  0xedd(%rip),%xmm0
call   1030 <pow@plt>
and    %ebx,%eax
mov    %ebp,%ecx
shr    %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SYS32_TstBit(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i16, i16* %3
%7 = uitofp i16 %6 to double
%8 = call i64 @pow(double 2.000000e+00, double %7)
%9 = trunc i64 %8 to i32
%10 = and i32 %5, %9
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = lshr i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @SYS32_TstBit(i16 zeroext %0, i32 %1) {
%3 = uitofp i16 %0 to double
%4 = tail call i64 @pow(double 2.000000e+00, double %3)
%5 = trunc i64 %4 to i32
%6 = and i32 %5, %1
%7 = zext i16 %0 to i32
%8 = lshr i32 %6, %7
ret i32 %8
}
float UI_ClampCvar(float min, float max, float value) {
  if (value < min) {
    return min;
  }
  if (value > max) {
    return max;
  }
  return value;
}


x86 assembly (clang, -O0):
<UI_ClampCvar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <UI_ClampCvar+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <UI_ClampCvar+0x5d>
movss  -0x10(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <UI_ClampCvar+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <UI_ClampCvar+0x5d>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_ClampCvar>:
minss  %xmm2,%xmm1
cmpltss %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @UI_ClampCvar(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %7
%9 = load float, float* %5
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %5
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %7
%15 = load float, float* %6
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %6
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %7
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @UI_ClampCvar(float %0, float %1, float %2) {
%4 = fcmp olt float %2, %0
%5 = fcmp ogt float %2, %1
%6 = select i1 %5, float %1, float %2
%7 = select i1 %4, float %0, float %6
ret float %7
}
void hai(void) { printf('hai there, from the Grandpa C language'); }


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

x86 assembly (clang, -O2):
<hai>:
mov    $0x75616765,%edi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
define void @hai() {
%1 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1969317733 to i8*))
ret void
}

LLVM IR (-O2):
define void @hai() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1969317733 to i8*))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EMLINK;
int /*<<< orphan*/ errno;
int _link(char *old, char *new) {
  errno = EMLINK;
  return -1;
}


x86 assembly (clang, -O0):
<_link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_link>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@EMLINK = global i32 0
@errno = global i32 0
define i32 @_link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EMLINK
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vgop_set_brokenlink(uint8_t *p_mp2vgop) { p_mp2vgop[7] |= 0x20; }


x86 assembly (clang, -O0):
<mp2vgop_set_brokenlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
or     $0x20,%ecx
mov    %ecx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vgop_set_brokenlink>:
orb    $0x20,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @mp2vgop_set_brokenlink(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = or i32 %5, 32
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @mp2vgop_set_brokenlink(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = or i32 %3, 32
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("Usage rs485test [s] [m] -d DEVICE\n"
         " -l [LENGTH] singelshoot\n"
         " -s set RS485 settings\n"
         " -m master mode\n"
         " -v verbose\n"
         " -d device like /dev/ttyS1\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [138 x i8] c"Usage rs485test [s] [m] -d DEVICE\0A -l [LENGTH] singelshoot\0A -s set RS485 settings\0A -m master mode\0A -v verbose\0A -d device like /dev/ttyS1\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [137 x i8] c"Usage rs485test [s] [m] -d DEVICE\0A -l [LENGTH] singelshoot\0A -s set RS485 settings\0A -m master mode\0A -v verbose\0A -d device like /dev/ttyS1\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([137 x i8], [137 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int _lseek(int file, int ptr, int dir) {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<_lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebb(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lseek>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_lseek(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* @ENOTSUP
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOTSUP
store i32 %4, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void ip_set_version(uint8_t *p_ip, uint8_t version) {
  p_ip[0] &= ~0xf0;
  p_ip[0] |= (version & 0xf) << 4;
}


x86 assembly (clang, -O0):
<ip_set_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xffffff0f,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xf,%ecx
shl    $0x4,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_set_version>:
mov    $0xffffff0f,%eax
and    (%rdi),%eax
shl    $0x4,%esi
movzbl %sil,%ecx
or     %eax,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @ip_set_version(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = and i32 %7, -241
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 15
%11 = shl i32 %10, 4
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @ip_set_version(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, -241
%5 = shl i32 %1, 4
%6 = and i32 %5, 240
%7 = or i32 %4, %6
store i32 %7, i32* %0
ret void
}
const char *ucdn_get_unicode_version(void) { return "11.0.0"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"11.0.0\00"
define i8* @ucdn_get_unicode_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"11.0.0\00"
define i8* @ucdn_get_unicode_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ clr_1();
int /*<<< orphan*/ clr_2();
int /*<<< orphan*/ clr_3();
int main() {
  clr_1();
  clr_2();
  clr_3();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clr_1@plt>
mov    $0x0,%al
call   1050 <clr_2@plt>
mov    $0x0,%al
call   1040 <clr_3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @clr_1()
%3 = call i32 (...) @clr_2()
%4 = call i32 (...) @clr_3()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @clr_1()
%2 = tail call i32 (...) @clr_2()
%3 = tail call i32 (...) @clr_3()
ret i32 0
}
int isspace(int c) { return ((unsigned)c - '\t' < 5) | (c == ' '); }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x9,%eax
cmp    $0x5,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x20,-0x4(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
lea    -0x9(%rdi),%eax
cmp    $0x5,%eax
setb   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 9
%5 = icmp ult i32 %4, 5
%6 = zext i1 %5 to i32
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 32
%9 = zext i1 %8 to i32
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 5
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double coef(int);
double horner(double x) {
  double u = coef(100);
  for (int i = 99; i >= 0; i--)
    u = u * x + coef(i);
  return u;
}


x86 assembly (clang, -O0):
<horner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <coef@plt>
movsd  %xmm0,-0x10(%rbp)
movl   $0x63,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1181 <horner+0x71>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <coef@plt>
movsd  -0x28(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <horner+0x23>
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<horner>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,(%rsp)
mov    $0x64,%edi
call   1030 <coef@plt>
movapd %xmm0,%xmm1
mov    $0x63,%ebx
nopl   (%rax)
movsd  %xmm1,0x8(%rsp)
mov    %ebx,%edi
call   1030 <coef@plt>
movsd  0x8(%rsp),%xmm1
mulsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
add    $0xffffffff,%ebx
jb     1130 <horner+0x20>
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @horner(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %2
%5 = call double @coef(i32 100)
store double %5, double* %3
store i32 99, i32* %4
br label %6
6: ; preds = %15, %1
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load double, double* %3
%11 = load double, double* %2
%12 = load i32, i32* %4
%13 = call double @coef(i32 %12)
%14 = call double @llvm.fmuladd.f64(double %10, double %11, double %13)
store double %14, double* %3
br label %15
15: ; preds = %9
%16 = load i32, i32* %4
%17 = add nsw i32 %16, -1
store i32 %17, i32* %4
br label %6
18: ; preds = %6
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @horner(double %0) {
%2 = tail call double @coef(i32 100)
br label %4
3: ; preds = %4
ret double %8
4: ; preds = %1, %4
%5 = phi i32 [ 99, %1 ], [ %9, %4 ]
%6 = phi double [ %2, %1 ], [ %8, %4 ]
%7 = tail call double @coef(i32 %5)
%8 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %7)
%9 = add nsw i32 %5, -1
%10 = icmp eq i32 %5, 0
br i1 %10, label %3, label %4
}
void av_opt_eval_flags() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_eval_flags() {
ret void
}
void clean_buffer_ut804(unsigned char *buffer_ut804) {
  buffer_ut804[0] = 0;
  buffer_ut804[1] = 0;
  buffer_ut804[2] = 0;
  buffer_ut804[3] = 0;
  buffer_ut804[4] = 0;
  buffer_ut804[5] = 0;
  buffer_ut804[6] = 0;
  buffer_ut804[7] = 0;
  buffer_ut804[8] = 0;
  buffer_ut804[9] = 0;
  buffer_ut804[10] = 0;
}


x86 assembly (clang, -O0):
<clean_buffer_ut804>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x5(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x6(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x7(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x8(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x9(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0xa(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_buffer_ut804>:
movl   $0x0,0x7(%rdi)
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @clean_buffer_ut804(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 0, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 0, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 0, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 3
store i8 0, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 4
store i8 0, i8* %12
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 5
store i8 0, i8* %14
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 6
store i8 0, i8* %16
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 7
store i8 0, i8* %18
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 8
store i8 0, i8* %20
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 9
store i8 0, i8* %22
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i64 10
store i8 0, i8* %24
ret void
}

LLVM IR (-O2):
define void @clean_buffer_ut804(i8* nocapture writeonly %0) {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int be2int(unsigned char *buf) {
  int32_t res = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
  return res;
}


x86 assembly (clang, -O0):
<be2int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be2int>:
mov    (%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @be2int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
void snmp_synch_setup(struct snmp_session *notused) {}


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

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

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

LLVM IR (-O2):
%struct.snmp_session = type opaque
define void @snmp_synch_setup(%struct.snmp_session* nocapture %0) {
ret void
}
char *XLocaleOfFontSet() {}


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

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

LLVM IR (-O0):
define i8* @XLocaleOfFontSet() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @XLocaleOfFontSet() {
ret i8* undef
}
void rop3_84_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = *D | stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_84_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_84_0_0>:
or     %edx,%esi
mov    (%rdi),%al
not    %al
and    %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_84_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = load i8*, i8** %4
store i8 %30, i8* %31
ret void
}

LLVM IR (-O2):
define void @rop3_84_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, -1
%7 = and i8 %4, %6
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
float roundf(float);
void vec3_round(float *dst) {
  dst[0] = roundf(dst[0]);
  dst[1] = roundf(dst[1]);
  dst[2] = roundf(dst[2]);
}


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

x86 assembly (clang, -O2):
<vec3_round>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  %xmm1,0xc(%rsp)
call   1030 <roundf@plt>
movss  %xmm0,(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <roundf@plt>
movss  %xmm0,0x4(%rbx)
movss  0x8(%rbx),%xmm0
call   1030 <roundf@plt>
movss  %xmm0,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @vec3_round(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = call float @llvm.round.f32(float %5)
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = call float @llvm.round.f32(float %11)
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = call float @llvm.round.f32(float %17)
%19 = load float*, float** %2
%20 = getelementptr inbounds float, float* %19, i64 2
store float %18, float* %20
ret void
}

LLVM IR (-O2):
define void @vec3_round(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @llvm.round.f32(float %2)
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = tail call float @llvm.round.f32(float %5)
store float %6, float* %4
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.round.f32(float %8)
store float %9, float* %7
ret void
}
int is_inside(int *v, int f, int n) {
  int i;
  for (i = 0; i < n; i++) {
    if (v[i] == f)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_inside>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1154 <is_inside+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1141 <is_inside+0x41>
movl   $0x0,-0x4(%rbp)
jmp    115b <is_inside+0x5b>
jmp    1146 <is_inside+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <is_inside+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_inside>:
mov    $0x1,%eax
test   %edx,%edx
jle    111e <is_inside+0x1e>
mov    %edx,%ecx
xor    %edx,%edx
nopl   (%rax)
cmp    %esi,(%rdi,%rdx,4)
je     111f <is_inside+0x1f>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <is_inside+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_inside(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %1
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %16
}
long read32(unsigned long reg1) {
  unsigned long *reg;
  signed long val;
  reg = (unsigned long *)reg1;
  val = (long)*(reg);
  return val;
}


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

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

LLVM IR (-O0):
define i64 @read32(i64 %0) {
%2 = alloca i64
%3 = alloca i64*
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = inttoptr i64 %5 to i64*
store i64* %6, i64** %3
%7 = load i64*, i64** %3
%8 = load i64, i64* %7
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @read32(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
double atan(double);
double pow(int, double);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  printf("pow(0, -100) == %f\n", pow(0, -100));
  printf("pow(-4, 0.5) == %f\n", pow(-4, 0.5));
  printf("PI approximation using tangeante: %f\n", atan(999999999999.0) * 2.0);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
movsd  0xecf(%rip),%xmm0
call   1050 <pow@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfffffffc,%edi
movsd  0xea9(%rip),%xmm0
call   1050 <pow@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe88(%rip),%xmm0
call   1040 <atan@plt>
movsd  0xe73(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
xor    %edi,%edi
call   1050 <pow@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb4(%rip),%xmm0
mov    $0xfffffffc,%edi
call   1050 <pow@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe9e(%rip),%xmm0
call   1040 <atan@plt>
lea    0xeca(%rip),%rdi
movsd  0xe92(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"pow(0, -100) == %f\0A\00"
@.str.1 = [20 x i8] c"pow(-4, 0.5) == %f\0A\00"
@.str.2 = [38 x i8] c"PI approximation using tangeante: %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @pow(i32 0, double -1.000000e+02)
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @pow(i32 -4, double 5.000000e-01)
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call double @atan(double 0x426D1A94A1FFE000)
%7 = fmul double %6, 2.000000e+00
%8 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"pow(0, -100) == %f\0A\00"
@.str.1 = [20 x i8] c"pow(-4, 0.5) == %f\0A\00"
@.str.2 = [38 x i8] c"PI approximation using tangeante: %f\0A\00"
define i32 @main() {
%1 = tail call double @pow(i32 0, double -1.000000e+02)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @pow(i32 -4, double 5.000000e-01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @atan(double 0x426D1A94A1FFE000)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double 0x400921FB54441B81)
ret i32 0
}
/* Variables and functions */
double ln_get_earth_solar_dist(double);
double ln_get_solar_sdiam(double JD) {
  double So = 959.63;
  double dist;
  dist = ln_get_earth_solar_dist(JD);
  return So / dist;
}


x86 assembly (clang, -O0):
<ln_get_solar_sdiam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_earth_solar_dist@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_solar_sdiam>:
push   %rax
call   1030 <ln_get_earth_solar_dist@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ln_get_solar_sdiam(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 0x408DFD0A3D70A3D7, double* %3
%5 = load double, double* %2
%6 = call double @ln_get_earth_solar_dist(double %5)
store double %6, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @ln_get_solar_sdiam(double %0) {
%2 = tail call double @ln_get_earth_solar_dist(double %0)
%3 = fdiv double 0x408DFD0A3D70A3D7, %2
ret double %3
}
int verify_benchmark(int r) {
  int exp = 832040;
  if (r != exp)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verify_benchmark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0xcb228,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1126 <verify_benchmark+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <verify_benchmark+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_benchmark>:
xor    %eax,%eax
cmp    $0xcb228,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @verify_benchmark(i32 %0) {
%2 = icmp eq i32 %0, 832040
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned
FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(
    unsigned limit, unsigned blocksize, unsigned predictor_order) {
  unsigned max_rice_partition_order = limit;
  while (max_rice_partition_order > 0 &&
         (blocksize >> max_rice_partition_order) <= predictor_order)
    max_rice_partition_order--;
  ;
  return max_rice_partition_order;
}


x86 assembly (clang, -O0):
<FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jbe    1133 <FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order+0x33>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
shr    %cl,%eax
cmp    -0xc(%rbp),%eax
setbe  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1143 <FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order+0x43>
jmp    1151 <FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order+0x51>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1113 <FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order+0x13>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order>:
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %esi,%eax
shr    %cl,%eax
sub    $0x1,%ecx
jb     111d <FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order+0x1d>
cmp    %edx,%eax
jbe    1110 <FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order+0x10>
add    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(i32 %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32 [ %0, %3 ], [ %10, %4 ]
%6 = icmp eq i32 %5, 0
%7 = lshr i32 %1, %5
%8 = icmp ugt i32 %7, %2
%9 = select i1 %6, i1 true, i1 %8
%10 = add i32 %5, -1
br i1 %9, label %11, label %4
11: ; preds = %4
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
size_t uint32_size(uint32_t v) {
  if (v < (1 << 7)) {
    return 1;
  } else if (v < (1 << 14)) {
    return 2;
  } else if (v < (1 << 21)) {
    return 3;
  } else if (v < (1 << 28)) {
    return 4;
  } else {
    return 5;
  }
}


x86 assembly (clang, -O0):
<uint32_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    1121 <uint32_size+0x21>
movq   $0x1,-0x8(%rbp)
jmp    1177 <uint32_size+0x77>
cmpl   $0x4000,-0xc(%rbp)
jge    113b <uint32_size+0x3b>
movq   $0x2,-0x8(%rbp)
jmp    1177 <uint32_size+0x77>
cmpl   $0x200000,-0xc(%rbp)
jge    1155 <uint32_size+0x55>
movq   $0x3,-0x8(%rbp)
jmp    1177 <uint32_size+0x77>
cmpl   $0x10000000,-0xc(%rbp)
jge    116f <uint32_size+0x6f>
movq   $0x4,-0x8(%rbp)
jmp    1177 <uint32_size+0x77>
movq   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32_size>:
mov    $0x1,%eax
cmp    $0x80,%edi
jl     1136 <uint32_size+0x36>
mov    $0x2,%eax
cmp    $0x4000,%edi
jb     1136 <uint32_size+0x36>
mov    $0x3,%eax
cmp    $0x200000,%edi
jb     1136 <uint32_size+0x36>
cmp    $0x10000000,%edi
mov    $0x5,%eax
sbb    $0x0,%rax
ret

LLVM IR (-O0):
define i64 @uint32_size(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %20
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 16384
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 2, i64* %2
br label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 2097152
br i1 %13, label %14, label %15
14: ; preds = %11
store i64 3, i64* %2
br label %20
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 268435456
br i1 %17, label %18, label %19
18: ; preds = %15
store i64 4, i64* %2
br label %20
19: ; preds = %15
store i64 5, i64* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i64, i64* %2
ret i64 %21
}

LLVM IR (-O2):
define i64 @uint32_size(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 16384
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 2097152
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 268435456
%9 = select i1 %8, i64 4, i64 5
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i64 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i64 %11
}
long long smin2(long long a, long long b) { return a ^ ((a ^ b) & -(a >= b)); }


x86 assembly (clang, -O0):
<smin2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
xor    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
cmp    -0x10(%rbp),%rdx
setge  %dl
and    $0x1,%dl
movzbl %dl,%esi
xor    %edx,%edx
sub    %esi,%edx
movslq %edx,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smin2>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @smin2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = xor i64 %6, %7
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = icmp sge i64 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 0, %12
%14 = sext i32 %13 to i64
%15 = and i64 %8, %14
%16 = xor i64 %5, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @smin2(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
struct packet_info {
  int dummy;
};
struct context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void packet_crash(struct context *context_unused,
                  const struct packet_info *info_unused) {
  (void)context_unused;
  (void)info_unused;
  abort();
}


x86 assembly (clang, -O0):
<packet_crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<packet_crash>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.context = type { i32 }
%struct.packet_info = type { i32 }
define void @packet_crash(%struct.context* %0, %struct.packet_info* %1) {
%3 = alloca %struct.context*
%4 = alloca %struct.packet_info*
store %struct.context* %0, %struct.context** %3
store %struct.packet_info* %1, %struct.packet_info** %4
%5 = load %struct.context*, %struct.context** %3
%6 = load %struct.packet_info*, %struct.packet_info** %4
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.context = type { i32 }
%struct.packet_info = type { i32 }
define void @packet_crash(%struct.context* nocapture readnone %0, %struct.packet_info* nocapture readnone %1) {
%3 = tail call i32 (...) @abort()
unreachable
}