xunge/DecIR huggingface dataset:
/* Type definitions */
struct altera_spi_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct altera_spi_device *);
void altera_spi_release(struct altera_spi_device *dev) {
  if (dev)
    free(dev);
}


x86 assembly (clang, -O0):
<altera_spi_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <altera_spi_release+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<altera_spi_release>:
test   %rdi,%rdi
je     111a <altera_spi_release+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.altera_spi_device = type { i32 }
define void @altera_spi_release(%struct.altera_spi_device* %0) {
%2 = alloca %struct.altera_spi_device*
store %struct.altera_spi_device* %0, %struct.altera_spi_device** %2
%3 = load %struct.altera_spi_device*, %struct.altera_spi_device** %2
%4 = icmp ne %struct.altera_spi_device* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.altera_spi_device*, %struct.altera_spi_device** %2
%7 = call i32 @free(%struct.altera_spi_device* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.altera_spi_device = type { i32 }
define void @altera_spi_release(%struct.altera_spi_device* %0) {
%2 = icmp eq %struct.altera_spi_device* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.altera_spi_device* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ led_init();
int /*<<< orphan*/ uart_init();
void hw_init() {
  uart_init();
  led_init();
}


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

x86 assembly (clang, -O2):
<hw_init>:
push   %rax
xor    %eax,%eax
call   1030 <uart_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <led_init@plt>

LLVM IR (-O0):
define void @hw_init() {
%1 = call i32 (...) @uart_init()
%2 = call i32 (...) @led_init()
ret void
}

LLVM IR (-O2):
define void @hw_init() {
%1 = tail call i32 (...) @uart_init()
%2 = tail call i32 (...) @led_init()
ret void
}
char *strchr(char *str, int character) {
  do {
    if (*str == character)
      return (char *)str;
  } while (*str++);
  return 0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1128 <strchr+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114d <strchr+0x4d>
jmp    112d <strchr+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rax),%ecx
cmp    %esi,%ecx
je     1121 <strchr+0x21>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, %1
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %5, 0
br i1 %10, label %11, label %3
11: ; preds = %8, %3
%12 = phi i8* [ %4, %3 ], [ null, %8 ]
ret i8* %12
}
int linux_printaff_() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @linux_printaff_() {
ret i32 0
}
void I2CDMADisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) &= ~0x00000800;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) &= ~0x00001000;
}


x86 assembly (clang, -O0):
<I2CDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
and    $0xfffffffffffff7ff,%rcx
mov    %rcx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
and    $0xffffffffffffefff,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CDMADisable>:
andq   $0xfffffffffffff7ff,0x4(%rdi)
ff
andq   $0xffffffffffffefff,0x4(%rdi)
ff
ret

LLVM IR (-O0):
define void @I2CDMADisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -2049
store volatile i64 %7, i64* %5
%8 = load i64, i64* %2
%9 = add i64 %8, 4
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, -4097
store volatile i64 %12, i64* %10
ret void
}

