xunge/DecIR huggingface dataset:
void XtFindFile() {}


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

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

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

LLVM IR (-O2):
define void @XtFindFile() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int /*<<< orphan*/ zaxisNamePtr(int);
void zaxisName(int zaxistype, char *zaxisname) {
  strcpy(zaxisname, zaxisNamePtr(zaxistype));
}


x86 assembly (clang, -O0):
<zaxisName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <zaxisNamePtr@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zaxisName>:
push   %rbx
mov    %rsi,%rbx
call   1040 <zaxisNamePtr@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @zaxisName(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = call i32 @zaxisNamePtr(i32 %6)
%8 = call i32 @strcpy(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @zaxisName(i32 %0, i8* %1) {
%3 = tail call i32 @zaxisNamePtr(i32 %0)
%4 = tail call i32 @strcpy(i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_input(char *, char *);
void args_loop(int argc, char *argv[]) {
  int i;
  char buffer[14] = {0};
  for (i = 1; i < argc; i++)
    handle_input(argv[i], buffer);
}


x86 assembly (clang, -O0):
<args_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x22(%rbp),%rdi
xor    %esi,%esi
mov    $0xe,%edx
call   1040 <memset@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1175 <args_loop+0x55>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x22(%rbp),%rsi
call   1030 <handle_input@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <args_loop+0x26>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<args_loop>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0xe(%rsp)
movq   $0x0,0x8(%rsp)
cmp    $0x2,%edi
jl     1165 <args_loop+0x55>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0x8(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rdi
mov    %r14,%rsi
call   1030 <handle_input@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1150 <args_loop+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @args_loop(i32 %0, i8** nocapture %1) {
%3 = alloca [14 x i8]
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 1, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = call i32 @handle_input(i8* %11, i8* %4)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
long difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void strtimediff(char *str, time_t tm) {
  long diff = difftime(time(NULL), tm);
  sprintf(str, "%dm:%02ds", (int)diff / 60, (int)diff % 60);
}


x86 assembly (clang, -O0):
<strtimediff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1030 <difftime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x1c(%rbp),%edx
lea    0xe7f(%rip),%rsi
call   1050 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtimediff>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1030 <difftime@plt>
movslq %eax,%rcx
imul   $0xffffffff88888889,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0x5,%edx
add    %eax,%edx
imul   $0x3c,%edx,%eax
sub    %eax,%ecx
lea    0xe92(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <sprintf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%dm:%02ds\00"
define void @strtimediff(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 @time(i32* null)
%7 = load i32, i32* %4
%8 = call i64 @difftime(i32 %6, i32 %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %5
%11 = trunc i64 %10 to i32
%12 = sdiv i32 %11, 60
%13 = load i64, i64* %5
%14 = trunc i64 %13 to i32
%15 = srem i32 %14, 60
%16 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%dm:%02ds\00"
define void @strtimediff(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i64 @difftime(i32 %3, i32 %1)
%5 = trunc i64 %4 to i32
%6 = sdiv i32 %5, 60
%7 = srem i32 %5, 60
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void ip_set_len(uint8_t *p_ip, uint16_t len) {
  p_ip[2] = (len & 0xff00) >> 8;
  p_ip[3] = (len & 0xff);
}


x86 assembly (clang, -O0):
<ip_set_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_set_len>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,0x8(%rdi)
movzbl %al,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @ip_set_len(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 65280
%7 = ashr i32 %6, 8
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 2
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 3
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @ip_set_len(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %4, i32* %5
%6 = and i32 %1, 255
%7 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %6, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_cpp_line_directive(void) {
  test("50", "#line 50\n"
             "__LINE__");
  test("50 \"foo\"", "#line 50 \"foo\"\n"
                     "__LINE__ __FILE__");
}


x86 assembly (clang, -O0):
<TEST_cpp_line_directive>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <test@plt>
lea    0xee7(%rip),%rdi
lea    0xee9(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_cpp_line_directive>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <test@plt>
lea    0xeea(%rip),%rdi
lea    0xeec(%rip),%rsi
pop    %rax
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"50\00"
@.str.1 = [18 x i8] c"#line 50\0A__LINE__\00"
@.str.2 = [9 x i8] c"50 \22foo\22\00"
@.str.3 = [33 x i8] c"#line 50 \22foo\22\0A__LINE__ __FILE__\00"
define void @TEST_cpp_line_directive() {
%1 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"50\00"
@.str.1 = [18 x i8] c"#line 50\0A__LINE__\00"
@.str.2 = [9 x i8] c"50 \22foo\22\00"
@.str.3 = [33 x i8] c"#line 50 \22foo\22\0A__LINE__ __FILE__\00"
define void @TEST_cpp_line_directive() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ int_least64_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_int_least64_t(int_least64_t const k1,
                                            int_least64_t const k2) {
  return k1 == k2;
}


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

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_int_least64_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int_least64_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int_least64_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
str_tolower(cp) char *cp;
{
  for (; *cp; cp++) {
    if (isupper(*cp))
      *cp = tolower(*cp);
  }
}


x86 assembly (clang, -O0):
<str_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1178 <str_tolower+0x58>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%eax
je     1162 <str_tolower+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    1167 <str_tolower+0x47>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <str_tolower+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_tolower>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1165 <str_tolower+0x45>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    114b <str_tolower+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <str_tolower+0x45>
movsbl %al,%ebp
mov    %ebp,%edi
call   1040 <isupper@plt>
test   %eax,%eax
je     1140 <str_tolower+0x20>
mov    %ebp,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <str_tolower+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @str_tolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @isupper(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 @tolower(i32 %7)
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
br label %13
13: ; preds = %4, %10
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %1
ret i32 undef
}
unsigned char inb(unsigned short addr) {
  unsigned char val;
  __asm__ __volatile__("inb %w1,%0" : "=a"(val) : "Nd"(addr));
  return val;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ num;

/* Variables and functions */
int /*<<< orphan*/ twoSum(int *, int, int);
int main(void) {
  int num[] = {2, 3, 6, 7, 11, 15};
  int target = 9;
  twoSum(num, sizeof(num) / sizeof(num[0]), target);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x9,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    $0x6,%esi
call   1030 <twoSum@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
mov    $0x9,%edx
call   1030 <twoSum@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.num = [6 x i32] [i32 2, i32 3, i32 6, i32 7, i32 11, i32 15]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = bitcast [6 x i32]* %1 to i8*
store i32 9, i32* %2
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @twoSum(i32* %4, i32 6, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.num = [6 x i32] [i32 2, i32 3, i32 6, i32 7, i32 11, i32 15]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @twoSum(i32* %3, i32 6, i32 9)
ret i32 0
}
/* Variables and functions */
int start(int);
int main(int argc, char *argv[]) { return start(1); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @start(i32 1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_int;
typedef scalar_t__ cl_command_queue;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clReleaseCommandQueue(cl_command_queue command_queue) {
  unsigned int sys_args[1];
  sys_args[0] = (unsigned int)command_queue;
  return (cl_int)syscall(325, 1011, sys_args);
}


x86 assembly (clang, -O0):
<clReleaseCommandQueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdx
mov    $0x145,%edi
mov    $0x3f3,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clReleaseCommandQueue>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x145,%edi
mov    $0x3f3,%esi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clReleaseCommandQueue(i64 %0) {
%2 = alloca i64
%3 = alloca [1 x i32]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%8 = call i32 @syscall(i32 325, i32 1011, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @clReleaseCommandQueue(i64 %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = trunc i64 %0 to i32
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 %4, i32* %5
%6 = call i32 @syscall(i32 325, i32 1011, i32* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void yajl_internal_free(void *ctx, void *ptr) {
  (void)ctx;
  free(ptr);
}


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

x86 assembly (clang, -O2):
<yajl_internal_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @yajl_internal_free(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @yajl_internal_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char word[48];
  printf("Enter the word:");
  gets(word);
  check(word);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x40(%rbp),%rdi
call   1050 <check@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1050 <check@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter the word:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [48 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [48 x i8], [48 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [48 x i8], [48 x i8]* %2, i64 0, i64 0
%7 = call i32 @check(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter the word:\00"
define i32 @main() {
%1 = alloca [48 x i8]
%2 = getelementptr inbounds [48 x i8], [48 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @check(i8* %2)
ret i32 0
}
/* Variables and functions */
int errno;
int syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/);
int sbrk(int nbytes) {
  int ret = syscall(13, nbytes, 0, 0, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<sbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0xd,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    115b <sbrk+0x4b>
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
mov    0x2e93(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <sbrk+0x51>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbrk>:
push   %rax
mov    %edi,%esi
mov    $0xd,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
test   %eax,%eax
js     112d <sbrk+0x1d>
pop    %rcx
ret
neg    %eax
mov    0x2eaa(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @sbrk(i32 %0) {
%2 = tail call i32 @syscall(i32 13, i32 %0, i32 0, i32 0, i32 0, i32 0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = sub nsw i32 0, %2
store i32 %5, i32* @errno
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ %2, %1 ]
ret i32 %7
}
int test_imm_75uint16_reg(unsigned short val) {
  return ((val) & (-0x75 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_75uint16_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, -117
%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_75uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -117
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRSETWINDOWEXT_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 2, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRSETWINDOWEXT_swap>:
mov    %esi,%edx
mov    $0x2,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRSETWINDOWEXT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 2, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main(void) {
  exit(69);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x45,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 69)
unreachable
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ res_class;
};
typedef TYPE_1__ XClassHint;

/* Variables and functions */
void *get_XClassHint_res_class(void *_p) {
  return (void *)((XClassHint *)_p)->res_class;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XClassHint_res_class(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XClassHint_res_class(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int lg(int x) {
  int i;
  for (i = 1; (1 << i) <= x; i++)
    if (x == (1 << i))
      return i;
  return i;
}


x86 assembly (clang, -O0):
<lg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0x8(%rbp),%eax
jg     1156 <lg+0x56>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jne    1143 <lg+0x43>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <lg+0x5c>
jmp    1148 <lg+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <lg+0xe>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lg>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    %edi,%eax
jl     1110 <lg+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @lg(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %6, %2 ]
%4 = shl nuw i32 1, %3
%5 = icmp slt i32 %4, %0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int PAPI_read_counters(long long *, int);
void papif_read_counters(long long *values, int *array_len, int *check) {
  *check = PAPI_read_counters(values, *array_len);
}


x86 assembly (clang, -O0):
<papif_read_counters>:
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),%rax
mov    (%rax),%esi
call   1030 <PAPI_read_counters@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_read_counters>:
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%esi
call   1030 <PAPI_read_counters@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_read_counters(i64* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @PAPI_read_counters(i64* %0, i32 %4)
store i32 %5, i32* %2
ret void
}
void foo127() {}


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

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

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

LLVM IR (-O2):
define void @foo127() {
ret void
}
/* Type definitions */
struct json_token {
  int dummy;
};

/* Variables and functions */
void *json_next(char const *, int, void *, char const *, int /*<<< orphan*/ *,
                struct json_token *, int *);
void *json_next_elem(const char *s, int len, void *handle, const char *path,
                     int *idx, struct json_token *val) {
  return json_next(s, len, handle, path, NULL, val, idx);
}


x86 assembly (clang, -O0):
<json_next_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r9
mov    -0x28(%rbp),%rax
xor    %r8d,%r8d
mov    %rax,(%rsp)
call   1030 <json_next@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_next_elem>:
push   %rax
mov    %r8,(%rsp)
xor    %r8d,%r8d
call   1030 <json_next@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.json_token = type { i32 }
define i8* @json_next_elem(i8* %0, i32 %1, i8* %2, i8* %3, i32* %4, %struct.json_token* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32*
%12 = alloca %struct.json_token*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32* %4, i32** %11
store %struct.json_token* %5, %struct.json_token** %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load %struct.json_token*, %struct.json_token** %12
%18 = load i32*, i32** %11
%19 = call i8* @json_next(i8* %13, i32 %14, i8* %15, i8* %16, i32* null, %struct.json_token* %17, i32* %18)
ret i8* %19
}

LLVM IR (-O2):
%struct.json_token = type { i32 }
define i8* @json_next_elem(i8* %0, i32 %1, i8* %2, i8* %3, i32* %4, %struct.json_token* %5) {
%7 = tail call i8* @json_next(i8* %0, i32 %1, i8* %2, i8* %3, i32* null, %struct.json_token* %5, i32* %4)
ret i8* %7
}
__attribute__((always_)) void pci_restore_msi_state(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_restore_msi_state(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ xisalpha(int);
scalar_t__ xisdigit(int);
int xisalnum(int c) { return (xisalpha(c) || xisdigit(c)); }


x86 assembly (clang, -O0):
<xisalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <xisalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <xisalnum+0x37>
mov    -0x4(%rbp),%edi
call   1030 <xisdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <xisalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <xisalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <xisdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @xisalnum(i32 %0) {
%2 = tail call i64 @xisalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @xisdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int compare_integers(void const *a, void const *b) {
  register int const *pa = a;
  register int const *pb = b;
  return *pa > *pb ? 1 : *pa < *pb ? -1 : 0;
}


x86 assembly (clang, -O0):
<compare_integers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jle    113b <compare_integers+0x3b>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1156 <compare_integers+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_integers>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @compare_integers(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp sgt i32 %12, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %25
17: ; preds = %2
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = icmp slt i32 %19, %21
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 -1, i32 0
br label %25
25: ; preds = %17, %16
%26 = phi i32 [ 1, %16 ], [ %24, %17 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @compare_integers(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = icmp slt i32 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
double sqrt(double);
double intr_wrap_072(double p1) { return sqrt(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_072>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <intr_wrap_072+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @intr_wrap_072(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
int dns_qr_unpack(struct dns_qr *opt_res, unsigned char *qr, int len) {
  return 0;
}


x86 assembly (clang, -O0):
<dns_qr_unpack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.dns_qr = type opaque
define i32 @dns_qr_unpack(%struct.dns_qr* %0, i8* %1, i32 %2) {
%4 = alloca %struct.dns_qr*
%5 = alloca i8*
%6 = alloca i32
store %struct.dns_qr* %0, %struct.dns_qr** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.dns_qr = type opaque
define i32 @dns_qr_unpack(%struct.dns_qr* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
void Chip_LOWPOWER_ChipSoftwareReset(void) {
  void (*p_Chip_LOWPOWER_ChipSoftwareReset)(void);
  p_Chip_LOWPOWER_ChipSoftwareReset = (void (*)(void))0x03003fa1U;
  p_Chip_LOWPOWER_ChipSoftwareReset();
}


x86 assembly (clang, -O0):
<Chip_LOWPOWER_ChipSoftwareReset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3003fa1,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Chip_LOWPOWER_ChipSoftwareReset>:
mov    $0x3003fa1,%eax
jmp    *%rax

LLVM IR (-O0):
define void @Chip_LOWPOWER_ChipSoftwareReset() {
%1 = alloca void ()*
store void ()* inttoptr (i64 50347937 to void ()*), void ()** %1
%2 = load void ()*, void ()** %1
ret void
}

LLVM IR (-O2):
define void @Chip_LOWPOWER_ChipSoftwareReset() {
tail call void inttoptr (i64 50347937 to void ()*)()
ret void
}
int test_typename(void) {
  char s;
  int y;
  int x = _Generic((s), _Bool : 1, char : 2, int : 3, default : 4);
  int z = _Generic((y), _Bool : 1, char : 2, int : 3, default : 4);
  return x + z;
}


x86 assembly (clang, -O0):
<test_typename>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_typename() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 2, i32* %3
store i32 3, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_typename() {
ret i32 5
}
void null_array(int *deer_arr) {
  int counter = 0;
  for (; counter < 100; counter++) {
    deer_arr[counter] = 0;
  }
}


x86 assembly (clang, -O0):
<null_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1136 <null_array+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <null_array+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_array>:
push   %rax
mov    $0x190,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @null_array(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
int __attribute__((no, noclone)) bar(void) { return -4; }


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

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

LLVM IR (-O0):
define i32 @bar() {
ret i32 -4
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 -4
}
void compjump(l) { out2p(85, l); }


x86 assembly (clang, -O0):
<compjump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x55,%edi
mov    $0x0,%al
call   1030 <out2p@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compjump>:
mov    %edi,%esi
mov    $0x55,%edi
xor    %eax,%eax
jmp    1030 <out2p@plt>

LLVM IR (-O0):
define void @compjump(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @out2p to i32 (i32, i32, ...)*)(i32 85, i32 %3)
ret void
}

LLVM IR (-O2):
define void @compjump(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @out2p to i32 (i32, i32, ...)*)(i32 85, i32 %0)
ret void
}
/* Variables and functions */
float __ocml_fma_rtp_f32(float, float, float);
float __fmaf_rd(float x, float y, float z) {
  return __ocml_fma_rtp_f32(x, y, z);
}


x86 assembly (clang, -O0):
<__fmaf_rd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <__ocml_fma_rtp_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fmaf_rd>:
jmp    1030 <__ocml_fma_rtp_f32@plt>

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

LLVM IR (-O2):
define float @__fmaf_rd(float %0, float %1, float %2) {
%4 = tail call float @__ocml_fma_rtp_f32(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_strcpy(char *, char *);
int /*<<< orphan*/ ft_strlen(char *);
char *ft_strnew(int /*<<< orphan*/);
char *ft_min(void) {
  char *s;
  s = ft_strnew(ft_strlen("-2147483648"));
  ft_strcpy(s, "-2147483648");
  return (s);
}


x86 assembly (clang, -O0):
<ft_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <ft_strlen@plt>
mov    %eax,%edi
call   1050 <ft_strnew@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1030 <ft_strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_min>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
mov    %r14,%rdi
call   1040 <ft_strlen@plt>
mov    %eax,%edi
call   1050 <ft_strnew@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <ft_strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"-2147483648\00"
define i8* @ft_min() {
%1 = alloca i8*
%2 = call i32 @ft_strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i8* @ft_strnew(i32 %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @ft_strcpy(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %1
ret i8* %6
}

LLVM IR (-O2):
@.str = [12 x i8] c"-2147483648\00"
define i8* @ft_min() {
%1 = tail call i32 @ft_strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @ft_strnew(i32 %1)
%3 = tail call i32 @ft_strcpy(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
char *strchr(const char *s, int c) {
  while (*s != '\0' && *s != (char)c)
    s++;
  return (*s == c) ? (char *)s : ((void *)0);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1135 <strchr+0x35>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1145 <strchr+0x45>
jmp    1156 <strchr+0x56>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <strchr+0xb>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1173 <strchr+0x73>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    117e <strchr+0x7e>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    117e <strchr+0x7e>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strchr+0x23>
movsbl %sil,%ecx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edx
cmp    %edx,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strchr+0x10>
xor    %eax,%eax
movsbl %al,%ecx
xor    %eax,%eax
cmp    %esi,%ecx
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %13
%9 = phi i8 [ %3, %5 ], [ %15, %13 ]
%10 = phi i8* [ %0, %5 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %13, %2
%18 = phi i8* [ %0, %2 ], [ %14, %13 ], [ %10, %8 ]
%19 = phi i8 [ 0, %2 ], [ 0, %13 ], [ %9, %8 ]
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, %1
%22 = select i1 %21, i8* %18, i8* null
ret i8* %22
}
/* Variables and functions */
int flash_image(void *, unsigned int, char *);
int flash_silent_binary(void *data, unsigned sz) {
  return flash_image(data, sz, "silentlake");
}


x86 assembly (clang, -O0):
<flash_silent_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <flash_image@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_silent_binary>:
lea    0xee9(%rip),%rdx
jmp    1030 <flash_image@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"silentlake\00"
define i32 @flash_silent_binary(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @flash_image(i8* %5, i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"silentlake\00"
define i32 @flash_silent_binary(i8* %0, i32 %1) {
%3 = tail call i32 @flash_image(i8* %0, i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}