xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t l2bEndian(uint32_t num) {
  uint32_t res = 0, b0, b1, b2, b3;
  b0 = (num & 0x000000ff) << 24u;
  b1 = (num & 0x0000ff00) << 8u;
  b2 = (num & 0x00ff0000) >> 8u;
  b3 = (num & 0xff000000) >> 24u;
  res = b0 | b1 | b2 | b3;
  return res;
}


x86 assembly (clang, -O0):
<l2bEndian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
sar    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<l2bEndian>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @l2bEndian(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%8 = load i32, i32* %2
%9 = and i32 %8, 255
%10 = shl i32 %9, 24
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = and i32 %11, 65280
%13 = shl i32 %12, 8
store i32 %13, i32* %5
%14 = load i32, i32* %2
%15 = and i32 %14, 16711680
%16 = ashr i32 %15, 8
store i32 %16, i32* %6
%17 = load i32, i32* %2
%18 = and i32 %17, -16777216
%19 = lshr i32 %18, 24
store i32 %19, i32* %7
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = or i32 %20, %21
%23 = load i32, i32* %6
%24 = or i32 %22, %23
%25 = load i32, i32* %7
%26 = or i32 %24, %25
store i32 %26, i32* %3
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @l2bEndian(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int test_imm_F1uint16_reg(unsigned short val) {
  return ((val) & (0xF1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F1uint16_reg>:
test   $0xf1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F1uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 241
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
void sig(int sig) { printf("child die (%d)\n", getpid()); }


x86 assembly (clang, -O0):
<sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"child die (%d)\0A\00"
define void @sig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"child die (%d)\0A\00"
define void @sig(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
AR0I1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((p0[10000000]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl 0x989680(%rax),%eax
cmp    $0x21,%eax
jg     113e <AR0I1+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <AR0I1+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0I1>:
xor    %eax,%eax
cmpb   $0x22,0x989680(%r8)
22
setl   %al
ret

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

LLVM IR (-O2):
define i32 @AR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = getelementptr inbounds i8, i8* %4, i64 10000000
%8 = load i8, i8* %7
%9 = icmp slt i8 %8, 34
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                   void *(*)(void *), void *);
__attribute__((weak)) int __real_pthread_create(pthread_t *tid,
                                                const pthread_attr_t *attr,
                                                void *(*start)(void *),
                                                void *arg) {
  return pthread_create(tid, attr, start, arg);
}


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

x86 assembly (clang, -O2):
<__real_pthread_create>:
jmp    1030 <pthread_create@plt>

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

LLVM IR (-O2):
define weak i32 @__real_pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = tail call i32 @pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cng_put_pixel(int, int);
int Affiche2(int x, int y) { cng_put_pixel(y, x); }


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

x86 assembly (clang, -O2):
<Affiche2>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <cng_put_pixel@plt>

LLVM IR (-O0):
define i32 @Affiche2(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* %5
%7 = load i32, i32* %4
%8 = call i32 @cng_put_pixel(i32 %6, i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @Affiche2(i32 %0, i32 %1) {
%3 = tail call i32 @cng_put_pixel(i32 %1, i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_flushda(unsigned char *);
void test_flushda(unsigned char *p1, unsigned char *p2) {
  __builtin_flushda(p1);
  __builtin_flushda(p2);
  __builtin_flushda(p2 + 1);
  __builtin_flushda(p2 + 2);
  __builtin_flushda(p2 + 2047);
  __builtin_flushda(p2 + 2048);
}


x86 assembly (clang, -O0):
<test_flushda>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__builtin_flushda@plt>
mov    -0x10(%rbp),%rdi
call   1030 <__builtin_flushda@plt>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <__builtin_flushda@plt>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
call   1030 <__builtin_flushda@plt>
mov    -0x10(%rbp),%rdi
add    $0x7ff,%rdi
call   1030 <__builtin_flushda@plt>
mov    -0x10(%rbp),%rdi
add    $0x800,%rdi
call   1030 <__builtin_flushda@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_flushda>:
push   %rbx
mov    %rsi,%rbx
call   1030 <__builtin_flushda@plt>
mov    %rbx,%rdi
call   1030 <__builtin_flushda@plt>
lea    0x1(%rbx),%rdi
call   1030 <__builtin_flushda@plt>
lea    0x2(%rbx),%rdi
call   1030 <__builtin_flushda@plt>
lea    0x7ff(%rbx),%rdi
call   1030 <__builtin_flushda@plt>
add    $0x800,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__builtin_flushda@plt>

LLVM IR (-O0):
define void @test_flushda(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 = call i32 @__builtin_flushda(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @__builtin_flushda(i8* %7)
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = call i32 @__builtin_flushda(i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = call i32 @__builtin_flushda(i8* %13)
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 2047
%17 = call i32 @__builtin_flushda(i8* %16)
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2048
%20 = call i32 @__builtin_flushda(i8* %19)
ret void
}

LLVM IR (-O2):
define void @test_flushda(i8* %0, i8* %1) {
%3 = tail call i32 @__builtin_flushda(i8* %0)
%4 = tail call i32 @__builtin_flushda(i8* %1)
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = tail call i32 @__builtin_flushda(i8* %5)
%7 = getelementptr inbounds i8, i8* %1, i64 2
%8 = tail call i32 @__builtin_flushda(i8* %7)
%9 = getelementptr inbounds i8, i8* %1, i64 2047
%10 = tail call i32 @__builtin_flushda(i8* %9)
%11 = getelementptr inbounds i8, i8* %1, i64 2048
%12 = tail call i32 @__builtin_flushda(i8* %11)
ret void
}
void INT_TM01(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_TM01() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void hit(void) { say("Ouch, splinters.", 1); }


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Ouch, splinters.\00"
define void @hit() {
%1 = call i32 @say(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Ouch, splinters.\00"
define void @hit() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int ece391_write(int, char *, int);
int write(int file, char *ptr, int len) { return ece391_write(file, ptr, len); }


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ece391_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
jmp    1030 <ece391_write@plt>

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @ece391_write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
int test_imm_D2int8_mem(signed char *val) {
  return ((*val) & (-0xD2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D2int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff2e,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D2int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -210
%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_D2int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -210
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int strncmp(char const *, char const *, size_t);
int CString_strncmp(const char *a, const char *b, size_t n) {
  return strncmp(a, b, n);
}


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

x86 assembly (clang, -O2):
<CString_strncmp>:
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @CString_strncmp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LCD_WriteCommand(int);
void LCD_DisplayOn(void) { LCD_WriteCommand(0x08 | 0x04); }


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

x86 assembly (clang, -O2):
<LCD_DisplayOn>:
mov    $0xc,%edi
jmp    1030 <LCD_WriteCommand@plt>

LLVM IR (-O0):
define void @LCD_DisplayOn() {
%1 = call i32 @LCD_WriteCommand(i32 12)
ret void
}

LLVM IR (-O2):
define void @LCD_DisplayOn() {
%1 = tail call i32 @LCD_WriteCommand(i32 12)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t);
void foo(uint8_t *dest, uint8_t *src, size_t size) { memcpy(dest, src, size); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @foo(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32 @memcpy(i32* %0, i32* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;
struct nlmsg {
  int dummy;
};

/* Variables and functions */
int nla_put(struct nlmsg *, int, int /*<<< orphan*/ *, int);
extern int nla_put_u16(struct nlmsg *nlmsg, int attr, ushort value) {
  return nla_put(nlmsg, attr, &value, 2);
}


x86 assembly (clang, -O0):
<nla_put_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <nla_put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_put_u16>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x2,%ecx
call   1030 <nla_put@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlmsg = type { i32 }
define i32 @nla_put_u16(%struct.nlmsg* %0, i32 %1, i32 %2) {
%4 = alloca %struct.nlmsg*
%5 = alloca i32
%6 = alloca i32
store %struct.nlmsg* %0, %struct.nlmsg** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.nlmsg*, %struct.nlmsg** %4
%8 = load i32, i32* %5
%9 = call i32 @nla_put(%struct.nlmsg* %7, i32 %8, i32* %6, i32 2)
ret i32 %9
}

LLVM IR (-O2):
%struct.nlmsg = type { i32 }
define i32 @nla_put_u16(%struct.nlmsg* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @nla_put(%struct.nlmsg* %0, i32 %1, i32* %4, i32 2)
ret i32 %5
}
void vectorInit(float *vector) {
  vector[0] = 0;
  vector[1] = 0;
  vector[2] = 0;
}


x86 assembly (clang, -O0):
<vectorInit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorInit>:
movq   $0x0,(%rdi)
movl   $0x0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vectorInit(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
ret void
}

LLVM IR (-O2):
define void @vectorInit(float* nocapture writeonly %0) {
store float 0.000000e+00, float* %0
%2 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %2
%3 = getelementptr inbounds float, float* %0, i64 2
store float 0.000000e+00, float* %3
ret void
}
void enterBt5CpeHdPatch(void) {}


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

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

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

LLVM IR (-O2):
define void @enterBt5CpeHdPatch() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bar(unsigned int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  if (bar(1U) != 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <bar@plt>
cmp    $0x1,%eax
je     1159 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <bar@plt>
cmp    $0x1,%eax
jne    1147 <main+0x17>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bar(i32 1)
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 1)
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *);
void free_tracebuffer(char *buffer) {
  if (buffer == NULL) {
    printf("tracebuffer dosen't allocated\r\n");
    return;
  }
  free(buffer);
  return;
}


x86 assembly (clang, -O0):
<free_tracebuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <free_tracebuffer+0x28>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
jmp    1151 <free_tracebuffer+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_tracebuffer>:
test   %rdi,%rdi
je     112a <free_tracebuffer+0xa>
jmp    1030 <free@plt>
lea    0xecf(%rip),%rdi
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"tracebuffer dosen't allocated\0D\0A\00"
define void @free_tracebuffer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"tracebuffer dosen't allocated\0D\00"
define void @free_tracebuffer(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
void caller_1_2_2_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_2_2_1_1_1() {
ret void
}
/* Variables and functions */
int has_trailing_escape(char *s, char *t) {
  return (s == t || *(t - 1) != '\\') ? 0 : !has_trailing_escape(s, t - 1);
}


x86 assembly (clang, -O0):
<has_trailing_escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     113f <has_trailing_escape+0x2f>
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x5c,%eax
je     1149 <has_trailing_escape+0x39>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    116a <has_trailing_escape+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0xffffffffffffffff,%rsi
call   1030 <has_trailing_escape@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_trailing_escape>:
push   %rax
xor    %eax,%eax
cmp    %rsi,%rdi
je     1130 <has_trailing_escape+0x20>
cmpb   $0x5c,-0x1(%rsi)
jne    1130 <has_trailing_escape+0x20>
add    $0xffffffffffffffff,%rsi
call   1030 <has_trailing_escape@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @has_trailing_escape(i8* readnone %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8, i8* %1, i64 -1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 92
br i1 %7, label %10, label %8
8: ; preds = %4, %2, %10
%9 = phi i32 [ %13, %10 ], [ 0, %2 ], [ 0, %4 ]
ret i32 %9
10: ; preds = %4
%11 = tail call i32 @has_trailing_escape(i8* %0, i8* %5)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
br label %8
}
void lsapi_sigpipe(int sig) {}


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

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

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

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

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int fgetc(FILE *fp) { return (getc(fp)); }


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

x86 assembly (clang, -O2):
<fgetc>:
jmp    1030 <getc@plt>

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

LLVM IR (-O2):
define i32 @fgetc(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
ret i32 %2
}
int main() {
  int i = 0, j = 10;
  int sum = 0;
  while (i++ < --j) {
    sum++;
  }
  i = 0;
  j = 10;
  while (i++ < j--) {
    sum++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    %ecx,%eax
jge    114a <main+0x4a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <main+0x20>
movl   $0x0,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0xffffffff,%edx
mov    %edx,-0xc(%rbp)
cmp    %ecx,%eax
jge    1184 <main+0x84>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1158 <main+0x58>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x9,%eax
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
mov    %ecx,%edx
add    $0xffffffff,%eax
lea    0x1(%rdx),%ecx
cmp    %eax,%edx
jb     1110 <main+0x10>
xor    %eax,%eax
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%esi
lea    -0x1(%rsi),%eax
add    $0x9,%esi
lea    0x1(%rdx),%edi
cmp    %esi,%edx
mov    %edi,%edx
jb     1130 <main+0x30>
not    %eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 9, %0 ], [ %5, %1 ]
%3 = phi i32 [ 0, %0 ], [ %4, %1 ]
%4 = add nuw nsw i32 %3, 1
%5 = add nsw i32 %2, -1
%6 = icmp ult i32 %4, %5
br i1 %6, label %1, label %7
7: ; preds = %1, %7
%8 = phi i32 [ %13, %7 ], [ %4, %1 ]
%9 = phi i32 [ %11, %7 ], [ 10, %1 ]
%10 = phi i32 [ %12, %7 ], [ 0, %1 ]
%11 = add nsw i32 %9, -1
%12 = add nuw nsw i32 %10, 1
%13 = add nuw nsw i32 %8, 1
%14 = icmp ult i32 %12, %11
br i1 %14, label %7, label %15
15: ; preds = %7
ret i32 %13
}
/* Variables and functions */
double dadd(double, int /*<<< orphan*/);
int /*<<< orphan*/ ddiv(double, int);
double ConvertLL(double deg, double min, double sec) {
  double res = dadd(dadd(deg, ddiv(min, 60)), ddiv(sec, 3600));
  return res;
}


x86 assembly (clang, -O0):
<ConvertLL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x3c,%edi
call   1040 <ddiv@plt>
movsd  -0x30(%rbp),%xmm0
mov    %eax,%edi
call   1030 <dadd@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0xe10,%edi
call   1040 <ddiv@plt>
movsd  -0x28(%rbp),%xmm0
mov    %eax,%edi
call   1030 <dadd@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertLL>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movaps %xmm1,%xmm0
mov    $0x3c,%edi
call   1040 <ddiv@plt>
movsd  0x8(%rsp),%xmm0
mov    %eax,%edi
call   1030 <dadd@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0xe10,%edi
call   1040 <ddiv@plt>
movsd  0x8(%rsp),%xmm0
mov    %eax,%edi
add    $0x18,%rsp
jmp    1030 <dadd@plt>

LLVM IR (-O0):
define double @ConvertLL(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = call i32 @ddiv(double %9, i32 60)
%11 = call double @dadd(double %8, i32 %10)
%12 = load double, double* %6
%13 = call i32 @ddiv(double %12, i32 3600)
%14 = call double @dadd(double %11, i32 %13)
store double %14, double* %7
%15 = load double, double* %7
ret double %15
}

LLVM IR (-O2):
define double @ConvertLL(double %0, double %1, double %2) {
%4 = tail call i32 @ddiv(double %1, i32 60)
%5 = tail call double @dadd(double %0, i32 %4)
%6 = tail call i32 @ddiv(double %2, i32 3600)
%7 = tail call double @dadd(double %5, i32 %6)
ret double %7
}
/* Variables and functions */
float sin(float);
float SineEaseOut(float p) { return sin(p * 1.57079632679489661923); }


x86 assembly (clang, -O0):
<SineEaseOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SineEaseOut>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define float @SineEaseOut(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x3FF921FB54442D18
%6 = fptrunc double %5 to float
%7 = call float @sin(float %6)
ret float %7
}

LLVM IR (-O2):
define float @SineEaseOut(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x3FF921FB54442D18
%4 = fptrunc double %3 to float
%5 = tail call float @sin(float %4)
ret float %5
}
/* Variables and functions */
scalar_t__ malloc(int);
void GetMemory(char *p) { p = (char *)malloc(100); }


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

x86 assembly (clang, -O2):
<GetMemory>:
mov    $0x64,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @GetMemory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 @malloc(i32 100)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
ret void
}

LLVM IR (-O2):
define void @GetMemory(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 100)
ret void
}
char dce_htoi(char c) {
  if (c >= '0' && c <= '9')
    return c - '0';
  if (c >= 'A' && c <= 'F')
    return c - 'A' + 10;
  return -1;
}


x86 assembly (clang, -O0):
<dce_htoi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <dce_htoi+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <dce_htoi+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1163 <dce_htoi+0x63>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     115f <dce_htoi+0x5f>
movsbl -0x2(%rbp),%eax
cmp    $0x46,%eax
jg     115f <dce_htoi+0x5f>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1163 <dce_htoi+0x63>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dce_htoi>:
lea    -0x30(%rdi),%eax
lea    -0x41(%rdi),%ecx
add    $0xc9,%dil
cmp    $0x6,%cl
movzbl %dil,%ecx
mov    $0xff,%edx
cmovb  %ecx,%edx
cmp    $0xa,%al
movzbl %al,%eax
cmovae %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @dce_htoi(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %31
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 65
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 70
br i1 %23, label %24, label %30
24: ; preds = %20
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 65
%28 = add nsw i32 %27, 10
%29 = trunc i32 %28 to i8
store i8 %29, i8* %2
br label %31
30: ; preds = %20, %16
store i8 -1, i8* %2
br label %31
31: ; preds = %30, %24, %11
%32 = load i8, i8* %2
ret i8 %32
}

LLVM IR (-O2):
define signext i8 @dce_htoi(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 6
%6 = add i8 %0, -55
%7 = select i1 %5, i8 %6, i8 -1
%8 = select i1 %3, i8 %2, i8 %7
ret i8 %8
}
int getBitmapScaledSize(int size, int scale) {
  if (scale >= -1 && scale <= 1)
    return size;
  else if (scale < 0)
    return -(size / scale);
  else
    return size * scale;
}


x86 assembly (clang, -O0):
<getBitmapScaledSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jl     1129 <getBitmapScaledSize+0x29>
cmpl   $0x1,-0xc(%rbp)
jg     1129 <getBitmapScaledSize+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <getBitmapScaledSize+0x52>
cmpl   $0x0,-0xc(%rbp)
jge    1148 <getBitmapScaledSize+0x48>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <getBitmapScaledSize+0x52>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBitmapScaledSize>:
mov    %edi,%eax
lea    0x1(%rsi),%ecx
cmp    $0x3,%ecx
jb     1113 <getBitmapScaledSize+0x13>
test   %esi,%esi
js     1114 <getBitmapScaledSize+0x14>
imul   %eax,%esi
mov    %esi,%eax
ret
cltd
idiv   %esi
neg    %eax
ret

LLVM IR (-O0):
define i32 @getBitmapScaledSize(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* %5
%7 = icmp sge i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = load i32, i32* %4
store i32 %12, i32* %3
br label %25
13: ; preds = %8, %2
%14 = load i32, i32* %5
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = sdiv i32 %17, %18
%20 = sub nsw i32 0, %19
store i32 %20, i32* %3
br label %25
21: ; preds = %13
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = mul nsw i32 %22, %23
store i32 %24, i32* %3
br label %25
25: ; preds = %21, %16, %11
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @getBitmapScaledSize(i32 %0, i32 %1) {
%3 = add i32 %1, 1
%4 = icmp ult i32 %3, 3
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = icmp slt i32 %1, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = sdiv i32 %0, %1
%9 = sub nsw i32 0, %8
br label %12
10: ; preds = %5
%11 = mul nsw i32 %1, %0
br label %12
12: ; preds = %2, %10, %7
%13 = phi i32 [ %9, %7 ], [ %11, %10 ], [ %0, %2 ]
ret i32 %13
}
int CompareDates(int Date_1, int Date_2) {
  if (Date_1 > Date_2)
    return 1;
  if (Date_1 == Date_2)
    return 0;
  if (Date_1 < Date_2)
    return -1;
}


x86 assembly (clang, -O0):
<CompareDates>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1122 <CompareDates+0x22>
movl   $0x1,-0x4(%rbp)
jmp    114d <CompareDates+0x4d>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    113a <CompareDates+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    114d <CompareDates+0x4d>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114d <CompareDates+0x4d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompareDates>:
xor    %ecx,%ecx
cmp    %esi,%edi
setne  %cl
neg    %ecx
cmp    %esi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @CompareDates(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* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %20
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 0, i32* %3
br label %20
15: ; preds = %10
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 -1, i32* %3
br label %20
20: ; preds = %9, %14, %19, %15
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @CompareDates(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = icmp ne i32 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char *, int);
int is_cue_url(const char *name) { return strncmp(name, "cue://", 6) == 0; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"cue://\00"
define i32 @is_cue_url(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xd5() {
  Assert_real((islower(213) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              1070, ("islower should be 0 for 0xd5"));
}


x86 assembly (clang, -O0):
<t_islower_0xd5>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd5,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x42e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xd5>:
push   %rax
mov    $0xd5,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x42e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xd5\00"
define void @t_islower_0xd5() {
%1 = call i64 @islower(i32 213)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1070, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xd5\00"
define void @t_islower_0xd5() {
%1 = tail call i64 @islower(i32 213)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1070, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mod_test(int);
void main() {
  int a;
  mod_test(7);
  return;
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = call i32 @mod_test(i32 7)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @mod_test(i32 7)
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
unsigned int CLOCKS_PER_SEC;
scalar_t__ clock();
void delay(unsigned int msec) {
  clock_t start_tick = clock();
  clock_t end_tick = start_tick + msec * CLOCKS_PER_SEC / 1000;
  while (clock() < end_tick) {
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb0(%rip),%rcx
imul   (%rcx),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
cmp    -0x18(%rbp),%rax
jge    1169 <delay+0x59>
jmp    1153 <delay+0x43>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <clock@plt>
mov    0x2ec7(%rip),%rcx
imul   (%rcx),%ebx
imul   $0x10624dd3,%rbx,%rbx
shr    $0x26,%rbx
add    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <clock@plt>
cmp    %rbx,%rax
jl     1140 <delay+0x30>
pop    %rbx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
%5 = call i64 (...) @clock()
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @CLOCKS_PER_SEC
%9 = mul i32 %7, %8
%10 = udiv i32 %9, 1000
%11 = zext i32 %10 to i64
%12 = add nsw i64 %6, %11
store i64 %12, i64* %4
br label %13
13: ; preds = %17, %1
%14 = call i64 (...) @clock()
%15 = load i64, i64* %4
%16 = icmp slt i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
br label %13
18: ; preds = %13
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define void @delay(i32 %0) {
%2 = tail call i64 (...) @clock()
%3 = load i32, i32* @CLOCKS_PER_SEC
%4 = mul i32 %3, %0
%5 = udiv i32 %4, 1000
%6 = zext i32 %5 to i64
%7 = add nsw i64 %2, %6
br label %8
8: ; preds = %8, %1
%9 = tail call i64 (...) @clock()
%10 = icmp slt i64 %9, %7
br i1 %10, label %8, label %11
11: ; preds = %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EVIOCGRAB;
int ioctl(int, int /*<<< orphan*/, void *);
int test_grab(int fd) {
  int rc;
  rc = ioctl(fd, EVIOCGRAB, (void *)1);
  if (!rc)
    ioctl(fd, EVIOCGRAB, (void *)0);
  return rc;
}


x86 assembly (clang, -O0):
<test_grab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
call   1030 <ioctl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1153 <test_grab+0x43>
mov    -0x4(%rbp),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_grab>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ecb(%rip),%r14
mov    (%r14),%esi
mov    $0x1,%edx
call   1030 <ioctl@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    113c <test_grab+0x2c>
mov    (%r14),%esi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <ioctl@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EVIOCGRAB = global i32 0
define i32 @test_grab(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @EVIOCGRAB
%6 = call i32 @ioctl(i32 %4, i32 %5, i8* inttoptr (i64 1 to i8*))
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = load i32, i32* %2
%11 = load i32, i32* @EVIOCGRAB
%12 = call i32 @ioctl(i32 %10, i32 %11, i8* null)
br label %13
13: ; preds = %9, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@EVIOCGRAB = global i32 0
define i32 @test_grab(i32 %0) {
%2 = load i32, i32* @EVIOCGRAB
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i8* inttoptr (i64 1 to i8*))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @EVIOCGRAB
%7 = tail call i32 @ioctl(i32 %0, i32 %6, i8* null)
br label %8
8: ; preds = %5, %1
ret i32 %3
}
int main(void) {
  int j = "hello";
  int jj = {'h', 'e', 'l', 'l'};
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %eax,-0x8(%rbp)
movl   $0x68,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 ptrtoint ([6 x i8]* @.str to i32), i32* %2
store i32 104, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ teardown_MBC();
void teardown_memory() { teardown_MBC(); }


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

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

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

LLVM IR (-O2):
define void @teardown_memory() {
%1 = tail call i32 (...) @teardown_MBC()
ret void
}