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

/* Variables and functions */
int /*<<< orphan*/ LittleEndianReadU32(int /*<<< orphan*/ const *);
float LittleEndianReadF32(const uint8_t *bytes) {
  union {
    float f32;
    uint32_t u32;
  } u;
  u.u32 = LittleEndianReadU32(bytes);
  return u.f32;
}


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

x86 assembly (clang, -O2):
<LittleEndianReadF32>:
push   %rax
call   1030 <LittleEndianReadU32@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @LittleEndianReadF32(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @LittleEndianReadU32(i32* %4)
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to float*
%8 = load float, float* %7
ret float %8
}

LLVM IR (-O2):
define float @LittleEndianReadF32(i32* %0) {
%2 = tail call i32 @LittleEndianReadU32(i32* %0)
%3 = bitcast i32 %2 to float
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ mc_swap64(int /*<<< orphan*/);
uint64_t ntohll(uint64_t val) { return mc_swap64(val); }


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

x86 assembly (clang, -O2):
<ntohll>:
jmp    1030 <mc_swap64@plt>

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

LLVM IR (-O2):
define i32 @ntohll(i32 %0) {
%2 = tail call i32 @mc_swap64(i32 %0)
ret i32 %2
}
void xrdp_sec_make_40bit(char *key) {
  key[0] = 0xd1;
  key[1] = 0x26;
  key[2] = 0x9e;
}


x86 assembly (clang, -O0):
<xrdp_sec_make_40bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0xd1,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x26,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x9e,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrdp_sec_make_40bit>:
movw   $0x26d1,(%rdi)
movb   $0x9e,0x2(%rdi)
ret

LLVM IR (-O0):
define void @xrdp_sec_make_40bit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 -47, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 38, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 -98, i8* %8
ret void
}

