xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ readFromFd(int, int /*<<< orphan*/ *, size_t);
bool readFromFdAll(int fd, uint8_t *buf, size_t len) {
  return (readFromFd(fd, buf, len) == (ssize_t)len);
}


x86 assembly (clang, -O0):
<readFromFdAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <readFromFd@plt>
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readFromFdAll>:
push   %rbx
mov    %rdx,%rbx
call   1030 <readFromFd@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @readFromFdAll(i32 %0, i32* %1, i64 %2) {
%4 = tail call i64 @readFromFd(i32 %0, i32* %1, i64 %2)
%5 = icmp eq i64 %4, %2
%6 = zext i1 %5 to i32
ret i32 %6
}
void raio_bs_null_close(struct raio_bs *dev) {}


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

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

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

LLVM IR (-O2):
%struct.raio_bs = type opaque
define void @raio_bs_null_close(%struct.raio_bs* nocapture %0) {
ret void
}
/* Type definitions */
struct ct_assert_report {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ct_assert_report *);
void ct_destroy_assert_report(struct ct_assert_report *report) { free(report); }


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

x86 assembly (clang, -O2):
<ct_destroy_assert_report>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ct_assert_report = type { i32 }
define void @ct_destroy_assert_report(%struct.ct_assert_report* %0) {
%2 = alloca %struct.ct_assert_report*
store %struct.ct_assert_report* %0, %struct.ct_assert_report** %2
%3 = load %struct.ct_assert_report*, %struct.ct_assert_report** %2
%4 = call i32 @free(%struct.ct_assert_report* %3)
ret void
}

LLVM IR (-O2):
%struct.ct_assert_report = type { i32 }
define void @ct_destroy_assert_report(%struct.ct_assert_report* nocapture %0) {
%2 = tail call i32 @free(%struct.ct_assert_report* %0)
ret void
}
/* Variables and functions */
char *strchr(char const *, int);
char *htx_strchr(const char *s, int c) { return strchr(s, c); }


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