LLVM IR (-O2):
define void @I2CDMADisable(i64 %0) {
%2 = add i64 %0, 4
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -2049
store volatile i64 %5, i64* %3
%6 = load volatile i64, i64* %3
%7 = and i64 %6, -4097
store volatile i64 %7, i64* %3
ret void
}
int foo(int x, short y) { return x ?: y; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1128 <foo+0x28>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112f <foo+0x2f>
movswl -0x6(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%eax
test   %edi,%edi
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %11
8: ; preds = %2
%9 = load i16, i16* %4
%10 = sext i16 %9 to i32
br label %11
11: ; preds = %8, %7
%12 = phi i32 [ %5, %7 ], [ %10, %8 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i16 signext %1) {
%3 = icmp eq i32 %0, 0
%4 = sext i16 %1 to i32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int *always_null(void) { return 0; }


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

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

LLVM IR (-O0):
define i32* @always_null() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @always_null() {
ret i32* null
}
unsigned long long unsignedlonglong_id(unsigned long long x) { return x; }


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

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

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

LLVM IR (-O2):
define i64 @unsignedlonglong_id(i64 returned %0) {
ret i64 %0
}
char *getName() { return "cpu"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"cpu\00"
define i8* @getName() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void snail_cnt_reset(void) {
  mbus_remote_register_write(0x4, 0x01, ((0 << 5) | (0 << 4) | (2 << 2) | (1)));
}


x86 assembly (clang, -O0):
<snail_cnt_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x9,%edx
call   1030 <mbus_remote_register_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<snail_cnt_reset>:
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x9,%edx
jmp    1030 <mbus_remote_register_write@plt>

LLVM IR (-O0):
define void @snail_cnt_reset() {
%1 = call i32 @mbus_remote_register_write(i32 4, i32 1, i32 9)
ret void
}

LLVM IR (-O2):
define void @snail_cnt_reset() {
%1 = tail call i32 @mbus_remote_register_write(i32 4, i32 1, i32 9)
ret void
}
void yy_1_LinkOptionResize(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_LinkOptionResize(i8* nocapture %0, i32 %1) {
ret void
}
int bar(int i) {
  switch (i)
  case 0:
  case 1:
    return i;
  return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
ja     1123 <bar+0x23>
jmp    1118 <bar+0x18>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112a <bar+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %eax,%eax
cmp    $0x2,%edi
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = icmp ult i32 %0, 2
%3 = select i1 %2, i32 %0, i32 0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS12_BAGS;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS12_BAGS_it;
PKCS12_BAGS *d2i_PKCS12_BAGS(PKCS12_BAGS **a, const unsigned char **in,
                             long len) {
  return (PKCS12_BAGS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                      &PKCS12_BAGS_it);
}


x86 assembly (clang, -O0):
<d2i_PKCS12_BAGS>:
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
mov    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_PKCS12_BAGS>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@PKCS12_BAGS_it = global i32 0
define i32* @d2i_PKCS12_BAGS(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @PKCS12_BAGS_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@PKCS12_BAGS_it = global i32 0
define i32* @d2i_PKCS12_BAGS(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @PKCS12_BAGS_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int isdigit(char);
int isDigit(char c) { return isdigit(c); }


x86 assembly (clang, -O0):
<isDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDigit>:
jmp    1030 <isdigit@plt>

LLVM IR (-O0):
define i32 @isDigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @isdigit(i8 signext %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @isDigit(i8 signext %0) {
%2 = tail call i32 @isdigit(i8 signext %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int _open(const char *pathname, int flags, mode_t mode) { return -1; }


x86 assembly (clang, -O0):
<_open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @_open(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int div10(int, int *);
uint8_t itobcd(uint8_t i) {
  uint8_t bcd;
  uint8_t r;
  bcd = div10(i, &r) << 4;
  bcd |= r;
  return bcd;
}


x86 assembly (clang, -O0):
<itobcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1030 <div10@plt>
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itobcd>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <div10@plt>
shl    $0x4,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @itobcd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @div10(i32 %5, i32* %4)
%7 = shl i32 %6, 4
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @itobcd(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @div10(i32 %0, i32* %2)
%5 = shl i32 %4, 4
%6 = load i32, i32* %2
%7 = or i32 %5, %6
ret i32 %7
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double my_gettime() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (double)t.tv_sec + (double)t.tv_usec * 1.0E-6;
}


x86 assembly (clang, -O0):
<my_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_gettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @my_gettime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @my_gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
float *hdr_load(int *, int *, int *, int);
int /*<<< orphan*/ start_file(int /*<<< orphan*/ *);
float *stbi_hdr_load_from_file(FILE *f, int *x, int *y, int *comp,
                               int req_comp) {
  start_file(f);
  return hdr_load(x, y, comp, req_comp);
}


x86 assembly (clang, -O0):
<stbi_hdr_load_from_file>:
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
call   1030 <start_file@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <hdr_load@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi_hdr_load_from_file>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%rbp
mov    %rsi,%rbx
call   1030 <start_file@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <hdr_load@plt>

LLVM IR (-O0):
define float* @stbi_hdr_load_from_file(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = call i32 @start_file(i32* %11)
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = load i32*, i32** %9
%16 = load i32, i32* %10
%17 = call float* @hdr_load(i32* %13, i32* %14, i32* %15, i32 %16)
ret float* %17
}

LLVM IR (-O2):
define float* @stbi_hdr_load_from_file(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4) {
%6 = tail call i32 @start_file(i32* %0)
%7 = tail call float* @hdr_load(i32* %1, i32* %2, i32* %3, i32 %4)
ret float* %7
}
/* Variables and functions */
int /*<<< orphan*/ enable_logic();
int /*<<< orphan*/ init_motors();
int /*<<< orphan*/ init_samples(char *);
int /*<<< orphan*/ logic_loop();
int /*<<< orphan*/ remote_init();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  srand(time(NULL));
  remote_init();
  enable_logic();
  init_motors();
  init_samples("samples");
  while (1) {
    logic_loop();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1070 <remote_init@plt>
mov    $0x0,%al
call   1030 <enable_logic@plt>
mov    $0x0,%al
call   1050 <init_motors@plt>
lea    0xe4e(%rip),%rdi
call   1090 <init_samples@plt>
mov    $0x0,%al
call   1080 <logic_loop@plt>
jmp    11b7 <main+0x47>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1070 <remote_init@plt>
xor    %eax,%eax
call   1030 <enable_logic@plt>
xor    %eax,%eax
call   1050 <init_motors@plt>
lea    0xe65(%rip),%rdi
call   1090 <init_samples@plt>
xor    %eax,%eax
call   1080 <logic_loop@plt>
jmp    11a0 <main+0x30>

LLVM IR (-O0):
@.str = [8 x i8] c"samples\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
%8 = call i32 (...) @remote_init()
%9 = call i32 (...) @enable_logic()
%10 = call i32 (...) @init_motors()
%11 = call i32 @init_samples(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %2, %12
%13 = call i32 (...) @logic_loop()
br label %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"samples\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @remote_init()
%6 = tail call i32 (...) @enable_logic()
%7 = tail call i32 (...) @init_motors()
%8 = tail call i32 @init_samples(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %2, %9
%10 = tail call i32 (...) @logic_loop()
br label %9
}
/* Type definitions */
struct rlimit {
  size_t rlim_max;
  size_t rlim_cur;
};
typedef int /*<<< orphan*/ limit;

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_STACK;
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ memset(struct rlimit *, int /*<<< orphan*/, int);
size_t arch_stack_avail(void) {
  struct rlimit limit;
  memset(&limit, 0, sizeof(limit));
  getrlimit(RLIMIT_STACK, &limit);
  return limit.rlim_max - limit.rlim_cur;
}


x86 assembly (clang, -O0):
<arch_stack_avail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1040 <getrlimit@plt>
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_stack_avail>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <getrlimit@plt>
mov    (%rsp),%rax
sub    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.rlimit = type { i64, i64 }
@RLIMIT_STACK = global i32 0
define i64 @arch_stack_avail() {
%1 = alloca %struct.rlimit
%2 = call i32 @memset(%struct.rlimit* %1, i32 0, i32 16)
%3 = load i32, i32* @RLIMIT_STACK
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
%6 = load i64, i64* %5
%7 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sub i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.rlimit = type { i64, i64 }
@RLIMIT_STACK = global i32 0
define i64 @arch_stack_avail() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = call i32 @memset(%struct.rlimit* %1, i32 0, i32 16)
%4 = load i32, i32* @RLIMIT_STACK
%5 = call i32 @getrlimit(i32 %4, %struct.rlimit* %1)
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = sub i64 %7, %9
ret i64 %10
}
/* Variables and functions */
float clamp(float, double, double);
float ieFilteredStep(float edge, float x, float w) {
  return clamp((x + w / 2.0 - edge) / w, 0.0, 1.0);
}


x86 assembly (clang, -O0):
<ieFilteredStep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  0xe8e(%rip),%xmm2
call   1030 <clamp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieFilteredStep>:
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
movsd  0xee0(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
cvtss2sd %xmm0,%xmm0
subsd  %xmm0,%xmm3
divsd  %xmm2,%xmm3
xorps  %xmm0,%xmm0
cvtsd2ss %xmm3,%xmm0
movsd  0xec5(%rip),%xmm2
xorps  %xmm1,%xmm1
jmp    1030 <clamp@plt>

LLVM IR (-O0):
define float @ieFilteredStep(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = fpext float %7 to double
%9 = load float, float* %6
%10 = fpext float %9 to double
%11 = fdiv double %10, 2.000000e+00
%12 = fadd double %8, %11
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = fsub double %12, %14
%16 = load float, float* %6
%17 = fpext float %16 to double
%18 = fdiv double %15, %17
%19 = fptrunc double %18 to float
%20 = call float @clamp(float %19, double 0.000000e+00, double 1.000000e+00)
ret float %20
}

LLVM IR (-O2):
define float @ieFilteredStep(float %0, float %1, float %2) {
%4 = fpext float %1 to double
%5 = fpext float %2 to double
%6 = fmul double %5, 5.000000e-01
%7 = fadd double %6, %4
%8 = fpext float %0 to double
%9 = fsub double %7, %8
%10 = fdiv double %9, %5
%11 = fptrunc double %10 to float
%12 = tail call float @clamp(float %11, double 0.000000e+00, double 1.000000e+00)
ret float %12
}
int dns_txt_cmp(const struct dns_txt *a, const struct dns_txt *b) {
  (void)a;
  (void)b;
  return -1;
}


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

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

LLVM IR (-O0):
%struct.dns_txt = type opaque
define i32 @dns_txt_cmp(%struct.dns_txt* %0, %struct.dns_txt* %1) {
%3 = alloca %struct.dns_txt*
%4 = alloca %struct.dns_txt*
store %struct.dns_txt* %0, %struct.dns_txt** %3
store %struct.dns_txt* %1, %struct.dns_txt** %4
%5 = load %struct.dns_txt*, %struct.dns_txt** %3
%6 = load %struct.dns_txt*, %struct.dns_txt** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.dns_txt = type opaque
define i32 @dns_txt_cmp(%struct.dns_txt* nocapture readnone %0, %struct.dns_txt* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ FileError(char *, char *);
void retyped_warning(char *s) {
  FileError("the type of %s has been redeclared", s);
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"the type of %s has been redeclared\00"
define void @retyped_warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @FileError(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"the type of %s has been redeclared\00"
define void @retyped_warning(i8* %0) {
%2 = tail call i32 @FileError(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GC_free(unsigned char *);
int *get_refcnt(unsigned char *);
void Cyc_Core_drop_refptr(unsigned char *ptr) {
  int *cnt = get_refcnt(ptr);
  if (cnt != NULL) {
    *cnt = *cnt - 1;
    if (*cnt == 0) {
      GC_free(ptr - sizeof(int));
    }
  }
}


x86 assembly (clang, -O0):
<Cyc_Core_drop_refptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_refcnt@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <Cyc_Core_drop_refptr+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    116d <Cyc_Core_drop_refptr+0x4d>
mov    -0x8(%rbp),%rdi
add    $0xfffffffffffffffc,%rdi
call   1040 <GC_free@plt>
jmp    1172 <Cyc_Core_drop_refptr+0x52>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Core_drop_refptr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <get_refcnt@plt>
test   %rax,%rax
je     1133 <Cyc_Core_drop_refptr+0x13>
addl   $0xffffffff,(%rax)
je     1135 <Cyc_Core_drop_refptr+0x15>
pop    %rbx
ret
add    $0xfffffffffffffffc,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <GC_free@plt>

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

LLVM IR (-O2):
define void @Cyc_Core_drop_refptr(i8* %0) {
%2 = tail call i32* @get_refcnt(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 -4
%10 = tail call i32 @GC_free(i8* %9)
br label %11
11: ; preds = %4, %8, %1
ret void
}
int fun1184() { return 1184; }


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

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

LLVM IR (-O0):
define i32 @fun1184() {
ret i32 1184
}

LLVM IR (-O2):
define i32 @fun1184() {
ret i32 1184
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *touch_malloc(int);
char *touch_realloc(char *, int);
int main(void) {
  char *a1, *b1, *a2, *b2;
  printf("started\n");
  a1 = touch_malloc(1600000);
  b1 = touch_malloc(200000);
  a2 = touch_realloc(a1, 1601600);
  b2 = touch_realloc(b1, 200000);
  printf("success\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x186a00,%edi
call   1050 <touch_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x30d40,%edi
call   1050 <touch_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x187040,%esi
call   1040 <touch_realloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x30d40,%esi
call   1040 <touch_realloc@plt>
mov    %rax,-0x28(%rbp)
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x186a00,%edi
call   1050 <touch_malloc@plt>
mov    %rax,%r14
mov    $0x30d40,%edi
call   1050 <touch_malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x187040,%esi
call   1040 <touch_realloc@plt>
mov    %rbx,%rdi
mov    $0x30d40,%esi
call   1040 <touch_realloc@plt>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"started\0A\00"
@.str.1 = [9 x i8] c"success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = call i8* @touch_malloc(i32 1600000)
store i8* %7, i8** %2
%8 = call i8* @touch_malloc(i32 200000)
store i8* %8, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @touch_realloc(i8* %9, i32 1601600)
store i8* %10, i8** %4
%11 = load i8*, i8** %3
%12 = call i8* @touch_realloc(i8* %11, i32 200000)
store i8* %12, i8** %5
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"started\00"
@str.2 = [8 x i8] c"success\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i8* @touch_malloc(i32 1600000)
%3 = tail call i8* @touch_malloc(i32 200000)
%4 = tail call i8* @touch_realloc(i8* %2, i32 1601600)
%5 = tail call i8* @touch_realloc(i8* %3, i32 200000)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int st103_get_rx_count(int);
int usb_lld_rx_data_len(int ep_num) { return st103_get_rx_count(ep_num); }


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

x86 assembly (clang, -O2):
<usb_lld_rx_data_len>:
jmp    1030 <st103_get_rx_count@plt>

LLVM IR (-O0):
define i32 @usb_lld_rx_data_len(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @st103_get_rx_count(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @usb_lld_rx_data_len(i32 %0) {
%2 = tail call i32 @st103_get_rx_count(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ initialize_calendar();
int /*<<< orphan*/ initialize_collator();
int /*<<< orphan*/ initialize_converter();
int /*<<< orphan*/ initialize_ubundle();
int /*<<< orphan*/ initialize_ucore_ext();
int /*<<< orphan*/ initialize_uregexp();
int /*<<< orphan*/ initialize_ustring();
void Init_icu4r(void) {
  initialize_ustring();
  initialize_uregexp();
  initialize_ucore_ext();
  initialize_ubundle();
  initialize_calendar();
  initialize_converter();
  initialize_collator();
}


x86 assembly (clang, -O0):
<Init_icu4r>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1090 <initialize_ustring@plt>
mov    $0x0,%al
call   1040 <initialize_uregexp@plt>
mov    $0x0,%al
call   1030 <initialize_ucore_ext@plt>
mov    $0x0,%al
call   1080 <initialize_ubundle@plt>
mov    $0x0,%al
call   1050 <initialize_calendar@plt>
mov    $0x0,%al
call   1060 <initialize_converter@plt>
mov    $0x0,%al
call   1070 <initialize_collator@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init_icu4r>:
push   %rax
xor    %eax,%eax
call   1090 <initialize_ustring@plt>
xor    %eax,%eax
call   1040 <initialize_uregexp@plt>
xor    %eax,%eax
call   1030 <initialize_ucore_ext@plt>
xor    %eax,%eax
call   1080 <initialize_ubundle@plt>
xor    %eax,%eax
call   1050 <initialize_calendar@plt>
xor    %eax,%eax
call   1060 <initialize_converter@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <initialize_collator@plt>

LLVM IR (-O0):
define void @Init_icu4r() {
%1 = call i32 (...) @initialize_ustring()
%2 = call i32 (...) @initialize_uregexp()
%3 = call i32 (...) @initialize_ucore_ext()
%4 = call i32 (...) @initialize_ubundle()
%5 = call i32 (...) @initialize_calendar()
%6 = call i32 (...) @initialize_converter()
%7 = call i32 (...) @initialize_collator()
ret void
}

LLVM IR (-O2):
define void @Init_icu4r() {
%1 = tail call i32 (...) @initialize_ustring()
%2 = tail call i32 (...) @initialize_uregexp()
%3 = tail call i32 (...) @initialize_ucore_ext()
%4 = tail call i32 (...) @initialize_ubundle()
%5 = tail call i32 (...) @initialize_calendar()
%6 = tail call i32 (...) @initialize_converter()
%7 = tail call i32 (...) @initialize_collator()
ret void
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct buffer *);
void toss(struct buffer *buf) { free(buf); }


x86 assembly (clang, -O0):
<toss>:
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):
<toss>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @toss(%struct.buffer* nocapture %0) {
%2 = tail call i32 @free(%struct.buffer* %0)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
ssize_t send(int sockfd, const void *buf, size_t len, int flags) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2ecf(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* @ENOSYS
store i32 %9, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @send(i32 %0, i8* nocapture readnone %1, i64 %2, i32 %3) {
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}
void keepLinkedListData(void *data) {}


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

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

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

LLVM IR (-O2):
define void @keepLinkedListData(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heap_free_page_frames(void *, int);
void liballoc_free(void *start, int pages) {
  heap_free_page_frames(start, pages);
}


x86 assembly (clang, -O0):
<liballoc_free>:
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 <heap_free_page_frames@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liballoc_free>:
jmp    1030 <heap_free_page_frames@plt>

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

LLVM IR (-O2):
define void @liballoc_free(i8* %0, i32 %1) {
%3 = tail call i32 @heap_free_page_frames(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;
typedef int /*<<< orphan*/ posix_spawn_file_actions_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int __posix_spawnx(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/,
                   int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
                   char *const *, char *const *);
int /*<<< orphan*/ execvp;
int posix_spawnp(pid_t *res, const char *file,
                 const posix_spawn_file_actions_t *fa,
                 const posix_spawnattr_t *attr, char *const argv[],
                 char *const envp[]) {
  return __posix_spawnx(res, file, execvp, fa, attr, argv, envp);
}


x86 assembly (clang, -O0):
<posix_spawnp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <__posix_spawnx@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawnp>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    0x2ebf(%rip),%rdx
mov    (%rdx),%edx
mov    %r9,(%rsp)
mov    %rax,%r9
call   1030 <__posix_spawnx@plt>
pop    %rcx
ret

LLVM IR (-O0):
@execvp = global i32 0
define i32 @posix_spawnp(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8**
%12 = alloca i8**
store i32* %0, i32** %7
store i8* %1, i8** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i8** %4, i8*** %11
store i8** %5, i8*** %12
%13 = load i32*, i32** %7
%14 = load i8*, i8** %8
%15 = load i32, i32* @execvp
%16 = load i32*, i32** %9
%17 = load i32*, i32** %10
%18 = load i8**, i8*** %11
%19 = load i8**, i8*** %12
%20 = call i32 @__posix_spawnx(i32* %13, i8* %14, i32 %15, i32* %16, i32* %17, i8** %18, i8** %19)
ret i32 %20
}

LLVM IR (-O2):
@execvp = global i32 0
define i32 @posix_spawnp(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5) {
%7 = load i32, i32* @execvp
%8 = tail call i32 @__posix_spawnx(i32* %0, i8* %1, i32 %7, i32* %2, i32* %3, i8** %4, i8** %5)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int arr[], int size) {
  for (int i = 0; i < size; i++)
    printf("%d ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int INT_MAX;
int prod(int a, int b) {
  if ((a == INT_MAX) || (b == INT_MAX))
    return INT_MAX;
  else
    return a * b;
}


x86 assembly (clang, -O0):
<prod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed4(%rip),%rcx
cmp    (%rcx),%eax
je     112e <prod+0x2e>
mov    -0xc(%rbp),%eax
mov    0x2ec2(%rip),%rcx
cmp    (%rcx),%eax
jne    113f <prod+0x3f>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <prod+0x49>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prod>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%ecx
mov    %esi,%eax
imul   %edi,%eax
cmp    %esi,%ecx
cmove  %ecx,%eax
cmp    %edi,%ecx
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @prod(i32 %0, i32 %1) {
%3 = load i32, i32* @INT_MAX
%4 = icmp eq i32 %3, %0
%5 = icmp eq i32 %3, %1
%6 = or i1 %4, %5
%7 = mul nsw i32 %1, %0
%8 = select i1 %6, i32 %3, i32 %7
ret i32 %8
}
int test_imm_82uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x82 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_82uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 8519680
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ outw(int, int);
void release_font_access() {
  outw(0x3c4, 0x0100);
  outw(0x3c4, 0x0302);
  outw(0x3c4, 0x0304);
  outw(0x3c4, 0x0300);
  outw(0x3ce, 0x0004);
  outw(0x3ce, 0x1005);
  outw(0x3ce, 0x0e06);
}


x86 assembly (clang, -O0):
<release_font_access>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c4,%edi
mov    $0x100,%esi
call   1030 <outw@plt>
mov    $0x3c4,%edi
mov    $0x302,%esi
call   1030 <outw@plt>
mov    $0x3c4,%edi
mov    $0x304,%esi
call   1030 <outw@plt>
mov    $0x3c4,%edi
mov    $0x300,%esi
call   1030 <outw@plt>
mov    $0x3ce,%edi
mov    $0x4,%esi
call   1030 <outw@plt>
mov    $0x3ce,%edi
mov    $0x1005,%esi
call   1030 <outw@plt>
mov    $0x3ce,%edi
mov    $0xe06,%esi
call   1030 <outw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<release_font_access>:
push   %rax
mov    $0x3c4,%edi
mov    $0x100,%esi
call   1030 <outw@plt>
mov    $0x3c4,%edi
mov    $0x302,%esi
call   1030 <outw@plt>
mov    $0x3c4,%edi
mov    $0x304,%esi
call   1030 <outw@plt>
mov    $0x3c4,%edi
mov    $0x300,%esi
call   1030 <outw@plt>
mov    $0x3ce,%edi
mov    $0x4,%esi
call   1030 <outw@plt>
mov    $0x3ce,%edi
mov    $0x1005,%esi
call   1030 <outw@plt>
mov    $0x3ce,%edi
mov    $0xe06,%esi
pop    %rax
jmp    1030 <outw@plt>

LLVM IR (-O0):
define void @release_font_access() {
%1 = call i32 @outw(i32 964, i32 256)
%2 = call i32 @outw(i32 964, i32 770)
%3 = call i32 @outw(i32 964, i32 772)
%4 = call i32 @outw(i32 964, i32 768)
%5 = call i32 @outw(i32 974, i32 4)
%6 = call i32 @outw(i32 974, i32 4101)
%7 = call i32 @outw(i32 974, i32 3590)
ret void
}

LLVM IR (-O2):
define void @release_font_access() {
%1 = tail call i32 @outw(i32 964, i32 256)
%2 = tail call i32 @outw(i32 964, i32 770)
%3 = tail call i32 @outw(i32 964, i32 772)
%4 = tail call i32 @outw(i32 964, i32 768)
%5 = tail call i32 @outw(i32 974, i32 4)
%6 = tail call i32 @outw(i32 974, i32 4101)
%7 = tail call i32 @outw(i32 974, i32 3590)
ret void
}