xunge/DecIR huggingface dataset:
/* Variables and functions */
int fchmodat(int /*<<< orphan*/, char *, int /*<<< orphan*/,
             int /*<<< orphan*/);
int main(void) { return fchmodat(0, "", 0, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %ecx,%ecx
lea    0xed8(%rip),%rsi
mov    %ecx,%edi
mov    %ecx,%edx
call   1030 <fchmodat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <fchmodat@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fchmodat(i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret i32 %2
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @fchmodat(i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret i32 %1
}
int remote_init(void *dumm) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @remote_init(i8* nocapture readnone %0) {
ret i32 0
}
int compare(const void *arg1, const void *arg2) {
  return (*(int *)arg1 > *(int *)arg2);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setg   %al
ret

LLVM IR (-O0):
define i32 @compare(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ api_end();
int /*<<< orphan*/ api_putchar(char);
void HariMain(void) {
  api_putchar('h');
  api_putchar('e');
  api_putchar('l');
  api_putchar('l');
  api_putchar('o');
  api_end();
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x68,%edi
call   1040 <api_putchar@plt>
mov    $0x65,%edi
call   1040 <api_putchar@plt>
mov    $0x6c,%edi
call   1040 <api_putchar@plt>
mov    $0x6c,%edi
call   1040 <api_putchar@plt>
mov    $0x6f,%edi
call   1040 <api_putchar@plt>
mov    $0x0,%al
call   1030 <api_end@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
mov    $0x68,%edi
call   1040 <api_putchar@plt>
mov    $0x65,%edi
call   1040 <api_putchar@plt>
mov    $0x6c,%edi
call   1040 <api_putchar@plt>
mov    $0x6c,%edi
call   1040 <api_putchar@plt>
mov    $0x6f,%edi
call   1040 <api_putchar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <api_end@plt>

LLVM IR (-O0):
define void @HariMain() {
%1 = call i32 @api_putchar(i8 signext 104)
%2 = call i32 @api_putchar(i8 signext 101)
%3 = call i32 @api_putchar(i8 signext 108)
%4 = call i32 @api_putchar(i8 signext 108)
%5 = call i32 @api_putchar(i8 signext 111)
%6 = call i32 (...) @api_end()
ret void
}

LLVM IR (-O2):
define void @HariMain() {
%1 = tail call i32 @api_putchar(i8 signext 104)
%2 = tail call i32 @api_putchar(i8 signext 101)
%3 = tail call i32 @api_putchar(i8 signext 108)
%4 = tail call i32 @api_putchar(i8 signext 108)
%5 = tail call i32 @api_putchar(i8 signext 111)
%6 = tail call i32 (...) @api_end()
ret void
}
int dm_int_to_bcd(int i) { return ((i / 10) << 4) | (i % 10); }


x86 assembly (clang, -O0):
<dm_int_to_bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
or     %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dm_int_to_bcd>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @dm_int_to_bcd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = shl i32 %4, 4
%6 = load i32, i32* %2
%7 = srem i32 %6, 10
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @dm_int_to_bcd(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = shl i32 %2, 4
%4 = srem i32 %0, 10
%5 = or i32 %3, %4
ret i32 %5
}
void hw_detect_device_model(void) {}


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

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

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

LLVM IR (-O2):
define void @hw_detect_device_model() {
ret void
}
void GrOffScreen16BPPPixelDraw(void *pvDisplayData, int lX, int lY,
                               unsigned int ulValue) {
  unsigned char *pucData;
  int lBytesPerRow;
  ;
  pucData = (unsigned char *)pvDisplayData;
  lBytesPerRow = (*(unsigned short *)(pucData)) * 2;
  pucData += (lBytesPerRow * lY) + (lX * 2) + 4 + (16 * 2);
  *(unsigned short *)pucData = ulValue & 0xFFFF;
}


x86 assembly (clang, -O0):
<GrOffScreen16BPPPixelDraw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movzwl (%rax),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
imul   -0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    %eax,%ecx
add    $0x4,%ecx
add    $0x20,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
and    $0xffff,%eax
mov    %ax,%cx
mov    -0x20(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GrOffScreen16BPPPixelDraw>:
movzwl (%rdi),%eax
imul   %edx,%eax
add    %esi,%eax
add    %eax,%eax
add    $0x24,%eax
cltq
mov    %cx,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @GrOffScreen16BPPPixelDraw(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i8*, i8** %5
store i8* %11, i8** %9
%12 = load i8*, i8** %9
%13 = bitcast i8* %12 to i16*
%14 = load i16, i16* %13
%15 = zext i16 %14 to i32
%16 = mul nsw i32 %15, 2
store i32 %16, i32* %10
%17 = load i32, i32* %10
%18 = load i32, i32* %7
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %6
%21 = mul nsw i32 %20, 2
%22 = add nsw i32 %19, %21
%23 = add nsw i32 %22, 4
%24 = add nsw i32 %23, 32
%25 = load i8*, i8** %9
%26 = sext i32 %24 to i64
%27 = getelementptr inbounds i8, i8* %25, i64 %26
store i8* %27, i8** %9
%28 = load i32, i32* %8
%29 = and i32 %28, 65535
%30 = trunc i32 %29 to i16
%31 = load i8*, i8** %9
%32 = bitcast i8* %31 to i16*
store i16 %30, i16* %32
ret void
}

LLVM IR (-O2):
define void @GrOffScreen16BPPPixelDraw(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = bitcast i8* %0 to i16*
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
%8 = mul i32 %7, %2
%9 = add i32 %8, %1
%10 = shl i32 %9, 1
%11 = add i32 %10, 36
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = trunc i32 %3 to i16
%15 = bitcast i8* %13 to i16*
store i16 %14, i16* %15
ret void
}
/* Type definitions */
struct snd_kcontrol {
  int dummy;
};

/* Variables and functions */
int _snd_ctl_add_slave(struct snd_kcontrol *, struct snd_kcontrol *,
                       int /*<<< orphan*/);
int snd_ctl_add_slave(void *_master, struct snd_kcontrol *slave) {
  struct snd_kcontrol *master = _master;
  return _snd_ctl_add_slave(master, slave, 0);
}


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

x86 assembly (clang, -O2):
<snd_ctl_add_slave>:
xor    %edx,%edx
jmp    1030 <_snd_ctl_add_slave@plt>

LLVM IR (-O0):
%struct.snd_kcontrol = type { i32 }
define i32 @snd_ctl_add_slave(i8* %0, %struct.snd_kcontrol* %1) {
%3 = alloca i8*
%4 = alloca %struct.snd_kcontrol*
%5 = alloca %struct.snd_kcontrol*
store i8* %0, i8** %3
store %struct.snd_kcontrol* %1, %struct.snd_kcontrol** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.snd_kcontrol*
store %struct.snd_kcontrol* %7, %struct.snd_kcontrol** %5
%8 = load %struct.snd_kcontrol*, %struct.snd_kcontrol** %5
%9 = load %struct.snd_kcontrol*, %struct.snd_kcontrol** %4
%10 = call i32 @_snd_ctl_add_slave(%struct.snd_kcontrol* %8, %struct.snd_kcontrol* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.snd_kcontrol = type { i32 }
define i32 @snd_ctl_add_slave(i8* %0, %struct.snd_kcontrol* %1) {
%3 = bitcast i8* %0 to %struct.snd_kcontrol*
%4 = tail call i32 @_snd_ctl_add_slave(%struct.snd_kcontrol* %3, %struct.snd_kcontrol* %1, i32 0)
ret i32 %4
}
int main(void) {
  static int static_var = 100;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@main.static_var = internal global i32 100
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  long long tv_usec;
};

/* Variables and functions */
long long int to_usec(struct timeval t) {
  return t.tv_sec * 1000000LL + t.tv_usec;
}


x86 assembly (clang, -O0):
<to_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
imul   $0xf4240,-0x10(%rbp),%rax
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_usec>:
imul   $0xf4240,%rdi,%rax
add    %rsi,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @to_usec(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%11 = load i64, i64* %10
%12 = add nsw i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @to_usec(i64 %0, i64 %1) {
%3 = mul nsw i64 %0, 1000000
%4 = add nsw i64 %3, %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PSRAQ_imm(int dst_reg, int amount) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x73);
  addbyte(0xc0 | dst_reg | 0x20);
  addbyte(amount);
}


x86 assembly (clang, -O0):
<MMX_PSRAQ_imm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x73,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
or     $0x20,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PSRAQ_imm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x73,%edi
call   1030 <addbyte@plt>
or     $0xe0,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PSRAQ_imm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 115)
%8 = load i32, i32* %3
%9 = or i32 192, %8
%10 = or i32 %9, 32
%11 = call i32 @addbyte(i32 %10)
%12 = load i32, i32* %4
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_PSRAQ_imm(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 115)
%6 = or i32 %0, 224
%7 = tail call i32 @addbyte(i32 %6)
%8 = tail call i32 @addbyte(i32 %1)
ret void
}
unsigned int get2l(const unsigned char *attr, int p) {
  int i;
  unsigned int v;
  v = 0;
  for (i = 0; i < 2; i++)
    v += (attr[p + i] & 255) << (8 * i);
  return (v);
}


x86 assembly (clang, -O0):
<get2l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1155 <get2l+0x55>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
and    $0xff,%eax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <get2l+0x19>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get2l>:
movslq %esi,%rax
movzwl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @get2l(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %25, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %28
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = add nsw i32 %12, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = and i32 %18, 255
%20 = load i32, i32* %5
%21 = mul nsw i32 8, %20
%22 = shl i32 %19, %21
%23 = load i32, i32* %6
%24 = add i32 %23, %22
store i32 %24, i32* %6
br label %25
25: ; preds = %10
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %7
28: ; preds = %7
%29 = load i32, i32* %6
ret i32 %29
}

LLVM IR (-O2):
define i32 @get2l(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = add nsw i64 %3, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl nuw nsw i32 %10, 8
%12 = or i32 %11, %6
ret i32 %12
}
int test_imm_96uint8_mem(unsigned char *val) {
  return ((*val) & (-0x96 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_96uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 106
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void *UserPtr_GetEndPtr(void *ptr) {
  return (((char *)ptr) + UserPtr_GetUserPtrSize(ptr));
}


x86 assembly (clang, -O0):
<UserPtr_GetEndPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <UserPtr_GetUserPtrSize@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UserPtr_GetEndPtr>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <UserPtr_GetUserPtrSize@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @UserPtr_GetEndPtr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @UserPtr_GetUserPtrSize to i32 (i8*, ...)*)(i8* %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @UserPtr_GetEndPtr(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @UserPtr_GetUserPtrSize to i32 (i8*, ...)*)(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
void LOS_EvbUartWriteStr(const char *str) { return; }


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

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

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

LLVM IR (-O2):
define void @LOS_EvbUartWriteStr(i8* nocapture %0) {
ret void
}
void CClinkern_flipper_free_world(void) { return; }


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

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

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

LLVM IR (-O2):
define void @CClinkern_flipper_free_world() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
size_t lseek(int, long, int /*<<< orphan*/);
int open(char const *, int /*<<< orphan*/);
size_t fileSizeFromName(const char *path) {
  int fd = open(path, O_RDONLY);
  size_t sz = lseek(fd, 0L, SEEK_END);
  lseek(fd, 0L, SEEK_SET);
  close(fd);
  return sz;
}


x86 assembly (clang, -O0):
<fileSizeFromName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <lseek@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2e5c(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <lseek@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileSizeFromName>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebx
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %rax,%r14
mov    0x2e70(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fileSizeFromName(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* @SEEK_END
%10 = call i64 @lseek(i32 %8, i64 0, i32 %9)
store i64 %10, i64* %4
%11 = load i32, i32* %3
%12 = load i32, i32* @SEEK_SET
%13 = call i64 @lseek(i32 %11, i64 0, i32 %12)
%14 = load i32, i32* %3
%15 = call i32 @close(i32 %14)
%16 = load i64, i64* %4
ret i64 %16
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fileSizeFromName(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = load i32, i32* @SEEK_END
%5 = tail call i64 @lseek(i32 %3, i64 0, i32 %4)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i64 @lseek(i32 %3, i64 0, i32 %6)
%8 = tail call i32 @close(i32 %3)
ret i64 %5
}
void main(void) {
  int q[3];
  int j;
  q[2] = j + 4;
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca [3 x i32]
%2 = alloca i32
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 4
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
store i32 %4, i32* %5
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
void my_putstr(char *str) {
  if (str[0]) {
    my_putchar(str[0]);
    my_putstr(str + 1);
  }
  return;
}


x86 assembly (clang, -O0):
<my_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <my_putstr+0x32>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <my_putchar@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <my_putstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <my_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <my_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <my_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @my_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @my_putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strscpy(char *dest, const char *src, size_t size) {
  if (dest == NULL || src == NULL || size == 0) {
    return dest;
  }
  strncpy(dest, src, size - 1);
  dest[size - 1] = 0;
  return dest;
}


x86 assembly (clang, -O0):
<strscpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <strscpy+0x35>
cmpq   $0x0,-0x18(%rbp)
je     1145 <strscpy+0x35>
cmpq   $0x0,-0x20(%rbp)
jne    1152 <strscpy+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <strscpy+0x6f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strscpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rdi,%rdi
je     113b <strscpy+0x2b>
test   %rsi,%rsi
je     113b <strscpy+0x2b>
mov    %rdx,%r14
test   %rdx,%rdx
je     113b <strscpy+0x2b>
lea    -0x1(%r14),%rdx
mov    %rbx,%rdi
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strscpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %16, label %10
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = icmp eq i8* %11, null
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i64, i64* %7
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13, %10, %3
%17 = load i8*, i8** %5
store i8* %17, i8** %4
br label %29
18: ; preds = %13
%19 = load i8*, i8** %5
%20 = load i8*, i8** %6
%21 = load i64, i64* %7
%22 = sub i64 %21, 1
%23 = call i32 @strncpy(i8* %19, i8* %20, i64 %22)
%24 = load i8*, i8** %5
%25 = load i64, i64* %7
%26 = sub i64 %25, 1
%27 = getelementptr inbounds i8, i8* %24, i64 %26
store i8 0, i8* %27
%28 = load i8*, i8** %5
store i8* %28, i8** %4
br label %29
29: ; preds = %18, %16
%30 = load i8*, i8** %4
ret i8* %30
}

LLVM IR (-O2):
define i8* @strscpy(i8* returned %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i8* %1, null
%6 = or i1 %4, %5
%7 = icmp eq i64 %2, 0
%8 = or i1 %6, %7
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = add i64 %2, -1
%11 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %10)
%12 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 0, i8* %12
br label %13
13: ; preds = %3, %9
ret i8* %0
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_lerp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *, float);
__attribute__((always_)) struct vec2i *
psvec2i_lerp(struct vec2i *result, struct vec2i *a, struct vec2i *b, float p) {
  vec2i_lerp((int32_t *)result, (int32_t *)a, (int32_t *)b, p);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec2i_lerp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2i_lerp@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_lerp(%struct.vec2i* %0, %struct.vec2i* %1, %struct.vec2i* %2, float %3) {
%5 = alloca %struct.vec2i*
%6 = alloca %struct.vec2i*
%7 = alloca %struct.vec2i*
%8 = alloca float
store %struct.vec2i* %0, %struct.vec2i** %5
store %struct.vec2i* %1, %struct.vec2i** %6
store %struct.vec2i* %2, %struct.vec2i** %7
store float %3, float* %8
%9 = load %struct.vec2i*, %struct.vec2i** %5
%10 = bitcast %struct.vec2i* %9 to i32*
%11 = load %struct.vec2i*, %struct.vec2i** %6
%12 = bitcast %struct.vec2i* %11 to i32*
%13 = load %struct.vec2i*, %struct.vec2i** %7
%14 = bitcast %struct.vec2i* %13 to i32*
%15 = load float, float* %8
%16 = call i32 @vec2i_lerp(i32* %10, i32* %12, i32* %14, float %15)
%17 = load %struct.vec2i*, %struct.vec2i** %5
ret %struct.vec2i* %17
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_lerp(%struct.vec2i* returned %0, %struct.vec2i* %1, %struct.vec2i* %2, float %3) {
%5 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%6 = getelementptr %struct.vec2i, %struct.vec2i* %1, i64 0, i32 0
%7 = getelementptr %struct.vec2i, %struct.vec2i* %2, i64 0, i32 0
%8 = tail call i32 @vec2i_lerp(i32* %5, i32* %6, i32* %7, float %3)
ret %struct.vec2i* %0
}
int printArray(int arr[], int n) {
  int i = 0, l;
  l = arr[0];
  while (arr[i] == l)
    i++;
  return (i - 1);
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    113d <printArray+0x3d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111b <printArray+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
mov    (%rdi),%ecx
add    $0x4,%rdi
mov    $0xffffffff,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
lea    0x4(%rdi),%rdx
cmp    %ecx,(%rdi)
mov    %rdx,%rdi
je     1110 <printArray+0x10>
ret

LLVM IR (-O0):
define i32 @printArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
store i32 %9, i32* %6
br label %10
10: ; preds = %18, %2
%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 = load i32, i32* %6
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %10
21: ; preds = %10
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 1
ret i32 %23
}

LLVM IR (-O2):
define i32 @printArray(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
br label %4
4: ; preds = %2, %4
%5 = phi i64 [ 1, %2 ], [ %9, %4 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, %3
%9 = add nuw i64 %5, 1
br i1 %8, label %4, label %10
10: ; preds = %4
%11 = trunc i64 %5 to i32
%12 = add nsw i32 %11, -1
ret i32 %12
}
void foo_2_2_2_1_1_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_1_2_2_2_2() {
ret void
}
/* Variables and functions */
long INT_MAX;
double __ocml_scalb_f64(double, long);
double __ocml_scalbn_f64(double, long);
double scalbln(double x, long int n) {
  return (n < INT_MAX) ? __ocml_scalbn_f64(x, n) : __ocml_scalb_f64(x, n);
}


x86 assembly (clang, -O0):
<scalbln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%rax
jge    115d <scalbln+0x3d>
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1040 <__ocml_scalbn_f64@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    1170 <scalbln+0x50>
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <__ocml_scalb_f64@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalbln>:
mov    0x2ec1(%rip),%rax
cmp    %rdi,(%rax)
jle    1131 <scalbln+0x11>
jmp    1040 <__ocml_scalbn_f64@plt>
jmp    1030 <__ocml_scalb_f64@plt>

LLVM IR (-O0):
@INT_MAX = global i64 0
define double @scalbln(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* @INT_MAX
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double, double* %3
%10 = load i64, i64* %4
%11 = call double @__ocml_scalbn_f64(double %9, i64 %10)
br label %16
12: ; preds = %2
%13 = load double, double* %3
%14 = load i64, i64* %4
%15 = call double @__ocml_scalb_f64(double %13, i64 %14)
br label %16
16: ; preds = %12, %8
%17 = phi double [ %11, %8 ], [ %15, %12 ]
ret double %17
}

LLVM IR (-O2):
@INT_MAX = global i64 0
define double @scalbln(double %0, i64 %1) {
%3 = load i64, i64* @INT_MAX
%4 = icmp sgt i64 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call double @__ocml_scalbn_f64(double %0, i64 %1)
br label %9
7: ; preds = %2
%8 = tail call double @__ocml_scalb_f64(double %0, i64 %1)
br label %9
9: ; preds = %7, %5
%10 = phi double [ %6, %5 ], [ %8, %7 ]
ret double %10
}
unsigned short half_from_float_slow(float f_) {
  unsigned f = *(unsigned *)&f_;
  return ((f >> 16) & 0x8000) |
         ((((f & 0x7f800000) - 0x38000000) >> 13) & 0x7c00) |
         ((f >> 13) & 0x03ff);
}


x86 assembly (clang, -O0):
<half_from_float_slow>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
and    $0x8000,%eax
mov    -0x8(%rbp),%ecx
and    $0x7f800000,%ecx
sub    $0x38000000,%ecx
shr    $0xd,%ecx
and    $0x7c00,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
shr    $0xd,%ecx
and    $0x3ff,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<half_from_float_slow>:
movd   %xmm0,%eax
mov    %eax,%ecx
shr    $0x10,%ecx
and    $0x8000,%ecx
mov    %eax,%edx
and    $0xf800000,%edx
add    $0x8000000,%edx
shr    $0xd,%edx
and    $0x7c00,%edx
shr    $0xd,%eax
and    $0x3ff,%eax
or     %ecx,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @half_from_float_slow(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = bitcast float* %2 to i32*
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = lshr i32 %6, 16
%8 = and i32 %7, 32768
%9 = load i32, i32* %3
%10 = and i32 %9, 2139095040
%11 = sub i32 %10, 939524096
%12 = lshr i32 %11, 13
%13 = and i32 %12, 31744
%14 = or i32 %8, %13
%15 = load i32, i32* %3
%16 = lshr i32 %15, 13
%17 = and i32 %16, 1023
%18 = or i32 %14, %17
%19 = trunc i32 %18 to i16
ret i16 %19
}

LLVM IR (-O2):
define zeroext i16 @half_from_float_slow(float %0) {
%2 = bitcast float %0 to i32
%3 = lshr i32 %2, 16
%4 = and i32 %3, 32768
%5 = and i32 %2, 260046848
%6 = add nuw nsw i32 %5, 134217728
%7 = lshr exact i32 %6, 13
%8 = and i32 %7, 31744
%9 = lshr i32 %2, 13
%10 = and i32 %9, 1023
%11 = or i32 %10, %4
%12 = or i32 %11, %8
%13 = trunc i32 %12 to i16
ret i16 %13
}
__attribute__((__unused__)) int
psnip_clock_monotonic_get_time(struct PsnipClockTimespec *res) {
  (void)res;
  return -2;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.PsnipClockTimespec = type opaque
define i32 @psnip_clock_monotonic_get_time(%struct.PsnipClockTimespec* %0) {
%2 = alloca %struct.PsnipClockTimespec*
store %struct.PsnipClockTimespec* %0, %struct.PsnipClockTimespec** %2
%3 = load %struct.PsnipClockTimespec*, %struct.PsnipClockTimespec** %2
ret i32 -2
}

LLVM IR (-O2):
%struct.PsnipClockTimespec = type opaque
define i32 @psnip_clock_monotonic_get_time(%struct.PsnipClockTimespec* nocapture readnone %0) {
ret i32 -2
}
/* Variables and functions */
int /*<<< orphan*/ wsky_GC_initImpl(int *);
void wsky_GC_init(void) {
  int n;
  wsky_GC_initImpl(&n);
}


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

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

LLVM IR (-O0):
define void @wsky_GC_init() {
%1 = alloca i32
%2 = call i32 @wsky_GC_initImpl(i32* %1)
ret void
}

LLVM IR (-O2):
define void @wsky_GC_init() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @wsky_GC_initImpl(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LUCroutDecompose(int, double *, double *, double *);
extern void LUDec(int n, double *A, double *L, double *U) {
  LUCroutDecompose(n, A, L, U);
  return;
}


x86 assembly (clang, -O0):
<LUDec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <LUCroutDecompose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LUDec>:
jmp    1030 <LUCroutDecompose@plt>

LLVM IR (-O0):
define void @LUDec(i32 %0, double* %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load i32, i32* %5
%10 = load double*, double** %6
%11 = load double*, double** %7
%12 = load double*, double** %8
%13 = call i32 @LUCroutDecompose(i32 %9, double* %10, double* %11, double* %12)
ret void
}

LLVM IR (-O2):
define void @LUDec(i32 %0, double* %1, double* %2, double* %3) {
%5 = tail call i32 @LUCroutDecompose(i32 %0, double* %1, double* %2, double* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf("dcbumpgen - Dreamcast bumpmap generator v0.1\n");
  printf("Copyright (c) 2005 Fredrik Ehnbom\n");
  printf("usage: dcbumpgen <infile.png/.jpg> <outfile.raw>\n");
}


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

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"dcbumpgen - Dreamcast bumpmap generator v0.1\0A\00"
@.str.1 = [35 x i8] c"Copyright (c) 2005 Fredrik Ehnbom\0A\00"
@.str.2 = [50 x i8] c"usage: dcbumpgen <infile.png/.jpg> <outfile.raw>\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"dcbumpgen - Dreamcast bumpmap generator v0.1\00"
@str.3 = [34 x i8] c"Copyright (c) 2005 Fredrik Ehnbom\00"
@str.4 = [49 x i8] c"usage: dcbumpgen <infile.png/.jpg> <outfile.raw>\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.4, i64 0, i64 0))
ret void
}
int test_imm_B9uint16_mem(unsigned short *val) {
  return ((*val) & (0xB9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B9uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 185
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_add(int /*<<< orphan*/, int);
int /*<<< orphan*/ arm_data_imm_op();
void arm_adc_imm() { arm_arith_add(arm_data_imm_op(), 1); }


x86 assembly (clang, -O0):
<arm_adc_imm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_data_imm_op@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <arm_arith_add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_adc_imm>:
push   %rax
xor    %eax,%eax
call   1030 <arm_data_imm_op@plt>
mov    %eax,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <arm_arith_add@plt>

LLVM IR (-O0):
define void @arm_adc_imm() {
%1 = call i32 (...) @arm_data_imm_op()
%2 = call i32 @arm_arith_add(i32 %1, i32 1)
ret void
}

LLVM IR (-O2):
define void @arm_adc_imm() {
%1 = tail call i32 (...) @arm_data_imm_op()
%2 = tail call i32 @arm_arith_add(i32 %1, i32 1)
ret void
}
const char *tilt3d_version(void) {
  return ("tilt3d : Peter Boesecke V1.11 2011-06-16");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"tilt3d : Peter Boesecke V1.11 2011-06-16\00"
define i8* @tilt3d_version() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [41 x i8] c"tilt3d : Peter Boesecke V1.11 2011-06-16\00"
define i8* @tilt3d_version() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}
void __Init_Argv(void) {}


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

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

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

LLVM IR (-O2):
define void @__Init_Argv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  printf("%zd\n", strlen(argv[0]));
  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)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1030 <strlen@plt>
lea    0xed0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%zd\0A\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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%zd\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @strlen(i8* %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, unsigned int, int);
int bb_serial_invert(int pi, unsigned user_gpio, unsigned invert) {
  return pigpio_command(pi, 94, user_gpio, invert, 1);
}


x86 assembly (clang, -O0):
<bb_serial_invert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x5e,%esi
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb_serial_invert>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x5e,%esi
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @bb_serial_invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @pigpio_command(i32 %7, i32 94, i32 %8, i32 %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @bb_serial_invert(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pigpio_command(i32 %0, i32 94, i32 %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glutMainLoop();
int /*<<< orphan*/ initGL();
int /*<<< orphan*/ initGLUT(int *, char **);
int main(int argc, char **argv) {
  initGLUT(&argc, argv);
  initGL();
  glutMainLoop();
  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)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1030 <initGLUT@plt>
mov    $0x0,%al
call   1050 <initGL@plt>
mov    $0x0,%al
call   1040 <glutMainLoop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <initGLUT@plt>
xor    %eax,%eax
call   1050 <initGL@plt>
xor    %eax,%eax
call   1040 <glutMainLoop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = call i32 @initGLUT(i32* %4, i8** %6)
%8 = call i32 (...) @initGL()
%9 = call i32 (...) @glutMainLoop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @initGLUT(i32* %3, i8** %1)
%5 = call i32 (...) @initGL()
%6 = call i32 (...) @glutMainLoop()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  int x;
  for (x = 0; x <= 5; x++) {
    puts("Hello world");
  }
  return 0;
}


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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jg     1151 <main+0x41>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %6
%9 = icmp sle i32 %8, 5
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
br label %7
15: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}