x86 assembly (clang, -O2):
<htx_strchr>:
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i8* @htx_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 = call i8* @strchr(i8* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @htx_strchr(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ FRGL_CodecBT1H_Init();
int /*<<< orphan*/ FRGL_CodecBT4B_Init();
int /*<<< orphan*/ FRGL_CodecCRAM_Init();
int /*<<< orphan*/ FRGL_CodecVFW_Init();
int FRGL_Codec_Init() {
  static int init;
  if (init)
    return (0);
  init = 1;
  FRGL_CodecVFW_Init();
  FRGL_CodecCRAM_Init();
  FRGL_CodecBT1H_Init();
  FRGL_CodecBT4B_Init();
  return (1);
}


x86 assembly (clang, -O0):
<FRGL_Codec_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2ef5(%rip)
je     1161 <FRGL_Codec_Init+0x21>
movl   $0x0,-0x4(%rbp)
jmp    118e <FRGL_Codec_Init+0x4e>
movl   $0x1,0x2ed9(%rip)
mov    $0x0,%al
call   1040 <FRGL_CodecVFW_Init@plt>
mov    $0x0,%al
call   1060 <FRGL_CodecCRAM_Init@plt>
mov    $0x0,%al
call   1030 <FRGL_CodecBT1H_Init@plt>
mov    $0x0,%al
call   1050 <FRGL_CodecBT4B_Init@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FRGL_Codec_Init>:
push   %rax
xor    %eax,%eax
cmpb   $0x0,0x2efa(%rip)
jne    1174 <FRGL_Codec_Init+0x34>
movb   $0x1,0x2ef1(%rip)
xor    %eax,%eax
call   1040 <FRGL_CodecVFW_Init@plt>
xor    %eax,%eax
call   1060 <FRGL_CodecCRAM_Init@plt>
xor    %eax,%eax
call   1030 <FRGL_CodecBT1H_Init@plt>
xor    %eax,%eax
call   1050 <FRGL_CodecBT4B_Init@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FRGL_Codec_Init.init = internal global i32 0
define i32 @FRGL_Codec_Init() {
%1 = alloca i32
%2 = load i32, i32* @FRGL_Codec_Init.init
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %10
5: ; preds = %0
store i32 1, i32* @FRGL_Codec_Init.init
%6 = call i32 (...) @FRGL_CodecVFW_Init()
%7 = call i32 (...) @FRGL_CodecCRAM_Init()
%8 = call i32 (...) @FRGL_CodecBT1H_Init()
%9 = call i32 (...) @FRGL_CodecBT4B_Init()
store i32 1, i32* %1
br label %10
10: ; preds = %5, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@FRGL_Codec_Init.init = internal unnamed_addr global i1 false
define i32 @FRGL_Codec_Init() {
%1 = load i1, i1* @FRGL_Codec_Init.init
br i1 %1, label %7, label %2
2: ; preds = %0
store i1 true, i1* @FRGL_Codec_Init.init
%3 = tail call i32 (...) @FRGL_CodecVFW_Init()
%4 = tail call i32 (...) @FRGL_CodecCRAM_Init()
%5 = tail call i32 (...) @FRGL_CodecBT1H_Init()
%6 = tail call i32 (...) @FRGL_CodecBT4B_Init()
br label %7
7: ; preds = %0, %2
%8 = phi i32 [ 1, %2 ], [ 0, %0 ]
ret i32 %8
}
int LZ4_sizeofStreamState() {
  return (((1 << (14 - 3)) + 4 + ((sizeof(void *) == 16) ? 4 : 0)) *
          sizeof(unsigned long long));
}


x86 assembly (clang, -O0):
<LZ4_sizeofStreamState>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4020,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @LZ4_sizeofStreamState() {
ret i32 16416
}

LLVM IR (-O2):
define i32 @LZ4_sizeofStreamState() {
ret i32 16416
}
void xxx(int argc) {
  int x;
#pragma omp taskloop
  for (int i = 0; i < 10; ++i)
    argc = x;
}


x86 assembly (clang, -O0):
<xxx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    112c <xxx+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <xxx+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @xxx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32, i32* %3
store i32 %9, i32* %2
br label %10
10: ; preds = %8
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @xxx(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void st103_set_tx_addr(uint8_t ep_num, uint16_t addr) {
  uint16_t *reg_p = (uint16_t *)((0x40006000UL) + (ep_num * 8 + 0) * 2);
  *reg_p = addr;
}


x86 assembly (clang, -O0):
<st103_set_tx_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    $0x0,%eax
shl    $0x1,%eax
cltq
add    $0x40006000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<st103_set_tx_addr>:
movslq %edi,%rax
shl    $0x4,%rax
mov    %esi,0x40006000(%rax)
ret

LLVM IR (-O0):
define void @st103_set_tx_addr(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 = mul nsw i32 %6, 8
%8 = add nsw i32 %7, 0
%9 = mul nsw i32 %8, 2
%10 = sext i32 %9 to i64
%11 = add i64 1073766400, %10
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %5
%13 = load i32, i32* %4
%14 = load i32*, i32** %5
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @st103_set_tx_addr(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 4
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, 1073766400
%6 = inttoptr i64 %5 to i32*
store i32 %1, i32* %6
ret void
}
/* Variables and functions */
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ usage();
int intopt(int min) {
  int n = atoi(optarg);
  if (n < min)
    usage();
  return n;
}


x86 assembly (clang, -O0):
<intopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1040 <atoi@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114f <intopt+0x2f>
mov    $0x0,%al
call   1030 <usage@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intopt>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
call   1040 <atoi@plt>
mov    %eax,%ebx
cmp    %ebp,%eax
jge    1140 <intopt+0x20>
xor    %eax,%eax
call   1030 <usage@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@optarg = global i32 0
define i32 @intopt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @optarg
%5 = call i32 @atoi(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (...) @usage()
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@optarg = global i32 0
define i32 @intopt(i32 %0) {
%2 = load i32, i32* @optarg
%3 = tail call i32 @atoi(i32 %2)
%4 = icmp slt i32 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @usage()
br label %7
7: ; preds = %5, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void ft_putstr(char *str) {
  if (!str)
    return;
  write(1, str, ft_strlen(str));
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <ft_putstr+0x1c>
jmp    115d <ft_putstr+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
test   %rdi,%rdi
je     113e <ft_putstr+0x1e>
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = tail call i32 @write(i32 1, i8* %0, i32 %4)
br label %6
6: ; preds = %1, %3
ret void
}
double d_sin_xx_10(double xx) {
  return 0.7853981633974483 +
         xx * (-0.08074551218802455 +
               xx * (0.002490394567124187 +
                     xx * (-3.65761914008964e-05 +
                           xx * (3.133376118159403e-07 +
                                 xx * (-1.736214417895343e-09)))));
}


x86 assembly (clang, -O0):
<d_sin_xx_10>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm4
movsd  0xef6(%rip),%xmm5
mulsd  %xmm5,%xmm4
movsd  0xef2(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xed2(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xeba(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xea2(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8a(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_sin_xx_10>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeec(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee8(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @d_sin_xx_10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = load double, double* %2
%7 = load double, double* %2
%8 = call double @llvm.fmuladd.f64(double %7, double 0xBE1DD3F3A6BFFFFF, double 0x3E95071963F43001)
%9 = call double @llvm.fmuladd.f64(double %6, double %8, double 0xBF032D2C5DF5DABF)
%10 = call double @llvm.fmuladd.f64(double %5, double %9, double 0x3F6466BC6709B3FE)
%11 = call double @llvm.fmuladd.f64(double %4, double %10, double 0xBFB4ABBCE6257633)
%12 = call double @llvm.fmuladd.f64(double %3, double %11, double 0x3FE921FB54442D18)
ret double %12
}

LLVM IR (-O2):
define double @d_sin_xx_10(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0xBE1DD3F3A6BFFFFF, double 0x3E95071963F43001)
%3 = tail call double @llvm.fmuladd.f64(double %0, double %2, double 0xBF032D2C5DF5DABF)
%4 = tail call double @llvm.fmuladd.f64(double %0, double %3, double 0x3F6466BC6709B3FE)
%5 = tail call double @llvm.fmuladd.f64(double %0, double %4, double 0xBFB4ABBCE6257633)
%6 = tail call double @llvm.fmuladd.f64(double %0, double %5, double 0x3FE921FB54442D18)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ crrepair(char const *);
int /*<<< orphan*/ pdperror(char const *);
int dorepair(const char *name) {
  if (!crrepair(name)) {
    pdperror(name);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<dorepair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <crrepair@plt>
cmp    $0x0,%eax
jne    1153 <dorepair+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <pdperror@plt>
movl   $0x1,-0x4(%rbp)
jmp    115a <dorepair+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dorepair>:
push   %rbx
mov    %rdi,%rbx
call   1040 <crrepair@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1133 <dorepair+0x13>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <pdperror@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @dorepair(i8* %0) {
%2 = tail call i32 @crrepair(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pdperror(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
double fabs(const double x) { return (x < 0) ? -x : x; }


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <fabs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <fabs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_get_user_name() {
  printf("NOT IMPLEMENTED:"
         "pa_get_user_name"
         "\n");
}


x86 assembly (clang, -O0):
<pa_get_user_name>:
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_get_user_name>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_get_user_name\00"
define i32 @pa_get_user_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int _sha2_str(unsigned char *, unsigned char const *, int);
int sha2_chain(unsigned char *d2, const unsigned char *d1) {
  return _sha2_str(d2, d1, (32));
}


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

x86 assembly (clang, -O2):
<sha2_chain>:
mov    $0x20,%edx
jmp    1030 <_sha2_str@plt>

LLVM IR (-O0):
define i32 @sha2_chain(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 i32 @_sha2_str(i8* %5, i8* %6, i32 32)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sha2_chain(i8* %0, i8* %1) {
%3 = tail call i32 @_sha2_str(i8* %0, i8* %1, i32 32)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, World.\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 = [15 x i8] c"Hello, World.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float obdConvert_04(unsigned int A, unsigned int B, unsigned int C,
                    unsigned int D) {
  return (float)A * 100.0f / 255.0f;
}


x86 assembly (clang, -O0):
<obdConvert_04>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xee4(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xed4(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_04>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mulss  0xef1(%rip),%xmm0
divss  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_04(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
%11 = fmul float %10, 1.000000e+02
%12 = fdiv float %11, 2.550000e+02
ret float %12
}

LLVM IR (-O2):
define float @obdConvert_04(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
%6 = fmul float %5, 1.000000e+02
%7 = fdiv float %6, 2.550000e+02
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv, char **envp) {
  char **env;
  for (env = envp; *env; env++) {
    printf("%s\n", *env);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     1164 <main+0x54>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    1132 <main+0x22>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    (%rdx),%rsi
test   %rsi,%rsi
je     1144 <main+0x34>
mov    %rdx,%rbx
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %11, %6 ], [ %4, %3 ]
%8 = phi i8** [ %10, %6 ], [ %2, %3 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
ret i32 0
}
/* Variables and functions */
int incr(int);
int main() { return incr(3); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x3,%edi
jmp    1030 <incr@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @incr(i32 3)
ret i32 %1
}
/* Type definitions */
struct yaffs_obj {
  int dummy;
};

/* Variables and functions */
int yaffs_do_getxattr_reldir(struct yaffs_obj *, char const *, char const *,
                             void *, int, int);
int yaffs_getxattr_reldir(struct yaffs_obj *reldir, const char *path,
                          const char *name, void *data, int size) {
  return yaffs_do_getxattr_reldir(reldir, path, name, data, size, 1);
}


x86 assembly (clang, -O0):
<yaffs_getxattr_reldir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <yaffs_do_getxattr_reldir@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_getxattr_reldir>:
mov    $0x1,%r9d
jmp    1030 <yaffs_do_getxattr_reldir@plt>

LLVM IR (-O0):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_getxattr_reldir(%struct.yaffs_obj* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca %struct.yaffs_obj*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store %struct.yaffs_obj* %0, %struct.yaffs_obj** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load %struct.yaffs_obj*, %struct.yaffs_obj** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = call i32 @yaffs_do_getxattr_reldir(%struct.yaffs_obj* %11, i8* %12, i8* %13, i8* %14, i32 %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_getxattr_reldir(%struct.yaffs_obj* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = tail call i32 @yaffs_do_getxattr_reldir(%struct.yaffs_obj* %0, i8* %1, i8* %2, i8* %3, i32 %4, i32 1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo(void) { bar(); }


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

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @bar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AltitudeHoldStatusHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void AltitudeHoldStatusUpdated() { UAVObjUpdated(AltitudeHoldStatusHandle()); }


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

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

LLVM IR (-O0):
define void @AltitudeHoldStatusUpdated() {
%1 = call i32 (...) @AltitudeHoldStatusHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AltitudeHoldStatusUpdated() {
%1 = tail call i32 (...) @AltitudeHoldStatusHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, void *);
void bitmap_destroy(void *bitmap) {
  printf(">>> bitmap_destroy 0x%8.8X\n", bitmap);
  free(bitmap);
}


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

x86 assembly (clang, -O2):
<bitmap_destroy>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [28 x i8] c">>> bitmap_destroy 0x%8.8X\0A\00"
define void @bitmap_destroy(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fvec_distance_L2sqr(float const *, float const *, long);
double sqrt(int /*<<< orphan*/);
double fvec_distance_L2(const float *v1, const float *v2, long n) {
  return sqrt(fvec_distance_L2sqr(v1, v2, n));
}


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

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

LLVM IR (-O0):
define double @fvec_distance_L2(float* %0, float* %1, i64 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i64
store float* %0, float** %4
store float* %1, float** %5
store i64 %2, i64* %6
%7 = load float*, float** %4
%8 = load float*, float** %5
%9 = load i64, i64* %6
%10 = call i32 @fvec_distance_L2sqr(float* %7, float* %8, i64 %9)
%11 = call double @sqrt(i32 %10)
ret double %11
}

LLVM IR (-O2):
define double @fvec_distance_L2(float* %0, float* %1, i64 %2) {
%4 = tail call i32 @fvec_distance_L2sqr(float* %0, float* %1, i64 %2)
%5 = tail call double @sqrt(i32 %4)
ret double %5
}
int ed2k_thead(void) {}


x86 assembly (clang, -O0):
<ed2k_thead>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ed2k_thead() {
ret i32 undef
}
int main() {
  if (__alignof__(char) != 1) {
    abort();
  }
  if (__alignof__(unsigned char) != 1) {
    abort();
  }
  if (__alignof__(signed char) != 1) {
    abort();
  }
  if (__alignof__(short) != 2) {
    abort();
  }
  if (__alignof__(short int) != 2) {
    abort();
  }
  if (__alignof__(signed short) != 2) {
    abort();
  }
  if (__alignof__(signed short int) != 2) {
    abort();
  }
  if (__alignof__(unsigned short) != 2) {
    abort();
  }
  if (__alignof__(unsigned short int) != 2) {
    abort();
  }
  if (__alignof__(int) != 4) {
    abort();
  }
  if (__alignof__(signed int) != 4) {
    abort();
  }
  if (__alignof__(unsigned) != 4) {
    abort();
  }
  if (__alignof__(unsigned int) != 4) {
    abort();
  }
  if (__alignof__(long) != 8) {
    abort();
  }
  if (__alignof__(float) != 8) {
    abort();
  }
  if (__alignof__(double) != 8) {
    abort();
  }
  if (__alignof__(int *) != 8) {
    abort();
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void @abort()
unreachable
}
int scale_to_int(double x, int numcc) {
  int s;
  s = (int)(0.5 + 0.0000001 + x * (numcc - 1));
  if (s < 0)
    s = 0;
  if (s > numcc - 1)
    s = numcc - 1;
  return s;
}


x86 assembly (clang, -O0):
<scale_to_int>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1143 <scale_to_int+0x43>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    115d <scale_to_int+0x5d>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_to_int>:
lea    -0x1(%rdi),%ecx
cvtsi2sd %ecx,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeed(%rip),%xmm1
cvttsd2si %xmm1,%edx
xor    %eax,%eax
test   %edx,%edx
cmovns %edx,%eax
cmp    %edi,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @scale_to_int(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%6 = load double, double* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %6, double %9, double 0x3FE0000035AFE535)
%11 = fptosi double %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %5
br label %15
15: ; preds = %14, %2
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
%19 = icmp sgt i32 %16, %18
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %5
br label %23
23: ; preds = %20, %15
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @scale_to_int(double %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sitofp i32 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %0, double %4, double 0x3FE0000035AFE535)
%6 = fptosi double %5 to i32
%7 = icmp sgt i32 %6, 0
%8 = select i1 %7, i32 %6, i32 0
%9 = icmp slt i32 %8, %1
%10 = select i1 %9, i32 %8, i32 %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void intToString(char *dest, int val) {
  if (dest != NULL) {
    snprintf(dest, 10 + 1, "%d", val);
  }
}


x86 assembly (clang, -O0):
<intToString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1142 <intToString+0x32>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0xb,%esi
lea    0xec3(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intToString>:
test   %rdi,%rdi
je     1128 <intToString+0x18>
mov    %esi,%ecx
lea    0xee2(%rip),%rdx
mov    $0xb,%esi
jmp    1030 <snprintf@plt>
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @intToString(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @snprintf(i8* %8, i32 11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @intToString(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @snprintf(i8* %0, i32 11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %6
6: ; preds = %4, %2
ret void
}
void foo139() {}


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

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

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

LLVM IR (-O2):
define void @foo139() {
ret void
}
void gfx_ctx_get_video_size(unsigned *width, unsigned *height) {
  (void)width;
  (void)height;
}


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

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

LLVM IR (-O0):
define void @gfx_ctx_get_video_size(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
ret void
}

LLVM IR (-O2):
define void @gfx_ctx_get_video_size(i32* nocapture %0, i32* nocapture %1) {
ret void
}
void cwarn(str) char *str;
{ cmsg("warning", str); }


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

x86 assembly (clang, -O2):
<cwarn>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <cmsg@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"warning\00"
define void @cwarn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @cmsg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"warning\00"
define void @cwarn(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @cmsg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_argument(char const *);
int /*<<< orphan*/ add_delete(char const *);
const char *add_argument_delete(const char *p) {
  add_delete(p);
  add_argument(p);
  return p;
}


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

x86 assembly (clang, -O2):
<add_argument_delete>:
push   %rbx
mov    %rdi,%rbx
call   1030 <add_delete@plt>
mov    %rbx,%rdi
call   1040 <add_argument@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @add_argument_delete(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @add_delete(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @add_argument(i8* %5)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
define i8* @add_argument_delete(i8* returned %0) {
%2 = tail call i32 @add_delete(i8* %0)
%3 = tail call i32 @add_argument(i8* %0)
ret i8* %0
}
/* Type definitions */
typedef char GLubyte;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
char *gluErrorString(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void surface_nurbError(GLenum errorCode) {
  const GLubyte *estring;
  estring = gluErrorString(errorCode);
  fprintf(stderr, "Quadric Error: %s\n", estring);
  exit(0);
}


x86 assembly (clang, -O0):
<surface_nurbError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <gluErrorString@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<surface_nurbError>:
push   %rax
call   1040 <gluErrorString@plt>
mov    0x2ea3(%rip),%rcx
mov    (%rcx),%edi
lea    0xeba(%rip),%rsi
mov    %rax,%rdx
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Quadric Error: %s\0A\00"
define void @surface_nurbError(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @gluErrorString(i32 %4)
store i8* %5, i8** %3
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Quadric Error: %s\0A\00"
define void @surface_nurbError(i32 %0) {
%2 = tail call i8* @gluErrorString(i32 %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int numberOfFields(FILE *fp) {
  int x;
  rewind(fp);
  fscanf(fp, "%d", &x);
  return x;
}


x86 assembly (clang, -O0):
<numberOfFields>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x8(%rbp),%rdi
lea    0xec0(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberOfFields>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <rewind@plt>
lea    0xecc(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <fscanf@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @numberOfFields(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @rewind(i32* %0)
%5 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ secapp_open(int, char **, char **, int *);
int system(char *);
void main(int argc, char **argv, char **envp) {
  int pid = 0;
  int status = system("install -d $HOME/.local/share/secapp/wdir");
  secapp_open(argc, argv, envp, &pid);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xebf(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1030 <secapp_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
lea    0xec1(%rip),%rdi
call   1040 <system@plt>
lea    0xc(%rsp),%rcx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <secapp_open@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"install -d $HOME/.local/share/secapp/wdir\00"
define void @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
store i32 0, i32* %7
%9 = call i32 @system(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %8
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = load i8**, i8*** %6
%13 = call i32 @secapp_open(i32 %10, i8** %11, i8** %12, i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"install -d $HOME/.local/share/secapp/wdir\00"
define void @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = tail call i32 @system(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @secapp_open(i32 %0, i8** %1, i8** %2, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr,
                "usage: mount_synthfs [-o options] synthfs mount_point\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"usage: mount_synthfs [-o options] synthfs mount_point\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"usage: mount_synthfs [-o options] synthfs mount_point\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
_Complex float test_cpowf(_Complex float x, _Complex float y) {
  return __builtin_cpowf(x, y);
}


x86 assembly (clang, -O0):
<test_cpowf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movlpd %xmm0,-0x10(%rbp)
movlpd %xmm1,-0x18(%rbp)
movss  -0x10(%rbp),%xmm3
movss  -0xc(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
movss  -0x14(%rbp),%xmm1
movss  %xmm3,-0x20(%rbp)
movss  %xmm0,-0x1c(%rbp)
movsd  -0x20(%rbp),%xmm0
movss  %xmm2,-0x28(%rbp)
movss  %xmm1,-0x24(%rbp)
movsd  -0x28(%rbp),%xmm1
call   1030 <cpowf@plt>
movlpd %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cpowf>:
jmp    1030 <cpowf@plt>

LLVM IR (-O0):
define <2 x float> @test_cpowf(<2 x float> %0, <2 x float> %1) {
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = alloca { float, float }
%7 = alloca { float, float }
%8 = alloca { float, float }
%9 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %0, <2 x float>* %9
%10 = bitcast { float, float }* %5 to <2 x float>*
store <2 x float> %1, <2 x float>* %10
%11 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%12 = load float, float* %11
%13 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%14 = load float, float* %13
%15 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%16 = load float, float* %15
%17 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%18 = load float, float* %17
%19 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 0
%20 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 1
store float %12, float* %19
store float %14, float* %20
%21 = bitcast { float, float }* %6 to <2 x float>*
%22 = load <2 x float>, <2 x float>* %21
%23 = getelementptr inbounds { float, float }, { float, float }* %7, i32 0, i32 0
%24 = getelementptr inbounds { float, float }, { float, float }* %7, i32 0, i32 1
store float %16, float* %23
store float %18, float* %24
%25 = bitcast { float, float }* %7 to <2 x float>*
%26 = load <2 x float>, <2 x float>* %25
%27 = call <2 x float> @cpowf(<2 x float> %22, <2 x float> %26)
%28 = bitcast { float, float }* %8 to <2 x float>*
store <2 x float> %27, <2 x float>* %28
%29 = getelementptr inbounds { float, float }, { float, float }* %8, i32 0, i32 0
%30 = load float, float* %29
%31 = getelementptr inbounds { float, float }, { float, float }* %8, i32 0, i32 1
%32 = load float, float* %31
%33 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%34 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %30, float* %33
store float %32, float* %34
%35 = bitcast { float, float }* %3 to <2 x float>*
%36 = load <2 x float>, <2 x float>* %35
ret <2 x float> %36
}

LLVM IR (-O2):
define <2 x float> @test_cpowf(<2 x float> %0, <2 x float> %1) {
%3 = tail call <2 x float> @cpowf(<2 x float> %0, <2 x float> %1)
ret <2 x float> %3
}