xunge/DecIR huggingface dataset:
void swap(void *a, void *b) {
  int t = *(int *)a;
  *(int *)a = *(int *)b;
  *(int *)b = t;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = load i8*, i8** %3
%13 = bitcast i8* %12 to i32*
store i32 %11, i32* %13
%14 = load i32, i32* %5
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
store i32 %14, i32* %16
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(double *, double *, int);
void copy_dvector(double *dst, double *src, int n) {
  memmove(dst, src, sizeof(double) * n);
}


x86 assembly (clang, -O0):
<copy_dvector>:
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
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dvector>:
shl    $0x3,%edx
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @copy_dvector(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 8, %10
%12 = trunc i64 %11 to i32
%13 = call i32 @memmove(double* %7, double* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @copy_dvector(double* %0, double* %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = tail call i32 @memmove(double* %0, double* %1, i32 %4)
ret void
}
int collatz(int in) {
  int num = in;
  if (num % 2 == 0) {
    num = num / 2;
  } else {
    num = num * 3 + 1;
  }
  return num;
}


x86 assembly (clang, -O0):
<collatz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <collatz+0x34>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    113e <collatz+0x3e>
imul   $0x3,-0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<collatz>:
test   $0x1,%dil
jne    1110 <collatz+0x10>
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret
lea    (%rdi,%rdi,2),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @collatz(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = sdiv i32 %0, 2
br label %9
6: ; preds = %1
%7 = mul nsw i32 %0, 3
%8 = add nsw i32 %7, 1
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ %5, %4 ], [ %8, %6 ]
ret i32 %10
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCGETS;
int ioctl(int, int /*<<< orphan*/, struct termios *);
int tcgetattr(int fd, struct termios *termios_p) {
  return (ioctl(fd, TCGETS, termios_p));
}


x86 assembly (clang, -O0):
<tcgetattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcgetattr>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@TCGETS = global i32 0
define i32 @tcgetattr(i32 %0, %struct.termios* %1) {
%3 = alloca i32
%4 = alloca %struct.termios*
store i32 %0, i32* %3
store %struct.termios* %1, %struct.termios** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @TCGETS
%7 = load %struct.termios*, %struct.termios** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, %struct.termios* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@TCGETS = global i32 0
define i32 @tcgetattr(i32 %0, %struct.termios* %1) {
%3 = load i32, i32* @TCGETS
%4 = tail call i32 @ioctl(i32 %0, i32 %3, %struct.termios* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ e_absy();
int /*<<< orphan*/ e_sta();
int /*<<< orphan*/ e_writeback();
void e_sta_absy() {
  e_absy();
  e_sta();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_sta_absy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <e_absy@plt>
mov    $0x0,%al
call   1050 <e_sta@plt>
mov    $0x0,%al
call   1040 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_sta_absy>:
push   %rax
xor    %eax,%eax
call   1030 <e_absy@plt>
xor    %eax,%eax
call   1050 <e_sta@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_writeback@plt>

LLVM IR (-O0):
define void @e_sta_absy() {
%1 = call i32 (...) @e_absy()
%2 = call i32 (...) @e_sta()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_sta_absy() {
%1 = tail call i32 (...) @e_absy()
%2 = tail call i32 (...) @e_sta()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Variables and functions */
char *strchr_generic(char const *, char);
char *strchr(const char *s, int c) { return strchr_generic(s, (char)c); }


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
movsbl %al,%esi
call   1030 <strchr_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
movsbl %sil,%esi
jmp    1030 <strchr_generic@plt>

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
%8 = call i8* @strchr_generic(i8* %5, i8 signext %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8* @strchr_generic(i8* %0, i8 signext %3)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ u8_nextchar(char const *, size_t *);
uint32_t u8_nextmemchar(const char *s, size_t *i) { return u8_nextchar(s, i); }


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

x86 assembly (clang, -O2):
<u8_nextmemchar>:
jmp    1030 <u8_nextchar@plt>

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

LLVM IR (-O2):
define i32 @u8_nextmemchar(i8* %0, i64* %1) {
%3 = tail call i32 @u8_nextchar(i8* %0, i64* %1)
ret i32 %3
}
int a_fetch_add(volatile int *x, int v) {
  int old;
  do
    old = *x;
  while (((int (*)(int, int, volatile int *))0xffff0fc0)(old, old + v, x));
  return old;
}


x86 assembly (clang, -O0):
<a_fetch_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x10(%rbp),%esi
add    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    $0xffff0fc0,%eax
call   *%rax
cmp    $0x0,%eax
jne    110f <a_fetch_add+0xf>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_fetch_add>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
mov    $0xffff0fc0,%r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15),%ebx
lea    (%rbx,%r14,1),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   *%r12
test   %eax,%eax
jne    1120 <a_fetch_add+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @a_fetch_add(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i32, i32* %0
%5 = add nsw i32 %4, %1
%6 = tail call i32 inttoptr (i64 4294905792 to i32 (i32, i32, i32*)*)(i32 %4, i32 %5, i32* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _gcoapMsg_putByte(unsigned short);
unsigned short atoi(char *);
void encodeOption_uint(int opt, int prevopt, char *value) {
  unsigned short x = atoi(value);
  _gcoapMsg_putByte(((opt - prevopt) << 4) + 2);
  _gcoapMsg_putByte(x / 256);
  _gcoapMsg_putByte(x % 256);
}


x86 assembly (clang, -O0):
<encodeOption_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %ax,-0x12(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
shl    $0x4,%eax
add    $0x2,%eax
movzwl %ax,%edi
call   1030 <_gcoapMsg_putByte@plt>
movzwl -0x12(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
movzwl %ax,%edi
call   1030 <_gcoapMsg_putByte@plt>
movzwl -0x12(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dx,%ax
movzwl %ax,%edi
call   1030 <_gcoapMsg_putByte@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encodeOption_uint>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebp
mov    %rdx,%rdi
call   1040 <atoi@plt>
mov    %eax,%r15d
movzwl %ax,%ebx
sub    %r14d,%ebp
shl    $0x4,%ebp
or     $0x2,%ebp
movzwl %bp,%edi
call   1030 <_gcoapMsg_putByte@plt>
shr    $0x8,%ebx
mov    %ebx,%edi
call   1030 <_gcoapMsg_putByte@plt>
movzbl %r15b,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <_gcoapMsg_putByte@plt>

LLVM IR (-O0):
define void @encodeOption_uint(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i16
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call zeroext i16 @atoi(i8* %8)
store i16 %9, i16* %7
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
%13 = shl i32 %12, 4
%14 = add nsw i32 %13, 2
%15 = trunc i32 %14 to i16
%16 = call i32 @_gcoapMsg_putByte(i16 zeroext %15)
%17 = load i16, i16* %7
%18 = zext i16 %17 to i32
%19 = sdiv i32 %18, 256
%20 = trunc i32 %19 to i16
%21 = call i32 @_gcoapMsg_putByte(i16 zeroext %20)
%22 = load i16, i16* %7
%23 = zext i16 %22 to i32
%24 = srem i32 %23, 256
%25 = trunc i32 %24 to i16
%26 = call i32 @_gcoapMsg_putByte(i16 zeroext %25)
ret void
}

LLVM IR (-O2):
define void @encodeOption_uint(i32 %0, i32 %1, i8* nocapture %2) {
%4 = tail call zeroext i16 @atoi(i8* %2)
%5 = sub nsw i32 %0, %1
%6 = trunc i32 %5 to i16
%7 = shl i16 %6, 4
%8 = or i16 %7, 2
%9 = tail call i32 @_gcoapMsg_putByte(i16 zeroext %8)
%10 = lshr i16 %4, 8
%11 = tail call i32 @_gcoapMsg_putByte(i16 zeroext %10)
%12 = and i16 %4, 255
%13 = tail call i32 @_gcoapMsg_putByte(i16 zeroext %12)
ret void
}
int test_imm_B4int16_reg(short val) {
  return ((val) & (-0xB4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B4int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff4c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B4int16_reg>:
test   $0xff4c,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B4int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -180
%6 = icmp ne i32 %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_B4int16_reg(i16 signext %0) {
%2 = and i16 %0, -180
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double MBtoMMHG(double);
double KPAtoMMHG(double KPA) {
  double mmhg = MBtoMMHG(KPA * 10);
  return mmhg;
}


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

x86 assembly (clang, -O2):
<KPAtoMMHG>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <MBtoMMHG@plt>

LLVM IR (-O0):
define double @KPAtoMMHG(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 1.000000e+01
%6 = call double @MBtoMMHG(double %5)
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @KPAtoMMHG(double %0) {
%2 = fmul double %0, 1.000000e+01
%3 = tail call double @MBtoMMHG(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ CL_ReloadTranslation();
void CL_LoadTranslations_f(void) { CL_ReloadTranslation(); }


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

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

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

LLVM IR (-O2):
define void @CL_LoadTranslations_f() {
%1 = tail call i32 (...) @CL_ReloadTranslation()
ret void
}
/* Variables and functions */
int printf(char *, char *);
int inform_user(char *msg) {
  int ret;
  ret = printf("%s", msg);
  return ret;
}


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

x86 assembly (clang, -O2):
<inform_user>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @inform_user(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @inform_user(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_iochannel_creds_enable() {
  printf("NOT IMPLEMENTED:"
         "pa_iochannel_creds_enable"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_iochannel_creds_enable\0A\00"
define i32 @pa_iochannel_creds_enable() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_iochannel_creds_enable\00"
define i32 @pa_iochannel_creds_enable() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void paused_display(void) { return; }


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

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

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

LLVM IR (-O2):
define void @paused_display() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(char);
void gen_comment() { output_byte(';'); }


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

x86 assembly (clang, -O2):
<gen_comment>:
mov    $0x3b,%edi
jmp    1030 <output_byte@plt>

LLVM IR (-O0):
define void @gen_comment() {
%1 = call i32 @output_byte(i8 signext 59)
ret void
}

LLVM IR (-O2):
define void @gen_comment() {
%1 = tail call i32 @output_byte(i8 signext 59)
ret void
}
void show_media_info(void) {}


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

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

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

LLVM IR (-O2):
define void @show_media_info() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "usage: %s [-s num]\n", progname);
  fprintf(stderr, "-s option writes tests for sh(1), num is 1 or 2\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee0(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s [-s num]\0A\00"
@.str.1 = [49 x i8] c"-s option writes tests for sh(1), num is 1 or 2\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s [-s num]\0A\00"
@.str.1 = [49 x i8] c"-s option writes tests for sh(1), num is 1 or 2\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
char *BN_bn2hex(int /*<<< orphan*/ *);
int /*<<< orphan*/ OPENSSL_free(char *);
int /*<<< orphan*/ printf(char *, char *);
void BNPrintf(BIGNUM *bn) {
  char *p = NULL;
  p = BN_bn2hex(bn);
  printf("%s", p);
  OPENSSL_free(p);
}


x86 assembly (clang, -O0):
<BNPrintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <BN_bn2hex@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <OPENSSL_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNPrintf>:
push   %rbx
call   1040 <BN_bn2hex@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <OPENSSL_free@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @BNPrintf(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
store i8* null, i8** %3
%4 = load i32*, i32** %2
%5 = call i8* @BN_bn2hex(i32* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @OPENSSL_free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @BNPrintf(i32* %0) {
%2 = tail call i8* @BN_bn2hex(i32* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @OPENSSL_free(i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
int sigaddset(sigset_t *set, int signum) {
  (void)set;
  (void)signum;
  StubBug("STUB:"
          "sigaddset");
  return 0;
}


x86 assembly (clang, -O0):
<sigaddset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <StubBug@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"STUB:sigaddset\00"
define i32 @sigaddset(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 @StubBug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"STUB:sigaddset\00"
define i32 @sigaddset(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @StubBug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int m_fd_set_non_block(int fd) {
  int flags;
  if ((flags = fcntl(fd, F_GETFL, 0)) < 0)
    return (-1);
  return (fcntl(fd, F_SETFL, flags | O_NONBLOCK));
}


x86 assembly (clang, -O0):
<m_fd_set_non_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1146 <m_fd_set_non_block+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <m_fd_set_non_block+0x56>
mov    -0x8(%rbp),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    0x2e8c(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_fd_set_non_block>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
js     1143 <m_fd_set_non_block+0x33>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb1(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @m_fd_set_non_block(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFL
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %17
10: ; preds = %1
%11 = load i32, i32* %3
%12 = load i32, i32* @F_SETFL
%13 = load i32, i32* %4
%14 = load i32, i32* @O_NONBLOCK
%15 = or i32 %13, %14
%16 = call i32 @fcntl(i32 %11, i32 %12, i32 %15)
store i32 %16, i32* %2
br label %17
17: ; preds = %10, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @m_fd_set_non_block(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %7, %3
%9 = tail call i32 @fcntl(i32 %0, i32 %6, i32 %8)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ flick_mem(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int);
void i_rox_mem(void) { flick_mem("ro", 0, 0, 0, 1); }


x86 assembly (clang, -O0):
<i_rox_mem>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <flick_mem@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_rox_mem>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <flick_mem@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ro\00"
define void @i_rox_mem() {
%1 = call i32 @flick_mem(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ro\00"
define void @i_rox_mem() {
%1 = tail call i32 @flick_mem(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fe_sec_tone_mode_t;

/* Variables and functions */
int /*<<< orphan*/ FE_SET_TONE;
scalar_t__ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int FESetTone(int fd, fe_sec_tone_mode_t t) {
  int result;
  if ((result = ioctl(fd, FE_SET_TONE, t) < 0)) {
    perror("FE_SET_TONE");
    return result;
  }
  return 0;
}


x86 assembly (clang, -O0):
<FESetTone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x10(%rbp)
test   $0x1,%al
jne    1161 <FESetTone+0x41>
jmp    1178 <FESetTone+0x58>
lea    0xe98(%rip),%rdi
call   1040 <perror@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <FESetTone+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FESetTone>:
push   %rax
mov    %esi,%edx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113d <FESetTone+0x1d>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FE_SET_TONE = global i32 0
@.str = [12 x i8] c"FE_SET_TONE\00"
define i32 @FESetTone(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @FE_SET_TONE
%9 = load i32, i32* %5
%10 = call i64 @ioctl(i32 %7, i32 %8, i32 %9)
%11 = icmp slt i64 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %6
br i1 %11, label %13, label %16
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %6
store i32 %15, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@FE_SET_TONE = global i32 0
@.str = [12 x i8] c"FE_SET_TONE\00"
define i32 @FESetTone(i32 %0, i32 %1) {
%3 = load i32, i32* @FE_SET_TONE
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i32 %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %9
}
void hgetch_(c, cw, ch) char *c;
float *cw, *ch;
{ hgetcharsize(*c, cw, ch); }


x86 assembly (clang, -O0):
<hgetch_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <hgetcharsize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hgetch_>:
movsbl (%rdi),%edi
xor    %eax,%eax
jmp    1030 <hgetcharsize@plt>

LLVM IR (-O0):
define void @hgetch_(i8* %0, float* %1, float* %2) {
%4 = alloca i8*
%5 = alloca float*
%6 = alloca float*
store i8* %0, i8** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load float*, float** %5
%11 = load float*, float** %6
%12 = call i32 (i32, float*, float*, ...) bitcast (i32 (...)* @hgetcharsize to i32 (i32, float*, float*, ...)*)(i32 %9, float* %10, float* %11)
ret void
}

LLVM IR (-O2):
define void @hgetch_(i8* nocapture %0, float* %1, float* %2) {
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
%6 = tail call i32 (i32, float*, float*, ...) bitcast (i32 (...)* @hgetcharsize to i32 (i32, float*, float*, ...)*)(i32 %5, float* %1, float* %2)
ret void
}
void tegra_agic_save_registers(void) { return; }


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

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

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

LLVM IR (-O2):
define void @tegra_agic_save_registers() {
ret void
}
/* Variables and functions */
char *_sprintf_string(char *, char const *);
char *sprintf_string(char *buffer, const char *str) {
  return _sprintf_string(buffer, str);
}


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

x86 assembly (clang, -O2):
<sprintf_string>:
jmp    1030 <_sprintf_string@plt>

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

LLVM IR (-O2):
define i8* @sprintf_string(i8* %0, i8* %1) {
%3 = tail call i8* @_sprintf_string(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int ana_menu();
int main() { return ana_menu(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ana_menu()
ret i32 %1
}
const char *Cast_Description(void) {
  return "The `Cast` class provides a rudimentary run-time type checking. By "
         "default it simply checks that the passed in object is of a given "
         "type "
         "but it can be overridden by types which have to do more complex "
         "checking "
         "to ensure the types are correct.";
}


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

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

LLVM IR (-O0):
@.str = [243 x i8] c"The `Cast` class provides a rudimentary run-time type checking. By default it simply checks that the passed in object is of a given type but it can be overridden by types which have to do more complex checking to ensure the types are correct.\00"
define i8* @Cast_Description() {
ret i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [243 x i8] c"The `Cast` class provides a rudimentary run-time type checking. By default it simply checks that the passed in object is of a given type but it can be overridden by types which have to do more complex checking to ensure the types are correct.\00"
define i8* @Cast_Description() {
ret i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int encoding_utf16(char *encoding) {
  return (strncmp(encoding, "UTF-16", 6) == 0);
}


x86 assembly (clang, -O0):
<encoding_utf16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encoding_utf16>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"UTF-16\00"
define i32 @encoding_utf16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"UTF-16\00"
define i32 @encoding_utf16(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ NVIC_SystemReset();
void reboot(void) { NVIC_SystemReset(); }


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

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

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

LLVM IR (-O2):
define void @reboot() {
%1 = tail call i32 (...) @NVIC_SystemReset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void *count(void *arg) {
  int n = 0;
  while (1) {
    n++;
    printf("%d\n", n);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1133 <count+0x13>

x86 assembly (clang, -O2):
<count>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
add    $0x1,%ebx
jmp    1130 <count+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i8* @count(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %1, %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @sleep(i32 1)
br label %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define noalias i8* @count(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %4, %2 ]
%4 = add nuw nsw i32 %3, 1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @sleep(i32 1)
br label %2
}
/* Variables and functions */
double HUGE_VAL;
double fabs(double);
int nlopt_isinf(double x) { return fabs(x) >= HUGE_VAL * 0.99; }


x86 assembly (clang, -O0):
<nlopt_isinf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xefb(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xedf(%rip),%xmm1
mov    0x2ec0(%rip),%rax
mulsd  (%rax),%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlopt_isinf>:
andpd  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
movsd  (%rax),%xmm1
mulsd  0xef5(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
@HUGE_VAL = global double 0.000000e+00
define i32 @nlopt_isinf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
%5 = load double, double* @HUGE_VAL
%6 = fmul double %5, 0x3FEFAE147AE147AE
%7 = fcmp oge double %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@HUGE_VAL = global double 0.000000e+00
define i32 @nlopt_isinf(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = load double, double* @HUGE_VAL
%4 = fmul double %3, 0x3FEFAE147AE147AE
%5 = fcmp oge double %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
char *strcat(char *, char *);
char *strcpy(char *, char *);
int strlen(char *);
char *join_strings(char *first, char *second) {
  char *string;
  int len = strlen(first) + strlen(second) + 2;
  string = (char *)malloc(len * sizeof(char));
  string = strcpy(string, first);
  string = strcat(string, second);
  return string;
}


x86 assembly (clang, -O0):
<join_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join_strings>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%edi
add    $0x2,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1060 <strcat@plt>

LLVM IR (-O0):
define i8* @join_strings(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %8, %10
%12 = add nsw i32 %11, 2
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 1
%16 = trunc i64 %15 to i32
%17 = call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %5
%19 = load i8*, i8** %5
%20 = load i8*, i8** %3
%21 = call i8* @strcpy(i8* %19, i8* %20)
store i8* %21, i8** %5
%22 = load i8*, i8** %5
%23 = load i8*, i8** %4
%24 = call i8* @strcat(i8* %22, i8* %23)
store i8* %24, i8** %5
%25 = load i8*, i8** %5
ret i8* %25
}

LLVM IR (-O2):
define i8* @join_strings(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 2
%6 = add i32 %5, %4
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i8* @strcpy(i8* dereferenceable(1) %8, i8* dereferenceable(1) %0)
%10 = tail call i8* @strcat(i8* dereferenceable(1) %8, i8* dereferenceable(1) %1)
ret i8* %8
}
void setArrayF(float *arr, int idx, float v) { arr[idx] = v; }


x86 assembly (clang, -O0):
<setArrayF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setArrayF>:
movslq %esi,%rax
movss  %xmm0,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @setArrayF(float* %0, i32 %1, float %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca float
store float* %0, float** %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds float, float* %8, i64 %10
store float %7, float* %11
ret void
}

LLVM IR (-O2):
define void @setArrayF(float* nocapture writeonly %0, i32 %1, float %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds float, float* %0, i64 %4
store float %2, float* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flush_the_fic(int);
void flush_all_ficfunc() {
  register int f;
  flush_the_fic(1);
  flush_the_fic(2);
  flush_the_fic(3);
  flush_the_fic(4);
}


x86 assembly (clang, -O0):
<flush_all_ficfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <flush_the_fic@plt>
mov    $0x2,%edi
call   1030 <flush_the_fic@plt>
mov    $0x3,%edi
call   1030 <flush_the_fic@plt>
mov    $0x4,%edi
call   1030 <flush_the_fic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_all_ficfunc>:
push   %rax
mov    $0x1,%edi
call   1030 <flush_the_fic@plt>
mov    $0x2,%edi
call   1030 <flush_the_fic@plt>
mov    $0x3,%edi
call   1030 <flush_the_fic@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <flush_the_fic@plt>

LLVM IR (-O0):
define void @flush_all_ficfunc() {
%1 = alloca i32
%2 = call i32 @flush_the_fic(i32 1)
%3 = call i32 @flush_the_fic(i32 2)
%4 = call i32 @flush_the_fic(i32 3)
%5 = call i32 @flush_the_fic(i32 4)
ret void
}

LLVM IR (-O2):
define void @flush_all_ficfunc() {
%1 = tail call i32 @flush_the_fic(i32 1)
%2 = tail call i32 @flush_the_fic(i32 2)
%3 = tail call i32 @flush_the_fic(i32 3)
%4 = tail call i32 @flush_the_fic(i32 4)
ret void
}
__attribute__((always_)) int __strcmp(const char *s1, const char *s2) {
  int d0, d1, ret;
  asm volatile("1: lodsb;"
               "scasb;"
               "jne 2f;"
               "testb %%al, %%al;"
               "jne 1b;"
               "xorl %%eax, %%eax;"
               "jmp 3f;"
               "2: sbbl %%eax, %%eax;"
               "orb $1, %%al;"
               "3:"
               : "=a"(ret), "=&S"(d0), "=&D"(d1)
               : "1"(s1), "2"(s2)
               : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<__strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    112b <__strcmp+0x2b>
test   %al,%al
jne    1114 <__strcmp+0x14>
xor    %eax,%eax
jmp    112f <__strcmp+0x2f>
sbb    %eax,%eax
or     $0x1,%al
mov    %eax,-0x1c(%rbp)
mov    %esi,%eax
mov    %eax,-0x14(%rbp)
mov    %edi,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strcmp>:
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    1115 <__strcmp+0x15>
test   %al,%al
jne    1109 <__strcmp+0x9>
xor    %eax,%eax
jmp    1119 <__strcmp+0x19>
sbb    %eax,%eax
or     $0x1,%al
ret

LLVM IR (-O0):
define i32 @__strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call { i32, i8*, i8* } asm sideeffect "1: lodsb;scasb;jne 2f;testb %al, %al;jne 1b;xorl %eax, %eax;jmp 3f;2: sbbl %eax, %eax;orb $$1, %al;3:", "={ax},=&{si},=&{di},1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9)
%11 = extractvalue { i32, i8*, i8* } %10, 0
%12 = extractvalue { i32, i8*, i8* } %10, 1
%13 = extractvalue { i32, i8*, i8* } %10, 2
store i32 %11, i32* %7
%14 = ptrtoint i8* %12 to i64
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = ptrtoint i8* %13 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @__strcmp(i8* %0, i8* %1) {
%3 = tail call { i32, i8*, i8* } asm sideeffect "1: lodsb;scasb;jne 2f;testb %al, %al;jne 1b;xorl %eax, %eax;jmp 3f;2: sbbl %eax, %eax;orb $$1, %al;3:", "={ax},=&{si},=&{di},1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i32, i8*, i8* } %3, 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: exeflat (src.exe) (dest.sys) (relocation-factor)\n");
  printf("               -S10   - Silent relocate segment 10 (down list)\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"usage: exeflat (src.exe) (dest.sys) (relocation-factor)\0A\00"
@.str.1 = [64 x i8] c" -S10 - Silent relocate segment 10 (down list)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [56 x i8] c"usage: exeflat (src.exe) (dest.sys) (relocation-factor)\00"
@str.2 = [63 x i8] c" -S10 - Silent relocate segment 10 (down list)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
void hts(void) { esc("H"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"H\00"
define void @hts() {
%1 = call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"H\00"
define void @hts() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}