xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, scalar_t__, ...);
void print_port_range(uint16_t *ports) {
  if (ports[0] == ports[1])
    printf("%d ", ports[0]);
  else
    printf("%d:%d ", ports[0], ports[1]);
}


x86 assembly (clang, -O0):
<print_port_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%rax
jne    114b <print_port_range+0x3b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1168 <print_port_range+0x58>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_port_range>:
mov    (%rdi),%rsi
mov    0x8(%rdi),%rdx
cmp    %rdx,%rsi
jne    112a <print_port_range+0x1a>
lea    0xee0(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xecf(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.1 = [7 x i8] c"%d:%d \00"
define void @print_port_range(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = getelementptr inbounds i64, i64* %0, i64 1
%4 = load i64, i64* %3
%5 = icmp eq i64 %2, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %2)
br label %10
8: ; preds = %1
%9 = tail call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %2, i64 %4)
br label %10
10: ; preds = %8, %6
ret void
}
/* Type definitions */
struct DataMap {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
struct DataMap *DataMapRead(int /*<<< orphan*/);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
struct DataMap *DataMapFread(FILE *fp) {
  return DataMapRead(fileno(fp));
}


x86 assembly (clang, -O0):
<DataMapFread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
call   1030 <DataMapRead@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DataMapFread>:
push   %rax
call   1040 <fileno@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <DataMapRead@plt>

LLVM IR (-O0):
%struct.DataMap = type { i32 }
define %struct.DataMap* @DataMapFread(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fileno(i32* %3)
%5 = call %struct.DataMap* @DataMapRead(i32 %4)
ret %struct.DataMap* %5
}

LLVM IR (-O2):
%struct.DataMap = type { i32 }
define %struct.DataMap* @DataMapFread(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
%3 = tail call %struct.DataMap* @DataMapRead(i32 %2)
ret %struct.DataMap* %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void main(void) {
  if (1 < 2) {
    putchar('V');
  } else {
    putchar('F');
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x56,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @putchar(i8 signext 86)
%2 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @putchar(i8 signext 86)
%2 = tail call i32 @putchar(i8 signext 10)
ret void
}
int main(int argc, char *argv[]) {
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1112 <main+0x12>

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %2, %6
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ stringSubst2(char *const, char *const, char const *const,
                                char const *const, int, int);
int strlen(char const *const);
void _SCOTCHstringSubst(char *const buffptr, const char *const pattstr,
                        const char *const replstr) {
  int pattsiz;
  int replsiz;
  pattsiz = strlen(pattstr);
  replsiz = strlen(replstr);
  stringSubst2(buffptr, buffptr, pattstr, replstr, pattsiz, replsiz);
}


x86 assembly (clang, -O0):
<_SCOTCHstringSubst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1040 <stringSubst2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_SCOTCHstringSubst>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %ebp,%r8d
mov    %eax,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <stringSubst2@plt>

LLVM IR (-O0):
define void @_SCOTCHstringSubst(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %5
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %7
%11 = load i8*, i8** %6
%12 = call i32 @strlen(i8* %11)
store i32 %12, i32* %8
%13 = load i8*, i8** %4
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = call i32 @stringSubst2(i8* %13, i8* %14, i8* %15, i8* %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @_SCOTCHstringSubst(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @strlen(i8* %2)
%6 = tail call i32 @stringSubst2(i8* %0, i8* %0, i8* %1, i8* %2, i32 %4, i32 %5)
ret void
}
void ADCHardwareOversampleConfigure(unsigned long ulBase,
                                    unsigned long ulFactor) {
  unsigned long ulValue;
  ;

  ;
  for (ulValue = 0, ulFactor >>= 1; ulFactor; ulValue++, ulFactor >>= 1) {
  }
  (*((volatile unsigned long *)(ulBase + 0x00000030))) = ulValue;
}


x86 assembly (clang, -O0):
<ADCHardwareOversampleConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <ADCHardwareOversampleConfigure+0x4d>
jmp    1130 <ADCHardwareOversampleConfigure+0x30>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <ADCHardwareOversampleConfigure+0x20>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCHardwareOversampleConfigure>:
xor    %eax,%eax
cmp    $0x2,%rsi
jb     1120 <ADCHardwareOversampleConfigure+0x20>
mov    %rsi,%rcx
nopl   0x0(%rax,%rax,1)
shr    %rcx
add    $0x1,%rax
cmp    $0x3,%rsi
mov    %rcx,%rsi
ja     1110 <ADCHardwareOversampleConfigure+0x10>
mov    %rax,0x30(%rdi)
ret

LLVM IR (-O0):
define void @ADCHardwareOversampleConfigure(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %4
%7 = lshr i64 %6, 1
store i64 %7, i64* %4
br label %8
8: ; preds = %12, %2
%9 = load i64, i64* %4
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %8
br label %12
12: ; preds = %11
%13 = load i64, i64* %5
%14 = add i64 %13, 1
store i64 %14, i64* %5
%15 = load i64, i64* %4
%16 = lshr i64 %15, 1
store i64 %16, i64* %4
br label %8
17: ; preds = %8
%18 = load i64, i64* %5
%19 = load i64, i64* %3
%20 = add i64 %19, 48
%21 = inttoptr i64 %20 to i64*
store volatile i64 %18, i64* %21
ret void
}

LLVM IR (-O2):
define void @ADCHardwareOversampleConfigure(i64 %0, i64 %1) {
%3 = icmp ult i64 %1, 2
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = lshr i64 %6, 1
%8 = add nuw nsw i64 %5, 1
%9 = icmp ult i64 %6, 4
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i64 [ 0, %2 ], [ %8, %4 ]
%12 = add i64 %0, 48
%13 = inttoptr i64 %12 to i64*
store volatile i64 %11, i64* %13
ret void
}
/* Variables and functions */
int mus_format2bytes(int);
int mus_bytes2samples(int format, int size) {
  return ((int)(size / (mus_format2bytes(format))));
}


x86 assembly (clang, -O0):
<mus_bytes2samples>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mus_format2bytes@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_bytes2samples>:
push   %rbx
mov    %esi,%ebx
call   1030 <mus_format2bytes@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @mus_bytes2samples(i32 %0, i32 %1) {
%3 = tail call i32 @mus_format2bytes(i32 %0)
%4 = sdiv i32 %1, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ useconds_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int /*<<< orphan*/);
void gls_sleep(unsigned int max_mbps, unsigned int size) {
  unsigned int sleeptime = (float)1500.0f * 7.62939453125f / max_mbps + 1.0f;
  usleep((useconds_t)sleeptime);
}


x86 assembly (clang, -O0):
<gls_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm1
movss  0xed2(%rip),%xmm0
divss  %xmm1,%xmm0
movss  0xeca(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gls_sleep>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
movss  0xee1(%rip),%xmm1
divss  %xmm0,%xmm1
addss  0xed9(%rip),%xmm1
cvttss2si %xmm1,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @gls_sleep(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = uitofp i32 %6 to float
%8 = fdiv float 0x40C65A0BC0000000, %7
%9 = fadd float %8, 1.000000e+00
%10 = fptoui float %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i32 @usleep(i32 %11)
ret void
}

LLVM IR (-O2):
define void @gls_sleep(i32 %0, i32 %1) {
%3 = uitofp i32 %0 to float
%4 = fdiv float 0x40C65A0BC0000000, %3
%5 = fadd float %4, 1.000000e+00
%6 = fptoui float %5 to i32
%7 = tail call i32 @usleep(i32 %6)
ret void
}
double constrain(double x, double min, double max) {
  if (x < min)
    return min;
  if (x > max)
    return max;
  return x;
}


x86 assembly (clang, -O0):
<constrain>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <constrain+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <constrain+0x5f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <constrain+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <constrain+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<constrain>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define double @constrain(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ p;

/* Variables and functions */
uint32_t libcperciva_be32dec(const void *pp) {
  const uint8_t *p = (uint8_t const *)pp;
  return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) +
          ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24));
}


x86 assembly (clang, -O0):
<libcperciva_be32dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    -0x10(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libcperciva_be32dec>:
mov    0x10(%rdi),%ecx
shl    $0x8,%ecx
add    0x18(%rdi),%ecx
mov    (%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
add    %ecx,%edx
shl    $0x18,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @libcperciva_be32dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 24
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds i8, i8* %0, i64 16
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = add nsw i32 %11, %6
%13 = getelementptr inbounds i8, i8* %0, i64 8
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 16
%18 = add nsw i32 %12, %17
%19 = load i64, i64* %2
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 24
%22 = add nsw i32 %18, %21
ret i32 %22
}
/* Variables and functions */
unsigned int joat_hash(char *, int);
unsigned int hash(char *k, int size) {
  if (size == sizeof(int)) {
    unsigned int *h;
    h = (unsigned int *)k;
    return *h;
  }
  return joat_hash(k, size);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x4,%rax
jne    1143 <hash+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <hash+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <joat_hash@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
cmp    $0x4,%esi
jne    1118 <hash+0x8>
mov    (%rdi),%eax
ret
jmp    1030 <joat_hash@plt>

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

LLVM IR (-O2):
define i32 @hash(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 4
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
br label %9
7: ; preds = %2
%8 = tail call i32 @joat_hash(i8* %0, i32 %1)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ %8, %7 ]
ret i32 %10
}
void ble_rsp_system_read_memory(
    const struct ble_msg_system_read_memory_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_system_read_memory_rsp_t = type opaque
define void @ble_rsp_system_read_memory(%struct.ble_msg_system_read_memory_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void forSpecTest() {
  int x = 0;
  for (x = 1; 2 == 3; x++)
    x = 4;
  assert(x == 4);
}


x86 assembly (clang, -O0):
<forSpecTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1135 <forSpecTest+0x25>
jmp    114a <forSpecTest+0x3a>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <forSpecTest+0x16>
cmpl   $0x4,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @forSpecTest() {
%1 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %1
br label %2
2: ; preds = %4, %0
br i1 false, label %3, label %7
3: ; preds = %2
store i32 4, i32* %1
br label %4
4: ; preds = %3
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
br label %2
7: ; preds = %2
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 4
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
define void @forSpecTest() {
%1 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bin(short);
int /*<<< orphan*/ printf(char *, short, short, short);
void proto(short d) {
  bin(d);
  printf(" %X %d %c\n", d, d, d);
}


x86 assembly (clang, -O0):
<proto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <bin@plt>
mov    -0x2(%rbp),%cx
mov    -0x2(%rbp),%ax
lea    0xeb9(%rip),%rdi
movswl %cx,%esi
movswl %ax,%edx
movswl -0x2(%rbp),%ecx
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proto>:
push   %rbx
mov    %edi,%ebx
call   1030 <bin@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %ebx,%ecx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c" %X %d %c\0A\00"
define void @proto(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @bin(i16 signext %3)
%5 = load i16, i16* %2
%6 = load i16, i16* %2
%7 = load i16, i16* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 signext %5, i16 signext %6, i16 signext %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c" %X %d %c\0A\00"
define void @proto(i16 signext %0) {
%2 = tail call i32 @bin(i16 signext %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 signext %0, i16 signext %0, i16 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *const);
int /*<<< orphan*/ paste_str(char *const, int);
int /*<<< orphan*/ split_ext(char *const, int *, char const **);
char *strdup(char const *);
void paste_name_part(const char name[], int root) {
  int root_len;
  const char *ext;
  char *const name_copy = strdup(name);
  split_ext(name_copy, &root_len, &ext);
  paste_str(root ? name_copy : ext, 1);
  free(name_copy);
}


x86 assembly (clang, -O0):
<paste_name_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <split_ext@plt>
cmpl   $0x0,-0xc(%rbp)
je     1184 <paste_name_part+0x44>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    118c <paste_name_part+0x4c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
call   1050 <paste_str@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paste_name_part>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebp
call   1060 <strdup@plt>
mov    %rax,%rbx
lea    0x14(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
call   1040 <split_ext@plt>
mov    %rbx,%rdi
test   %ebp,%ebp
jne    116e <paste_name_part+0x2e>
mov    0x8(%rsp),%rdi
mov    $0x1,%esi
call   1050 <paste_str@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @paste_name_part(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i8*, i8** %3
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = call i32 @split_ext(i8* %10, i32* %5, i8** %6)
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = load i8*, i8** %7
br label %18
16: ; preds = %2
%17 = load i8*, i8** %6
br label %18
18: ; preds = %16, %14
%19 = phi i8* [ %15, %14 ], [ %17, %16 ]
%20 = call i32 @paste_str(i8* %19, i32 1)
%21 = load i8*, i8** %7
%22 = call i32 @free(i8* %21)
ret void
}

LLVM IR (-O2):
define void @paste_name_part(i8* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = bitcast i32* %3 to i8*
%6 = bitcast i8** %4 to i8*
%7 = tail call i8* @strdup(i8* %0)
%8 = call i32 @split_ext(i8* %7, i32* %3, i8** %4)
%9 = icmp eq i32 %1, 0
%10 = load i8*, i8** %4
%11 = select i1 %9, i8* %10, i8* %7
%12 = call i32 @paste_str(i8* %11, i32 1)
%13 = call i32 @free(i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dlinit(int, char **);
int /*<<< orphan*/ do_dlopen();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int ret = 0;
  char *builtin[] = {"libgcc.so", "libc.so"};
  printf("In DSPAL main\n");
  dlinit(2, builtin);
  do_dlopen();
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    0x2cbc(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cb9(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
mov    $0x2,%edi
call   1040 <dlinit@plt>
mov    $0x0,%al
call   1050 <do_dlopen@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0x2cd5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    $0x2,%edi
call   1040 <dlinit@plt>
xor    %eax,%eax
call   1050 <do_dlopen@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"libgcc.so\00"
@.str.1 = [8 x i8] c"libc.so\00"
@__const.main.builtin = [2 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [15 x i8] c"In DSPAL main\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [2 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = bitcast [2 x i8*]* %7 to i8*
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 0
%11 = call i32 @dlinit(i32 2, i8** %10)
%12 = call i32 (...) @do_dlopen()
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
@.str = [10 x i8] c"libgcc.so\00"
@.str.1 = [8 x i8] c"libc.so\00"
@__const.main.builtin = [2 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0)]
@str = [14 x i8] c"In DSPAL main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i8*]
%4 = bitcast [2 x i8*]* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%7 = call i32 @dlinit(i32 2, i8** %6)
%8 = call i32 (...) @do_dlopen()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cortexm_init();
int /*<<< orphan*/ cpu_clock_init();
int /*<<< orphan*/ periph_init();
void cpu_init(void) {
  cortexm_init();
  cpu_clock_init();
  periph_init();
}


x86 assembly (clang, -O0):
<cpu_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cortexm_init@plt>
mov    $0x0,%al
call   1050 <cpu_clock_init@plt>
mov    $0x0,%al
call   1030 <periph_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_init>:
push   %rax
xor    %eax,%eax
call   1040 <cortexm_init@plt>
xor    %eax,%eax
call   1050 <cpu_clock_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <periph_init@plt>

LLVM IR (-O0):
define void @cpu_init() {
%1 = call i32 (...) @cortexm_init()
%2 = call i32 (...) @cpu_clock_init()
%3 = call i32 (...) @periph_init()
ret void
}

LLVM IR (-O2):
define void @cpu_init() {
%1 = tail call i32 (...) @cortexm_init()
%2 = tail call i32 (...) @cpu_clock_init()
%3 = tail call i32 (...) @periph_init()
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int mapcon_write_maps(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(431, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<mapcon_write_maps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1af,%edi
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_write_maps>:
mov    $0x1af,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @mapcon_write_maps() {
%1 = tail call i32 @_ada_use_c2phc(i32 431, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ __udivmoddi4(unsigned long long, unsigned long long,
                                unsigned long long *);
unsigned long long __umoddi3(unsigned long long num, unsigned long long den) {
  unsigned long long v;
  (void)__udivmoddi4(num, den, &v);
  return v;
}


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

x86 assembly (clang, -O2):
<__umoddi3>:
push   %rax
mov    %rsp,%rdx
call   1030 <__udivmoddi4@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @__umoddi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @__udivmoddi4(i64 %0, i64 %1, i64* %3)
%6 = load i64, i64* %3
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ is_vowel(char);
int is_consonant(char c) {
  if (((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) && !is_vowel(c))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_consonant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1138 <is_consonant+0x28>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    1152 <is_consonant+0x42>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1170 <is_consonant+0x60>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1170 <is_consonant+0x60>
movsbl -0x5(%rbp),%edi
call   1030 <is_vowel@plt>
cmp    $0x0,%eax
jne    1170 <is_consonant+0x60>
movl   $0x1,-0x4(%rbp)
jmp    1177 <is_consonant+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_consonant>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x19,%al
ja     112d <is_consonant+0x1d>
push   %rax
movsbl %dil,%edi
call   1030 <is_vowel@plt>
test   %eax,%eax
lea    0x8(%rsp),%rsp
je     1130 <is_consonant+0x20>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_consonant(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %19, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %24
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %19, label %24
19: ; preds = %15, %7
%20 = load i8, i8* %3
%21 = call i32 @is_vowel(i8 signext %20)
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %19
store i32 1, i32* %2
br label %25
24: ; preds = %19, %15, %11
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_consonant(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @is_vowel(i8 signext %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1, %5
br label %9
9: ; preds = %5, %8
%10 = phi i32 [ 0, %8 ], [ 1, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t ipow(int64_t base, int64_t exp) {
  int64_t result = 1;
  while (exp) {
    if (exp & 1) {
      result *= base;
    }
    exp >>= 1;
    base *= base;
  }
  return result;
}


x86 assembly (clang, -O0):
<ipow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114c <ipow+0x4c>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <ipow+0x34>
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <ipow+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipow>:
test   %esi,%esi
je     113a <ipow+0x3a>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
imul   %ecx,%eax
sar    %edx
imul   %edi,%edi
cmp    $0x1,%esi
mov    %edx,%esi
ja     1120 <ipow+0x20>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ipow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = mul nsw i32 %15, %14
store i32 %16, i32* %5
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %4
%19 = ashr i32 %18, 1
store i32 %19, i32* %4
%20 = load i32, i32* %3
%21 = load i32, i32* %3
%22 = mul nsw i32 %21, %20
store i32 %22, i32* %3
br label %6
23: ; preds = %6
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @ipow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 1, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = phi i32 [ %13, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %7
%11 = mul nsw i32 %10, %5
%12 = ashr i32 %6, 1
%13 = mul nsw i32 %7, %7
%14 = icmp ult i32 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ write32_be(int, int);
void close_libfile(int fd, int count) {
  ;
  lseek(fd, 32, SEEK_SET);
  write32_be(fd, count);
  close(fd);
}


x86 assembly (clang, -O0):
<close_libfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
mov    $0x20,%esi
call   1040 <lseek@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <write32_be@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_libfile>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
mov    $0x20,%esi
call   1040 <lseek@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <write32_be@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <close@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @close_libfile(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* @SEEK_SET
%7 = call i32 @lseek(i32 %5, i32 32, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @write32_be(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @close(i32 %11)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @close_libfile(i32 %0, i32 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @lseek(i32 %0, i32 32, i32 %3)
%5 = tail call i32 @write32_be(i32 %0, i32 %1)
%6 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned int nondet_uint();
int main() {
  unsigned int n = nondet_uint();
  unsigned int x = n, y = 0;
  while (x > 0) {
    x--;
    y++;
  }
  assert(y == n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <nondet_uint@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1167 <main+0x47>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <main+0x26>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet_uint()
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("xxxx\b\b\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"xxxx\08\08\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"xxxx\08\08\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ fdumpbn(int /*<<< orphan*/, int /*<<< orphan*/ const *);
int /*<<< orphan*/ stdout;
void dumpbn(const BIGNUM *bn) { fdumpbn(stdout, bn); }


x86 assembly (clang, -O0):
<dumpbn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fdumpbn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpbn>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fdumpbn@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @dumpbn(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @stdout
%4 = load i32*, i32** %2
%5 = call i32 @fdumpbn(i32 %3, i32* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @dumpbn(i32* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fdumpbn(i32 %2, i32* %0)
ret void
}
/* Type definitions */
struct ptr_list {
  int dummy;
};
struct basic_block_list {
  int dummy;
};
struct basic_block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ delete_ptr_list_entry(struct ptr_list **,
                                         struct basic_block *, int);
void remove_bb_from_list(struct basic_block_list **list,
                         struct basic_block *entry, int count) {
  delete_ptr_list_entry((struct ptr_list **)list, entry, count);
}


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

x86 assembly (clang, -O2):
<remove_bb_from_list>:
jmp    1030 <delete_ptr_list_entry@plt>

LLVM IR (-O0):
%struct.basic_block_list = type { i32 }
%struct.basic_block = type { i32 }
%struct.ptr_list = type { i32 }
define void @remove_bb_from_list(%struct.basic_block_list** %0, %struct.basic_block* %1, i32 %2) {
%4 = alloca %struct.basic_block_list**
%5 = alloca %struct.basic_block*
%6 = alloca i32
store %struct.basic_block_list** %0, %struct.basic_block_list*** %4
store %struct.basic_block* %1, %struct.basic_block** %5
store i32 %2, i32* %6
%7 = load %struct.basic_block_list**, %struct.basic_block_list*** %4
%8 = bitcast %struct.basic_block_list** %7 to %struct.ptr_list**
%9 = load %struct.basic_block*, %struct.basic_block** %5
%10 = load i32, i32* %6
%11 = call i32 @delete_ptr_list_entry(%struct.ptr_list** %8, %struct.basic_block* %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.basic_block_list = type { i32 }
%struct.basic_block = type { i32 }
%struct.ptr_list = type { i32 }
define void @remove_bb_from_list(%struct.basic_block_list** %0, %struct.basic_block* %1, i32 %2) {
%4 = bitcast %struct.basic_block_list** %0 to %struct.ptr_list**
%5 = tail call i32 @delete_ptr_list_entry(%struct.ptr_list** %4, %struct.basic_block* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
scalar_t__ system(char *);
unsigned int file_remove(const char *name) {
  char command[128];
  snprintf(command, 128, "rm %s", name);
  return system(command) == 0;
}


x86 assembly (clang, -O0):
<file_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x80,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_remove>:
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"rm %s\00"
define i32 @file_remove(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i64 @system(i8* %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"rm %s\00"
define i32 @file_remove(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i64 @system(i8* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
struct dumbtts_conf {
  int dummy;
};

/* Variables and functions */
char *allocMemBlock(struct dumbtts_conf *, scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strdupMemBlock(struct dumbtts_conf *conf, char *str) {
  char *dst = allocMemBlock(conf, strlen(str) + 1, 0);
  if (dst)
    strcpy(dst, str);
  return dst;
}


x86 assembly (clang, -O0):
<strdupMemBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
xor    %edx,%edx
call   1050 <allocMemBlock@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117f <strdupMemBlock+0x4f>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdupMemBlock>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1050 <allocMemBlock@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1163 <strdupMemBlock+0x33>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.dumbtts_conf = type { i32 }
define i8* @strdupMemBlock(%struct.dumbtts_conf* %0, i8* %1) {
%3 = alloca %struct.dumbtts_conf*
%4 = alloca i8*
%5 = alloca i8*
store %struct.dumbtts_conf* %0, %struct.dumbtts_conf** %3
store i8* %1, i8** %4
%6 = load %struct.dumbtts_conf*, %struct.dumbtts_conf** %3
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @allocMemBlock(%struct.dumbtts_conf* %6, i64 %9, i32 0)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i8*, i8** %4
%16 = call i32 @strcpy(i8* %14, i8* %15)
br label %17
17: ; preds = %13, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
%struct.dumbtts_conf = type { i32 }
define i8* @strdupMemBlock(%struct.dumbtts_conf* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @allocMemBlock(%struct.dumbtts_conf* %0, i64 %4, i32 0)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @strcpy(i8* %5, i8* %1)
br label %9
9: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int identity(char);
char txor1(char x) {
  char y = (identity(x) ^ 1) ? 42 : 43;
  return y;
}


x86 assembly (clang, -O0):
<txor1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <identity@plt>
mov    %eax,%edx
xor    $0x1,%edx
mov    $0x2b,%eax
mov    $0x2a,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txor1>:
push   %rax
call   1030 <identity@plt>
cmp    $0x1,%eax
sete   %al
or     $0x2a,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @txor1(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @identity(i8 signext %4)
%6 = xor i32 %5, 1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 42, i32 43
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @txor1(i8 signext %0) {
%2 = tail call i32 @identity(i8 signext %0)
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i8 43, i8 42
ret i8 %4
}