xunge/DecIR huggingface dataset:
double ussu(double a, int b) {
  double result = 1;
  for (int i = 0; i < b; i++) {
    result *= a;
  }
  return result;
}


x86 assembly (clang, -O0):
<ussu>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1149 <ussu+0x49>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1120 <ussu+0x20>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ussu>:
test   %edi,%edi
jle    111b <ussu+0x1b>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    1124 <ussu+0x24>
movsd  0xee7(%rip),%xmm1
jmp    1155 <ussu+0x55>
movsd  0xedd(%rip),%xmm0
ret
and    $0xfffffff8,%edi
movsd  0xed1(%rip),%xmm1
nop
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffff8,%edi
jne    1130 <ussu+0x30>
test   %eax,%eax
je     1169 <ussu+0x69>
nopl   0x0(%rax)
mulsd  %xmm0,%xmm1
add    $0xffffffff,%eax
jne    1160 <ussu+0x60>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ussu(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
store double 1.000000e+00, double* %5
store i32 0, i32* %6
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load double, double* %3
%13 = load double, double* %5
%14 = fmul double %13, %12
store double %14, double* %5
br label %15
15: ; preds = %11
%16 = load i32, i32* %6
%17 = add nsw i32 %16, 1
store i32 %17, i32* %6
br label %7
18: ; preds = %7
%19 = load double, double* %5
ret double %19
}

LLVM IR (-O2):
define double @ussu(double %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %20
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = and i32 %1, -8
br label %22
10: ; preds = %22, %4
%11 = phi double [ undef, %4 ], [ %32, %22 ]
%12 = phi double [ 1.000000e+00, %4 ], [ %32, %22 ]
%13 = icmp eq i32 %6, 0
br i1 %13, label %20, label %14
14: ; preds = %10, %14
%15 = phi double [ %17, %14 ], [ %12, %10 ]
%16 = phi i32 [ %18, %14 ], [ 0, %10 ]
%17 = fmul double %15, %0
%18 = add i32 %16, 1
%19 = icmp eq i32 %18, %6
br i1 %19, label %20, label %14
20: ; preds = %10, %14, %2
%21 = phi double [ 1.000000e+00, %2 ], [ %11, %10 ], [ %17, %14 ]
ret double %21
22: ; preds = %22, %8
%23 = phi double [ 1.000000e+00, %8 ], [ %32, %22 ]
%24 = phi i32 [ 0, %8 ], [ %33, %22 ]
%25 = fmul double %23, %0
%26 = fmul double %25, %0
%27 = fmul double %26, %0
%28 = fmul double %27, %0
%29 = fmul double %28, %0
%30 = fmul double %29, %0
%31 = fmul double %30, %0
%32 = fmul double %31, %0
%33 = add i32 %24, 8
%34 = icmp eq i32 %33, %9
br i1 %34, label %10, label %22
}
/* Type definitions */
struct shape_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ circle_init(struct shape_data *, double);
double random_double();
void circle_random_init(struct shape_data *data) {
  double r = random_double();
  circle_init(data, r);
}


x86 assembly (clang, -O0):
<circle_random_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <random_double@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1030 <circle_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle_random_init>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <random_double@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <circle_init@plt>

LLVM IR (-O0):
%struct.shape_data = type { i32 }
define void @circle_random_init(%struct.shape_data* %0) {
%2 = alloca %struct.shape_data*
%3 = alloca double
store %struct.shape_data* %0, %struct.shape_data** %2
%4 = call double (...) @random_double()
store double %4, double* %3
%5 = load %struct.shape_data*, %struct.shape_data** %2
%6 = load double, double* %3
%7 = call i32 @circle_init(%struct.shape_data* %5, double %6)
ret void
}