LLVM IR (-O2):
define void @xrdp_sec_make_40bit(i8* nocapture writeonly %0) {
store i8 -47, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 38, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 -98, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glNormal3b(char, char, char);
void Normal3b(signed char x, signed char y, signed char z) {
  glNormal3b(x, y, z);
}


x86 assembly (clang, -O0):
<Normal3b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
movsbl %cl,%edi
movsbl %al,%esi
movsbl -0x3(%rbp),%edx
call   1030 <glNormal3b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Normal3b>:
jmp    1030 <glNormal3b@plt>

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

LLVM IR (-O2):
define void @Normal3b(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @glNormal3b(i8 signext %0, i8 signext %1, i8 signext %2)
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int *a, int l, int h) {
  if (l < h) {
    int p = partition(a, l, h);
    quickSort(a, l, p - 1);
    quickSort(a, p + 1, h);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t __iter_div_u64_rem(uint64_t dividend, uint32_t divisor,
                            uint64_t *remainder) {
  uint32_t ret = 0;
  while (dividend >= divisor) {
    asm("" : "+rm"(dividend));
    dividend -= divisor;
    ret++;
  }
  *remainder = dividend;
  return ret;
}


x86 assembly (clang, -O0):
<__iter_div_u64_rem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jl     114e <__iter_div_u64_rem+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <__iter_div_u64_rem+0x18>
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__iter_div_u64_rem>:
mov    %rdi,-0x8(%rsp)
xor    %eax,%eax
cmp    %rsi,%rdi
jl     1121 <__iter_div_u64_rem+0x21>
nopl   0x0(%rax)
sub    %rsi,%rdi
mov    %rdi,-0x8(%rsp)
add    $0x1,%rax
cmp    %rsi,%rdi
jge    1110 <__iter_div_u64_rem+0x10>
mov    %rdi,(%rdx)
ret

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

LLVM IR (-O2):
define i64 @__iter_div_u64_rem(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = alloca i64
store i64 %0, i64* %4
%5 = icmp slt i64 %0, %1
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %10, %6 ], [ %0, %3 ]
%8 = phi i64 [ %11, %6 ], [ 0, %3 ]
%9 = load i64, i64* %4
%10 = sub nsw i64 %9, %1
store i64 %10, i64* %4
%11 = add nuw nsw i64 %8, 1
%12 = icmp slt i64 %10, %1
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = phi i64 [ 0, %3 ], [ %11, %6 ]
%15 = phi i64 [ %0, %3 ], [ %10, %6 ]
store i64 %15, i64* %2
ret i64 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_nop(FILE *stream) {
  fprintf(stream, "NOP                             ");
}


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

x86 assembly (clang, -O2):
<fprint_nop>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"NOP \00"
define void @fprint_nop(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"NOP \00"
define void @fprint_nop(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
ret void
}
/* Variables and functions */
size_t strnlen(const char *s, size_t max) {
  register const char *p = s;
  while (max && *p) {
    ++p;
    --max;
  }
  return p - s;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
je     1134 <strnlen+0x34>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1144 <strnlen+0x44>
jmp    1161 <strnlen+0x61>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
lea    (%rdi,%rsi,1),%rcx
mov    %rdi,%rax
nop
cmpb   $0x0,(%rax)
je     1122 <strnlen+0x22>
add    $0x1,%rax
add    $0xffffffffffffffff,%rsi
jne    1110 <strnlen+0x10>
mov    %rcx,%rax
sub    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr i8, i8* %0, i64 %1
br label %6
6: ; preds = %4, %11
%7 = phi i8* [ %12, %11 ], [ %0, %4 ]
%8 = phi i64 [ %13, %11 ], [ %1, %4 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = add i64 %8, -1
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %11, %2
%16 = phi i8* [ %0, %2 ], [ %5, %11 ], [ %7, %6 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
ret i64 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ mapname;
typedef int /*<<< orphan*/ info;

/* Variables and functions */
int /*<<< orphan*/ Info_ValueForKey(char *, char *);
int /*<<< orphan*/ Q_strncpyz(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ trap_GetServerinfo(char *, int);
void CreateMapServerEntities() {
  char info[1024];
  char mapname[128];
  trap_GetServerinfo(info, sizeof(info));
  Q_strncpyz(mapname, Info_ValueForKey(info, "mapname"), sizeof(mapname));
}


x86 assembly (clang, -O0):
<CreateMapServerEntities>:
push   %rbp
mov    %rsp,%rbp
sub    $0x490,%rsp
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
call   1040 <trap_GetServerinfo@plt>
lea    -0x480(%rbp),%rax
mov    %rax,-0x488(%rbp)
lea    -0x400(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <Info_ValueForKey@plt>
mov    -0x488(%rbp),%rdi
mov    %eax,%esi
mov    $0x80,%edx
call   1050 <Q_strncpyz@plt>
add    $0x490,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateMapServerEntities>:
push   %rbx
sub    $0x480,%rsp
lea    0x80(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <trap_GetServerinfo@plt>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1030 <Info_ValueForKey@plt>
mov    %rsp,%rdi
mov    %eax,%esi
mov    $0x80,%edx
call   1050 <Q_strncpyz@plt>
add    $0x480,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"mapname\00"
define void @CreateMapServerEntities() {
%1 = alloca [1024 x i8]
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = call i32 @trap_GetServerinfo(i8* %3, i32 1024)
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%7 = call i32 @Info_ValueForKey(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @Q_strncpyz(i8* %5, i32 %7, i32 128)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"mapname\00"
define void @CreateMapServerEntities() {
%1 = alloca [1024 x i8]
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = call i32 @trap_GetServerinfo(i8* %3, i32 1024)
%6 = call i32 @Info_ValueForKey(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @Q_strncpyz(i8* %4, i32 %6, i32 128)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void regerror(char *s) { printf("<3>Regexp: %s\n", s); }


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

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

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

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

/* Variables and functions */
void test_hsv(uint8_t h, uint8_t s, uint8_t v) {}


x86 assembly (clang, -O0):
<test_hsv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_hsv(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int offcmp(const void *a, const void *b) { return *(off_t *)a - *(off_t *)b; }


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

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

LLVM IR (-O0):
define i32 @offcmp(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 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @offcmp(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 = sub nsw i32 %4, %6
ret i32 %7
}
int is_valid_symbol_type(char *p) {
  switch (p[0]) {
  case 't':
  case 'T':
  case 'w':
  case 'W':
    return !p[1];
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_valid_symbol_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x54,%eax
je     1153 <is_valid_symbol_type+0x53>
jmp    1120 <is_valid_symbol_type+0x20>
mov    -0x14(%rbp),%eax
sub    $0x57,%eax
je     1153 <is_valid_symbol_type+0x53>
jmp    1131 <is_valid_symbol_type+0x31>
mov    -0x14(%rbp),%eax
sub    $0x74,%eax
je     1153 <is_valid_symbol_type+0x53>
jmp    1142 <is_valid_symbol_type+0x42>
mov    -0x14(%rbp),%eax
sub    $0x77,%eax
jne    116d <is_valid_symbol_type+0x6d>
jmp    1153 <is_valid_symbol_type+0x53>
mov    -0x10(%rbp),%rax
cmpb   $0x0,0x1(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <is_valid_symbol_type+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_symbol_type>:
movsbl (%rdi),%ecx
xor    %eax,%eax
add    $0xffffffac,%ecx
cmp    $0x23,%ecx
ja     1126 <is_valid_symbol_type+0x26>
movabs $0x900000009,%rdx
bt     %rcx,%rdx
jae    1126 <is_valid_symbol_type+0x26>
xor    %eax,%eax
cmpb   $0x0,0x1(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_valid_symbol_type(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %15 [
i32 116, label %8
i32 84, label %8
i32 119, label %8
i32 87, label %8
]
8: ; preds = %1, %1, %1, %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
store i32 %14, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_valid_symbol_type(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %9 [
i32 116, label %4
i32 84, label %4
i32 119, label %4
i32 87, label %4
]
4: ; preds = %1, %1, %1, %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 0, %1 ]
ret i32 %10
}
do_command() {}


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

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

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

LLVM IR (-O2):
define i32 @do_command() {
ret i32 undef
}
void ff_hevc_put_hevc_uni_epel_v8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v8_8_sse4() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in6_addr {
  scalar_t__ s6_addr;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, scalar_t__, int);
uint32_t in6_teredo_server(const struct in6_addr *ip6) {
  uint32_t server_ip;
  memcpy(&server_ip, ip6->s6_addr + 4, 4);
  return server_ip;
}


x86 assembly (clang, -O0):
<in6_teredo_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
add    $0x4,%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in6_teredo_server>:
push   %rax
mov    (%rdi),%rsi
add    $0x4,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i64 }
define i32 @in6_teredo_server(%struct.in6_addr* %0) {
%2 = alloca %struct.in6_addr*
%3 = alloca i32
store %struct.in6_addr* %0, %struct.in6_addr** %2
%4 = load %struct.in6_addr*, %struct.in6_addr** %2
%5 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %6, 4
%8 = call i32 @memcpy(i32* %3, i64 %7, i32 4)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
%struct.in6_addr = type { i64 }
define i32 @in6_teredo_server(%struct.in6_addr* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = add nsw i64 %5, 4
%7 = call i32 @memcpy(i32* %2, i64 %6, i32 4)
%8 = load i32, i32* %2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void show_help() {
  puts("usage: iv [OPTIONS] [file1 ...]");
  puts("Run iv - the editor that Isn't Vi");
  puts("");
  puts(" -h             display this screen and exit");
  puts(" -V             print version information and exit");
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xf24(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xeec(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xef8(%rip),%rdi
call   1040 <puts@plt>
lea    0xf19(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"usage: iv [OPTIONS] [file1 ...]\00"
@.str.1 = [34 x i8] c"Run iv - the editor that Isn't Vi\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [45 x i8] c" -h display this screen and exit\00"
@.str.4 = [51 x i8] c" -V print version information and exit\00"
define void @show_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"usage: iv [OPTIONS] [file1 ...]\00"
@.str.1 = [34 x i8] c"Run iv - the editor that Isn't Vi\00"
@.str.3 = [45 x i8] c" -h display this screen and exit\00"
@.str.4 = [51 x i8] c" -V print version information and exit\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
int /*<<< orphan*/ use_default_colors();
void cmd_use_default_colors(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(use_default_colors());
}


x86 assembly (clang, -O0):
<cmd_use_default_colors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_use_default_colors+0x27>
jmp    117f <cmd_use_default_colors+0x3f>
mov    $0x1,%edi
call   1060 <report_count@plt>
mov    $0x0,%al
call   1030 <use_default_colors@plt>
mov    %eax,%edi
call   1040 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_use_default_colors>:
push   %rax
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_use_default_colors+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1060 <report_count@plt>
xor    %eax,%eax
call   1030 <use_default_colors@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <report_return@plt>

LLVM IR (-O0):
define void @cmd_use_default_colors(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @use_default_colors()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_use_default_colors(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @use_default_colors()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void close_driver() {
  perror("Closing with reason:");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Closing with reason:\00"
define void @close_driver() {
%1 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"Closing with reason:\00"
define void @close_driver() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
unsigned char PushCharPixel(const unsigned char **pixels) {
  unsigned char pixel;
  pixel = (unsigned char)*(*pixels)++;
  return (pixel);
}


x86 assembly (clang, -O0):
<PushCharPixel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PushCharPixel>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    (%rax),%al
ret

LLVM IR (-O0):
define zeroext i8 @PushCharPixel(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %4
%7 = load i8, i8* %5
store i8 %7, i8* %3
%8 = load i8, i8* %3
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @PushCharPixel(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %3, i8** %0
%4 = load i8, i8* %2
ret i8 %4
}
int int2(unsigned const char *p) {
  int i;
  if (p[0] & 0x80) {
    i = -(((p[0] & 0x7f) << 8) + p[1]);
  } else {
    i = (p[0] << 8) + p[1];
  }
  return i;
}


x86 assembly (clang, -O0):
<int2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1140 <int2+0x40>
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
and    $0x7f,%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
add    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1157 <int2+0x57>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2>:
movzbl (%rdi),%eax
mov    %eax,%ecx
shl    $0x8,%ecx
test   $0x80,%al
jne    1115 <int2+0x15>
movzbl 0x1(%rdi),%eax
or     %eax,%ecx
mov    %ecx,%eax
ret
and    $0x7f00,%ecx
movzbl 0x1(%rdi),%eax
or     %ecx,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @int2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = and i32 %3, 128
%5 = icmp eq i32 %4, 0
%6 = shl nuw nsw i32 %3, 8
br i1 %5, label %14, label %7
7: ; preds = %1
%8 = and i32 %6, 32512
%9 = getelementptr inbounds i8, i8* %0, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %8, %11
%13 = sub nsw i32 0, %12
br label %19
14: ; preds = %1
%15 = getelementptr inbounds i8, i8* %0, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %6, %17
br label %19
19: ; preds = %14, %7
%20 = phi i32 [ %13, %7 ], [ %18, %14 ]
ret i32 %20
}
void RTAvlHCPhysGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlHCPhysGet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_min() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_min"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_cvolume_min\00"
define i32 @pa_cvolume_min() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void rop3_246_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk1 = T | stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_246_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_246_0_0>:
xor    (%rdi),%sil
or     %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_246_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
store i8 %22, i8* %23
ret void
}

LLVM IR (-O2):
define void @rop3_246_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = or i8 %5, %2
store i8 %6, i8* %0
ret void
}
void shveu_close(void) {}


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

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

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

LLVM IR (-O2):
define void @shveu_close() {
ret void
}
/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
fflush_(void) {
  int c;
  while ((c = fgetc(stdin)) != EOF && c != '\n') {
  }
}


x86 assembly (clang, -O0):
<fflush_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
mov    0x2eac(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x9(%rbp)
je     1149 <fflush_+0x39>
cmpl   $0xa,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1159 <fflush_+0x49>
jmp    115e <fflush_+0x4e>
jmp    1118 <fflush_+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fflush_>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
mov    0x2ebe(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
je     1141 <fflush_+0x31>
cmp    (%rbx),%eax
jne    1130 <fflush_+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
define i32 @fflush_() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* @stdin
%5 = call i32 @fgetc(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 10
br label %11
11: ; preds = %8, %3
%12 = phi i1 [ false, %3 ], [ %10, %8 ]
br i1 %12, label %13, label %14
13: ; preds = %11
br label %3
14: ; preds = %11
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
define i32 @fflush_() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @stdin
%3 = tail call i32 @fgetc(i32 %2)
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp ne i32 %3, 10
%7 = and i1 %6, %5
br i1 %7, label %1, label %8
8: ; preds = %1
ret i32 undef
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  for (;;) {
    if (getchar() == EOF)
      break;
    if ((c = getchar()) == EOF)
      break;
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
jne    114b <main+0x2b>
jmp    1179 <main+0x59>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cltq
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%rax
jne    116c <main+0x4c>
jmp    1179 <main+0x59>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%rax
je     1162 <main+0x42>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
movslq %eax,%rcx
cmp    (%rbx),%rcx
je     1162 <main+0x42>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%rax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %15, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %3
br label %18
8: ; preds = %3
%9 = call i64 (...) @getchar()
%10 = trunc i64 %9 to i32
store i32 %10, i32* %2
%11 = sext i32 %10 to i64
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %8
br label %18
15: ; preds = %8
%16 = load i32, i32* %2
%17 = call i32 @putchar(i32 %16)
br label %3
18: ; preds = %14, %7
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %16, label %4
4: ; preds = %0, %10
%5 = tail call i64 (...) @getchar()
%6 = shl i64 %5, 32
%7 = ashr exact i64 %6, 32
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %16, label %10
10: ; preds = %4
%11 = trunc i64 %5 to i32
%12 = tail call i32 @putchar(i32 %11)
%13 = tail call i64 (...) @getchar()
%14 = load i64, i64* @EOF
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %4
16: ; preds = %10, %4, %0
ret i32 0
}
char *setsuf(as, ch)
char *as;
{
  register char *s, *s1;
  s = s1 = savestr(as);
  while (*s)
    if (*s++ == '/')
      s1 = s;
  s[-1] = ch;
  return s1;
}


x86 assembly (clang, -O0):
<setsuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <savestr@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1169 <setsuf+0x59>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1164 <setsuf+0x54>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1134 <setsuf+0x24>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,-0x1(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setsuf>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
call   1030 <savestr@plt>
movslq %eax,%rsi
mov    (%rsi),%dl
test   %dl,%dl
je     114b <setsuf+0x3b>
mov    %rsi,%rcx
add    $0x1,%rcx
mov    %rsi,%rax
nopl   (%rax)
cmp    $0x2f,%dl
cmove  %rcx,%rax
movzbl (%rcx),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1130 <setsuf+0x20>
add    $0xffffffffffffffff,%rcx
mov    %rcx,%rsi
jmp    114e <setsuf+0x3e>
mov    %rsi,%rax
mov    %bl,-0x1(%rsi)
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @setsuf(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @savestr to i32 (i8*, ...)*)(i8* %0)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %2, %8
%9 = phi i8 [ %15, %8 ], [ %6, %2 ]
%10 = phi i8* [ %14, %8 ], [ %5, %2 ]
%11 = phi i8* [ %12, %8 ], [ %5, %2 ]
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = icmp eq i8 %9, 47
%14 = select i1 %13, i8* %12, i8* %10
%15 = load i8, i8* %12
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %2
%18 = phi i8* [ %5, %2 ], [ %12, %8 ]
%19 = phi i8* [ %5, %2 ], [ %14, %8 ]
%20 = trunc i32 %1 to i8
%21 = getelementptr inbounds i8, i8* %18, i64 -1
store i8 %20, i8* %21
ret i8* %19
}
void audiohw_set_speaker_vol(int vol) {}


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

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

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

LLVM IR (-O2):
define void @audiohw_set_speaker_vol(i32 %0) {
ret void
}
int main(int argc, const char *argv[]) {
  int numero = 1;
  return 0;
}


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

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

LLVM IR (-O0):
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 1, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int rec(int x) {
  if (x == 0)
    return x;
  return rec(x - 1) + 1;
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1130 <rec+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <rec+0x31>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <rec@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rec(i32 %0) {
ret i32 %0
}
/* Variables and functions */
bool isPowerOfTwo4(int n) { return n > 0 && n == (n & -n); }


x86 assembly (clang, -O0):
<isPowerOfTwo4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112b <isPowerOfTwo4+0x2b>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    %edx,%edx
sub    -0x4(%rbp),%edx
and    %edx,%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfTwo4>:
test   %edi,%edi
jle    110f <isPowerOfTwo4+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOfTwo4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
%10 = and i32 %7, %9
%11 = icmp eq i32 %6, %10
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isPowerOfTwo4(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ isupper(int);
char tolower(int);
void pound_case(char *str) {
  for (; *str != '\0'; ++str) {
    if (isupper((int)*str)) {
      *str = tolower((int)*str);
    }
  }
}


x86 assembly (clang, -O0):
<pound_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117c <pound_case+0x5c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1166 <pound_case+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    116b <pound_case+0x4b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <pound_case+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pound_case>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1155 <pound_case+0x35>
mov    %rdi,%rbx
jmp    113c <pound_case+0x1c>
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1155 <pound_case+0x35>
movsbl %al,%edi
call   1040 <isupper@plt>
test   %rax,%rax
je     1130 <pound_case+0x10>
movsbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
jmp    1130 <pound_case+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @pound_case(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %14
%5 = phi i8 [ %16, %14 ], [ %2, %1 ]
%6 = phi i8* [ %15, %14 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @isupper(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = load i8, i8* %6
%12 = sext i8 %11 to i32
%13 = tail call signext i8 @tolower(i32 %12)
store i8 %13, i8* %6
br label %14
14: ; preds = %4, %10
%15 = getelementptr inbounds i8, i8* %6, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %4
18: ; preds = %14, %1
ret void
}