LLVM IR (-O2):
%struct.shape_data = type { i32 }
define void @circle_random_init(%struct.shape_data* %0) {
%2 = tail call double (...) @random_double()
%3 = tail call i32 @circle_init(%struct.shape_data* %0, double %2)
ret void
}
int init_cpu_deps(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_cpu_deps() {
ret i32 0
}
/* Variables and functions */
int I2C_PutByte(unsigned char);
int /*<<< orphan*/ I2C_STOP();
unsigned char I2C_Set_ReadAddress(unsigned char uRmiAddress) {
  if (I2C_PutByte(0x20 << 1) == 0x01) {
    I2C_STOP();
    return 0x01;
  }
  if (I2C_PutByte((unsigned char)uRmiAddress) == 0x01) {
    I2C_STOP();
    return 0x01;
  }
  I2C_STOP();
  return 0x00;
}


x86 assembly (clang, -O0):
<I2C_Set_ReadAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    $0x40,%edi
call   1030 <I2C_PutByte@plt>
cmp    $0x1,%eax
jne    1151 <I2C_Set_ReadAddress+0x31>
mov    $0x0,%al
call   1040 <I2C_STOP@plt>
movb   $0x1,-0x1(%rbp)
jmp    117e <I2C_Set_ReadAddress+0x5e>
movzbl -0x2(%rbp),%edi
call   1030 <I2C_PutByte@plt>
cmp    $0x1,%eax
jne    1173 <I2C_Set_ReadAddress+0x53>
mov    $0x0,%al
call   1040 <I2C_STOP@plt>
movb   $0x1,-0x1(%rbp)
jmp    117e <I2C_Set_ReadAddress+0x5e>
mov    $0x0,%al
call   1040 <I2C_STOP@plt>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2C_Set_ReadAddress>:
push   %rbx
mov    %edi,%ebx
mov    $0x40,%edi
call   1030 <I2C_PutByte@plt>
cmp    $0x1,%eax
jne    113d <I2C_Set_ReadAddress+0x1d>
xor    %eax,%eax
call   1040 <I2C_STOP@plt>
mov    $0x1,%bl
jmp    1152 <I2C_Set_ReadAddress+0x32>
movzbl %bl,%edi
call   1030 <I2C_PutByte@plt>
cmp    $0x1,%eax
sete   %bl
xor    %eax,%eax
call   1040 <I2C_STOP@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @I2C_Set_ReadAddress(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32 @I2C_PutByte(i8 zeroext 64)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @I2C_STOP()
store i8 1, i8* %2
br label %16
8: ; preds = %1
%9 = load i8, i8* %3
%10 = call i32 @I2C_PutByte(i8 zeroext %9)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @I2C_STOP()
store i8 1, i8* %2
br label %16
14: ; preds = %8
%15 = call i32 (...) @I2C_STOP()
store i8 0, i8* %2
br label %16
16: ; preds = %14, %12, %6
%17 = load i8, i8* %2
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @I2C_Set_ReadAddress(i8 zeroext %0) {
%2 = tail call i32 @I2C_PutByte(i8 zeroext 64)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @I2C_STOP()
br label %11
6: ; preds = %1
%7 = tail call i32 @I2C_PutByte(i8 zeroext %0)
%8 = icmp eq i32 %7, 1
%9 = tail call i32 (...) @I2C_STOP()
%10 = zext i1 %8 to i8
br label %11
11: ; preds = %6, %4
%12 = phi i8 [ 1, %4 ], [ %10, %6 ]
ret i8 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  } else {
    stream = stderr;
  }
  fprintf(stream, "Usage: %s <oldfd> [newfd]\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
jne    1154 <helpAndLeave+0x34>
mov    0x2e90(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1162 <helpAndLeave+0x42>
mov    0x2e85(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe8f(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@stderr = global i32* null
@.str = [27 x i8] c"Usage: %s <oldfd> [newfd]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* @EXIT_SUCCESS
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32*, i32** @stdout
store i32* %10, i32** %5
br label %13
11: ; preds = %2
%12 = load i32*, i32** @stderr
store i32* %12, i32** %5
br label %13
13: ; preds = %11, %9
%14 = load i32*, i32** %5
%15 = load i8*, i8** %3
%16 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* %4
%18 = call i32 @exit(i32 %17)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@stderr = global i32* null
@.str = [27 x i8] c"Usage: %s <oldfd> [newfd]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ USB1_DriverIRQHandler();
__attribute__((weak)) void USB1_IRQHandler(void) { USB1_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @USB1_IRQHandler() {
%1 = call i32 (...) @USB1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @USB1_IRQHandler() {
%1 = tail call i32 (...) @USB1_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mpga_get_mode_ext(const uint8_t *p_mpga) {
  return (p_mpga[3] & 0x30) >> 4;
}


x86 assembly (clang, -O0):
<mpga_get_mode_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0x30,%eax
sar    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_get_mode_ext>:
mov    0xc(%rdi),%eax
shr    $0x4,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @mpga_get_mode_ext(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, 48
%7 = ashr i32 %6, 4
ret i32 %7
}

LLVM IR (-O2):
define i32 @mpga_get_mode_ext(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = lshr i32 %3, 4
%5 = and i32 %4, 3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void earlyAbortHandler() {
  printf("</BODY></HTML>");
  exit(0);
}


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

x86 assembly (clang, -O2):
<earlyAbortHandler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"</BODY></HTML>\00"
define void @earlyAbortHandler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"</BODY></HTML>\00"
define void @earlyAbortHandler() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
long long int Ldiv(long long int x, long long int y) { return x / y; }


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

x86 assembly (clang, -O2):
<Ldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <Ldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @Ldiv(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* %4
%7 = sdiv i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @Ldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputc(int, int /*<<< orphan*/ *);
int _sys_fputc(int ch, FILE *file) { return (fputc(ch, file)); }


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

x86 assembly (clang, -O2):
<_sys_fputc>:
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define i32 @_sys_fputc(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @fputc(i32 %0, i32* %1)
ret i32 %3
}
/* Type definitions */
struct in6_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ errAbort(char *, int);
int /*<<< orphan*/ ip6AddrFlipBits(struct in6_addr *);
int /*<<< orphan*/ ip6AddrMaskLeft(struct in6_addr *, int);
void ip6AddrMaskRight(struct in6_addr *ip, int bits) {
  if ((bits > 128) || (bits < 0))
    errAbort("bad bits %d in ip6AddrMaskRight", bits);
  ip6AddrMaskLeft(ip, 128 - bits);
  ip6AddrFlipBits(ip);
}


x86 assembly (clang, -O0):
<ip6AddrMaskRight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jg     1156 <ip6AddrMaskRight+0x26>
cmpl   $0x0,-0xc(%rbp)
jge    1165 <ip6AddrMaskRight+0x35>
mov    -0xc(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <errAbort@plt>
mov    -0x8(%rbp),%rdi
mov    $0x80,%esi
sub    -0xc(%rbp),%esi
call   1040 <ip6AddrMaskLeft@plt>
mov    -0x8(%rbp),%rdi
call   1050 <ip6AddrFlipBits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip6AddrMaskRight>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
cmp    $0x81,%esi
jb     114e <ip6AddrMaskRight+0x1e>
lea    0xeb9(%rip),%rdi
mov    %ebp,%esi
call   1030 <errAbort@plt>
mov    $0x80,%esi
sub    %ebp,%esi
mov    %rbx,%rdi
call   1040 <ip6AddrMaskLeft@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <ip6AddrFlipBits@plt>

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
@.str = [32 x i8] c"bad bits %d in ip6AddrMaskRight\00"
define void @ip6AddrMaskRight(%struct.in6_addr* %0, i32 %1) {
%3 = alloca %struct.in6_addr*
%4 = alloca i32
store %struct.in6_addr* %0, %struct.in6_addr** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 128
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7, %2
%11 = load i32, i32* %4
%12 = call i32 @errAbort(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %7
%14 = load %struct.in6_addr*, %struct.in6_addr** %3
%15 = load i32, i32* %4
%16 = sub nsw i32 128, %15
%17 = call i32 @ip6AddrMaskLeft(%struct.in6_addr* %14, i32 %16)
%18 = load %struct.in6_addr*, %struct.in6_addr** %3
%19 = call i32 @ip6AddrFlipBits(%struct.in6_addr* %18)
ret void
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
@.str = [32 x i8] c"bad bits %d in ip6AddrMaskRight\00"
define void @ip6AddrMaskRight(%struct.in6_addr* %0, i32 %1) {
%3 = icmp ugt i32 %1, 128
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @errAbort(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %6
6: ; preds = %2, %4
%7 = sub nsw i32 128, %1
%8 = tail call i32 @ip6AddrMaskLeft(%struct.in6_addr* %0, i32 %7)
%9 = tail call i32 @ip6AddrFlipBits(%struct.in6_addr* %0)
ret void
}
__attribute__((always_)) void __clear_bit(int nr,
                                          volatile unsigned long *addr) {
  __asm__ __volatile__("btrl %1,%0"
                       : "=m"((*(volatile long *)addr))
                       : "Ir"(nr));
}


x86 assembly (clang, -O0):
<__clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btr    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__clear_bit>:
btr    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @__clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @__clear_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "btrl $1,$0", "=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, int, size_t, int /*<<< orphan*/ *);
int DefaultLoadFunction(void *element, void *arg, FILE *Infile) {
  size_t len = *(size_t *)arg;
  return len == fread(element, 1, len, Infile);
}


x86 assembly (clang, -O0):
<DefaultLoadFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DefaultLoadFunction>:
push   %rbx
mov    %rdx,%rcx
mov    (%rsi),%rbx
mov    $0x1,%esi
mov    %rbx,%rdx
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @DefaultLoadFunction(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = load i8*, i8** %4
%13 = load i64, i64* %7
%14 = load i32*, i32** %6
%15 = call i64 @fread(i8* %12, i32 1, i64 %13, i32* %14)
%16 = icmp eq i64 %11, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @DefaultLoadFunction(i8* nocapture %0, i8* nocapture %1, i32* nocapture %2) {
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %4
%6 = tail call i64 @fread(i8* %0, i32 1, i64 %5, i32* %2)
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exp(int);
double pow(int /*<<< orphan*/, double);
double act_funct(double val) { return 1.0 / (1.0 + pow(exp(1), val)); }


x86 assembly (clang, -O0):
<act_funct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <exp@plt>
mov    %eax,%edi
movsd  -0x8(%rbp),%xmm0
call   1040 <pow@plt>
movsd  0xeb5(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<act_funct>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
call   1030 <exp@plt>
mov    %eax,%edi
movsd  (%rsp),%xmm0
call   1040 <pow@plt>
movsd  0xebc(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @act_funct(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @exp(i32 1)
%4 = load double, double* %2
%5 = call double @pow(i32 %3, double %4)
%6 = fadd double 1.000000e+00, %5
%7 = fdiv double 1.000000e+00, %6
ret double %7
}

LLVM IR (-O2):
define double @act_funct(double %0) {
%2 = tail call i32 @exp(i32 1)
%3 = tail call double @pow(i32 %2, double %0)
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeOneWire(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000001, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeOneWire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeOneWire>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

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

LLVM IR (-O2):
define void @GPIOPinTypeOneWire(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 1, i32 8)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syspool_standard_initialize(int n) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(300, &n, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syspool_standard_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x12c,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syspool_standard_initialize>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x12c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syspool_standard_initialize(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 300, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @syspool_standard_initialize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 300, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
const char *libccnxCommonAbout_ShortNotice(void) {
  return "Copyright (c) 2017 Cisco and/or its affiliates.\n";
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @libccnxCommonAbout_ShortNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @libccnxCommonAbout_ShortNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void pc(char c) { write(1, &c, 1); }


x86 assembly (clang, -O0):
<pc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @pc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @pc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wctype_t;

/* Variables and functions */
wctype_t wctype(const char *property) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @wctype(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int *);
void Sys_ExitThread(int code) { pthread_exit(&code); }


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

x86 assembly (clang, -O2):
<Sys_ExitThread>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <pthread_exit@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @Sys_ExitThread(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pthread_exit(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage() {
  puts("usage: megahal [-[pqrgwbh]]\n"
       "\t-h : show usage\n"
       "\t-p : inhibit prompts\n"
       "\t-q : quiet mode (no replies) enabled at start\n"
       "\t-r : inhibit progress display\n"
       "\t-g : inhibit initial greeting\n"
       "\t-b : inhibit banner display at startup\n"
       "\t-d : sets the directory where your megahal files are\n");
}


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

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

LLVM IR (-O0):
@.str = [271 x i8] c"usage: megahal [-[pqrgwbh]]\0A\09-h : show usage\0A\09-p : inhibit prompts\0A\09-q : quiet mode (no replies) enabled at start\0A\09-r : inhibit progress display\0A\09-g : inhibit initial greeting\0A\09-b : inhibit banner display at startup\0A\09-d : sets the directory where your megahal files are\0A\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([271 x i8], [271 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [271 x i8] c"usage: megahal [-[pqrgwbh]]\0A\09-h : show usage\0A\09-p : inhibit prompts\0A\09-q : quiet mode (no replies) enabled at start\0A\09-r : inhibit progress display\0A\09-g : inhibit initial greeting\0A\09-b : inhibit banner display at startup\0A\09-d : sets the directory where your megahal files are\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([271 x i8], [271 x i8]* @.str, i64 0, i64 0))
ret void
}
void findsum(char letter, int *sum) { *sum = ((int)letter) + *sum; }


x86 assembly (clang, -O0):
<findsum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<findsum>:
add    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @findsum(i8 signext %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 = sext i8 %5 to i32
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @findsum(i8 signext %0, i32* nocapture %1) {
%3 = sext i8 %0 to i32
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
store i32 %5, i32* %1
ret void
}
int my_getstrlen(char *str) {
  int i;
  i = 0;
  while (*(str + i) != '\0')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<my_getstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_getstrlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_getstrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_getstrlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_getstrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_getstrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int scandir_compare_stub(const void *pvoid1, const void *pvoid2) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @scandir_compare_stub(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int is_netascii(int mode) {
  if (mode == 8)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_netascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jne    111d <is_netascii+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <is_netascii+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_netascii(i32 %0) {
%2 = icmp eq i32 %0, 8
%3 = zext i1 %2 to i32
ret i32 %3
}
const char *daala_version_string(void) {
  return "Xiph's experimental encoder library "
         "Mar 18 2022";
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"Xiph's experimental encoder library Mar 18 2022\00"
define i8* @daala_version_string() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [48 x i8] c"Xiph's experimental encoder library Mar 18 2022\00"
define i8* @daala_version_string() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
void strlcpy(char *dst, const char *src, size_t size) {
  strncpy(dst, src, size - 1);
  dst[size - 1] = '\0';
}


x86 assembly (clang, -O0):
<strlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = sub i64 %9, 1
%11 = call i32 @strncpy(i8* %7, i8* %8, i64 %10)
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = sub i64 %13, 1
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 0, i8* %15
ret void
}

LLVM IR (-O2):
define void @strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = add i64 %2, -1
%5 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %6
ret void
}
/* Variables and functions */
int i_nint(float *);
int intr_wrap_393(float p1) { return i_nint(&p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_393>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <i_nint@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @intr_wrap_393(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 @i_nint(float* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @intr_wrap_393(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 @i_nint(float* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ get_min_k_number(int *, int, int);
int /*<<< orphan*/ print_array(int *, int);
int main() {
  int length = 10;
  int k = 5;
  int a[10] = {12, 523, 2340, 23423, 231, 98, 45, 9000, 7, 1};
  print_array(a, length);
  get_min_k_number(a, length, k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xea8(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <print_array@plt>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <get_min_k_number@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <print_array@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x5,%edx
call   1040 <get_min_k_number@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 12, i32 523, i32 2340, i32 23423, i32 231, i32 98, i32 45, i32 9000, i32 7, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i32]
store i32 0, i32* %1
store i32 10, i32* %2
store i32 5, i32* %3
%5 = bitcast [10 x i32]* %4 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @print_array(i32* %6, i32 %7)
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @get_min_k_number(i32* %9, i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 12, i32 523, i32 2340, i32 23423, i32 231, i32 98, i32 45, i32 9000, i32 7, i32 1]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_array(i32* %3, i32 10)
%5 = call i32 @get_min_k_number(i32* %3, i32 10, i32 5)
ret i32 0
}
void ddr_udelay_nothing(unsigned long usec) { return; }


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

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

LLVM IR (-O0):
define void @ddr_udelay_nothing(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret void
}

LLVM IR (-O2):
define void @ddr_udelay_nothing(i64 %0) {
ret void
}
int test_imm_FAint64_lowword_mem(long long *val) {
  return ((*val) & (0xFA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FAint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 250
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int r1(int ls, int a) {
  if (ls == 0) {
    return a;
  } else {
    return r1(ls - 1, ls + 1 + a);
  }
}


x86 assembly (clang, -O0):
<r1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <r1+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <r1+0x3a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
add    -0xc(%rbp),%esi
call   1030 <r1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r1>:
mov    %esi,%eax
test   %edi,%edi
je     1121 <r1+0x21>
mov    %edi,%ecx
imul   %edi,%ecx
add    %eax,%ecx
lea    -0x1(%rdi),%eax
add    $0xfffffffe,%edi
imul   %rax,%rdi
shr    %rdi
sub    %edi,%ecx
add    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @r1(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = mul i32 %0, %0
%6 = add i32 %5, %1
%7 = add i32 %0, -1
%8 = zext i32 %7 to i33
%9 = add i32 %0, -2
%10 = zext i32 %9 to i33
%11 = mul i33 %8, %10
%12 = lshr i33 %11, 1
%13 = trunc i33 %12 to i32
%14 = add i32 %6, 1
%15 = sub i32 %14, %13
br label %16
16: ; preds = %4, %2
%17 = phi i32 [ %1, %2 ], [ %15, %4 ]
ret i32 %17
}
/* Variables and functions */
size_t cgc_strlen(char *);
size_t send_n_bytes(int, size_t, char *);
int transmit_string(int fd, char *s) {
  size_t len = cgc_strlen(s);
  if (len == 0)
    return 0;
  else if (send_n_bytes(fd, len, s) != len)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<transmit_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <cgc_strlen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <transmit_string+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1180 <transmit_string+0x60>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <send_n_bytes@plt>
cmp    -0x18(%rbp),%rax
je     1179 <transmit_string+0x59>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <transmit_string+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transmit_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <cgc_strlen@plt>
test   %rax,%rax
je     1155 <transmit_string+0x35>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
mov    %r14,%rdx
call   1030 <send_n_bytes@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
setne  %al
neg    %eax
jmp    1157 <transmit_string+0x37>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @transmit_string(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call i64 @cgc_strlen(i8* %7)
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %21
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i64, i64* %6
%15 = load i8*, i8** %5
%16 = call i64 @send_n_bytes(i32 %13, i64 %14, i8* %15)
%17 = load i64, i64* %6
%18 = icmp ne i64 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %12
store i32 -1, i32* %3
br label %21
20: ; preds = %12
store i32 0, i32* %3
br label %21
21: ; preds = %20, %19, %11
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @transmit_string(i32 %0, i8* %1) {
%3 = tail call i64 @cgc_strlen(i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @send_n_bytes(i32 %0, i64 %3, i8* %1)
%7 = icmp ne i64 %6, %3
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int mapcon_solve_system(int puretopdim) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(430, &puretopdim, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<mapcon_solve_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1ae,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapcon_solve_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1ae,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mapcon_solve_system(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 430, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @mapcon_solve_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 430, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ERR_free_strings();
void licence_close(void) { ERR_free_strings(); }


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

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

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

LLVM IR (-O2):
define void @licence_close() {
%1 = tail call i32 (...) @ERR_free_strings()
ret void
}
char *str_cpy(char *d, char *s) {
  char *p = d;
  while (*d++ = *s++)
    continue;
  return p;
}


x86 assembly (clang, -O0):
<str_cpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <str_cpy+0x43>
jmp    1114 <str_cpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <str_cpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @str_cpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}