xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *tokenCategory2String(int);
char *tokenType2String(int);
char *token2String(int type) {
  char *msg = tokenCategory2String(type);
  if (strcmp(msg, "Invalid") != 0)
    return msg;
  return tokenType2String(type);
}


x86 assembly (clang, -O0):
<token2String>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <tokenCategory2String@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     116e <token2String+0x3e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117a <token2String+0x4a>
mov    -0xc(%rbp),%edi
call   1050 <tokenType2String@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<token2String>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <tokenCategory2String@plt>
mov    %rax,%rbx
lea    0xebc(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     115b <token2String+0x2b>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <tokenType2String@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"Invalid\00"
define i8* @token2String(i32 %0) {
%2 = tail call i8* @tokenCategory2String(i32 %0)
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i8* @tokenType2String(i32 %0)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ %2, %1 ]
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
char *getusername(uid_t uid) {
  char *username = NULL;
  struct passwd *password = getpwuid(uid);
  if (password)
    username = password->pw_name;
  return username;
}


x86 assembly (clang, -O0):
<getusername>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1145 <getusername+0x35>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getusername>:
push   %rax
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1120 <getusername+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @getusername(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.passwd*
store i32 %0, i32* %2
store i8* null, i8** %3
%5 = load i32, i32* %2
%6 = call %struct.passwd* @getpwuid(i32 %5)
store %struct.passwd* %6, %struct.passwd** %4
%7 = load %struct.passwd*, %struct.passwd** %4
%8 = icmp ne %struct.passwd* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load %struct.passwd*, %struct.passwd** %4
%11 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i32 0, i32 0
%12 = load i8*, i8** %11
store i8* %12, i8** %3
br label %13
13: ; preds = %9, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @getusername(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %4, %1
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
void divider_reset_reaction() {}


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

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

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

LLVM IR (-O2):
define void @divider_reset_reaction() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_cpp_twosharps(void) {
  test("ab", "#define CONC(x, y) x ## y\n"
             "CONC(a, b)");
  test("\"x ## y\"", "#define hash_hash # ## #\n"
                     "#define mkstr(a) # a\n"
                     "#define in_between(a) mkstr(a)\n"
                     "#define join(c, d) in_between(c hash_hash d)\n"
                     "join(x, y)");
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"ab\00"
@.str.1 = [37 x i8] c"#define CONC(x, y) x ## y\0ACONC(a, b)\00"
@.str.2 = [9 x i8] c"\22x ## y\22\00"
@.str.3 = [133 x i8] c"#define hash_hash # ## #\0A#define mkstr(a) # a\0A#define in_between(a) mkstr(a)\0A#define join(c, d) in_between(c hash_hash d)\0Ajoin(x, y)\00"
define void @TEST_cpp_twosharps() {
%1 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 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 ([133 x i8], [133 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ab\00"
@.str.1 = [37 x i8] c"#define CONC(x, y) x ## y\0ACONC(a, b)\00"
@.str.2 = [9 x i8] c"\22x ## y\22\00"
@.str.3 = [133 x i8] c"#define hash_hash # ## #\0A#define mkstr(a) # a\0A#define in_between(a) mkstr(a)\0A#define join(c, d) in_between(c hash_hash d)\0Ajoin(x, y)\00"
define void @TEST_cpp_twosharps() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 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 ([133 x i8], [133 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_set_epi16(short, short, short, short, short, short,
                                 short, short);
__m128i test_mm_set_epi16(short A, short B, short C, short D, short E, short F,
                          short G, short H) {
  return _mm_set_epi16(A, B, C, D, E, F, G, H);
}


x86 assembly (clang, -O0):
<test_mm_set_epi16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8d,-0x1c(%rbp)
mov    %ecx,%eax
mov    -0x1c(%rbp),%ecx
mov    %eax,-0x18(%rbp)
mov    %edx,%eax
mov    -0x18(%rbp),%edx
mov    %eax,-0x14(%rbp)
mov    %esi,%eax
mov    -0x14(%rbp),%esi
mov    %eax,-0x10(%rbp)
mov    %edi,%r8d
mov    -0x10(%rbp),%edi
mov    %r9w,%ax
mov    0x18(%rbp),%r9w
mov    0x10(%rbp),%r9w
mov    %r8w,-0x2(%rbp)
mov    %di,-0x4(%rbp)
mov    %si,-0x6(%rbp)
mov    %dx,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    -0x2(%rbp),%di
mov    -0x4(%rbp),%si
mov    -0x6(%rbp),%dx
mov    -0x8(%rbp),%cx
mov    -0xa(%rbp),%r8w
mov    -0xc(%rbp),%r9w
mov    0x10(%rbp),%ax
movswl %di,%edi
movswl %si,%esi
movswl %dx,%edx
movswl %cx,%ecx
movswl %r8w,%r8d
movswl %r9w,%r9d
cwtl
mov    %eax,(%rsp)
movswl 0x18(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <_mm_set_epi16@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_set_epi16>:
jmp    1030 <_mm_set_epi16@plt>

LLVM IR (-O0):
define i32 @test_mm_set_epi16(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i16 signext %5, i16 signext %6, i16 signext %7) {
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16
%13 = alloca i16
%14 = alloca i16
%15 = alloca i16
%16 = alloca i16
store i16 %0, i16* %9
store i16 %1, i16* %10
store i16 %2, i16* %11
store i16 %3, i16* %12
store i16 %4, i16* %13
store i16 %5, i16* %14
store i16 %6, i16* %15
store i16 %7, i16* %16
%17 = load i16, i16* %9
%18 = load i16, i16* %10
%19 = load i16, i16* %11
%20 = load i16, i16* %12
%21 = load i16, i16* %13
%22 = load i16, i16* %14
%23 = load i16, i16* %15
%24 = load i16, i16* %16
%25 = call i32 @_mm_set_epi16(i16 signext %17, i16 signext %18, i16 signext %19, i16 signext %20, i16 signext %21, i16 signext %22, i16 signext %23, i16 signext %24)
ret i32 %25
}

LLVM IR (-O2):
define i32 @test_mm_set_epi16(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i16 signext %5, i16 signext %6, i16 signext %7) {
%9 = tail call i32 @_mm_set_epi16(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i16 signext %5, i16 signext %6, i16 signext %7)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void pprint_substr(char *str, int i, int end) {
  for (; i <= end; i++)
    printf("%c", str[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<pprint_substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1156 <pprint_substr+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <pprint_substr+0x12>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pprint_substr>:
push   %r15
push   %r14
push   %rbx
cmp    %edx,%esi
jg     1143 <pprint_substr+0x33>
mov    %edx,%r15d
mov    %rdi,%r14
movslq %esi,%rax
add    %rax,%r14
sub    %esi,%r15d
add    $0x1,%r15d
xor    %ebx,%ebx
xchg   %ax,%ax
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <pprint_substr+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @pprint_substr(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = add i32 %2, 1
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %6, %5 ], [ %14, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 @putchar(i32 %12)
%14 = add nsw i64 %9, 1
%15 = trunc i64 %14 to i32
%16 = icmp eq i32 %7, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %3
%18 = tail call i32 @putchar(i32 10)
ret void
}
int test_imm_16uint32_mem(unsigned int *val) {
  return ((*val) & (0x16 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_16uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 22
%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_16uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 22
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned long DMAPTOM(unsigned long ulControl) {
  unsigned long ulTemp;
  ulTemp = ulControl & 0xFFFFF03F;
  ulTemp |= ((ulControl & 0x300) << 2);
  ulTemp |= ((ulControl & 0x040) << 1);
  ulTemp |= ((ulControl & 0xC00) >> 2);
  ulTemp |= ((ulControl & 0x080) >> 1);
  return ulTemp;
}


x86 assembly (clang, -O0):
<DMAPTOM>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xfffff03f,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x300,%rax
shl    $0x2,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x40,%rax
shl    $0x1,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xc00,%rax
shr    $0x2,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x80,%rax
shr    $0x1,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMAPTOM>:
mov    %edi,%eax
and    $0xfffff03f,%eax
mov    %edi,%ecx
and    $0x300,%ecx
lea    (%rax,%rcx,4),%rax
mov    %edi,%ecx
and    $0x40,%ecx
lea    (%rax,%rcx,2),%rcx
mov    %rdi,%rax
shr    $0x2,%rax
and    $0x300,%eax
or     %rcx,%rax
shr    %rdi
and    $0x40,%edi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @DMAPTOM(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 4294963263
store i64 %5, i64* %3
%6 = load i64, i64* %2
%7 = and i64 %6, 768
%8 = shl i64 %7, 2
%9 = load i64, i64* %3
%10 = or i64 %9, %8
store i64 %10, i64* %3
%11 = load i64, i64* %2
%12 = and i64 %11, 64
%13 = shl i64 %12, 1
%14 = load i64, i64* %3
%15 = or i64 %14, %13
store i64 %15, i64* %3
%16 = load i64, i64* %2
%17 = and i64 %16, 3072
%18 = lshr i64 %17, 2
%19 = load i64, i64* %3
%20 = or i64 %19, %18
store i64 %20, i64* %3
%21 = load i64, i64* %2
%22 = and i64 %21, 128
%23 = lshr i64 %22, 1
%24 = load i64, i64* %3
%25 = or i64 %24, %23
store i64 %25, i64* %3
%26 = load i64, i64* %3
ret i64 %26
}

LLVM IR (-O2):
define i64 @DMAPTOM(i64 %0) {
%2 = and i64 %0, 4294963263
%3 = shl i64 %0, 2
%4 = and i64 %3, 3072
%5 = or i64 %4, %2
%6 = shl i64 %0, 1
%7 = and i64 %6, 128
%8 = or i64 %5, %7
%9 = lshr i64 %0, 2
%10 = and i64 %9, 768
%11 = or i64 %8, %10
%12 = lshr i64 %0, 1
%13 = and i64 %12, 64
%14 = or i64 %11, %13
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ IntEnable(unsigned long);
int /*<<< orphan*/ IntRegister(unsigned long, void (*)());
void ADCIntRegister(unsigned long ulBase, unsigned long ulSequenceNum,
                    void (*pfnHandler)(void)) {
  unsigned long ulInt;
  ;
  ;
  ulInt =
      ((ulBase == 0x40038000) ? (30 + ulSequenceNum) : (64 + ulSequenceNum));
  IntRegister(ulInt, pfnHandler);
  IntEnable(ulInt);
}


x86 assembly (clang, -O0):
<ADCIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x40038000,-0x8(%rbp)
40
jne    1153 <ADCIntRegister+0x33>
mov    -0x10(%rbp),%rax
add    $0x1e,%rax
mov    %rax,-0x28(%rbp)
jmp    115f <ADCIntRegister+0x3f>
mov    -0x10(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x20(%rbp),%rdi
call   1030 <IntEnable@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCIntRegister>:
push   %rbx
lea    0x40(%rsi),%rbx
lea    0x1e(%rsi),%rax
cmp    $0x40038000,%rdi
cmove  %rax,%rbx
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1040 <IntRegister@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @ADCIntRegister(i64 %0, i64 %1, void ()* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca void ()*
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store void ()* %2, void ()** %6
%8 = load i64, i64* %4
%9 = icmp eq i64 %8, 1073971200
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i64, i64* %5
%12 = add i64 30, %11
br label %16
13: ; preds = %3
%14 = load i64, i64* %5
%15 = add i64 64, %14
br label %16
16: ; preds = %13, %10
%17 = phi i64 [ %12, %10 ], [ %15, %13 ]
store i64 %17, i64* %7
%18 = load i64, i64* %7
%19 = load void ()*, void ()** %6
%20 = bitcast void ()* %19 to void (...)*
%21 = call i32 @IntRegister(i64 %18, void (...)* %20)
%22 = load i64, i64* %7
%23 = call i32 @IntEnable(i64 %22)
ret void
}

LLVM IR (-O2):
define void @ADCIntRegister(i64 %0, i64 %1, void ()* %2) {
%4 = icmp eq i64 %0, 1073971200
%5 = select i1 %4, i64 30, i64 64
%6 = add i64 %5, %1
%7 = bitcast void ()* %2 to void (...)*
%8 = tail call i32 @IntRegister(i64 %6, void (...)* %7)
%9 = tail call i32 @IntEnable(i64 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int load(char *rom) {
  FILE *file = fopen(rom, "r");
  return 0;
}


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

x86 assembly (clang, -O2):
<load>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <fopen@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @load(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double interp_2_pt(double phi, double phip1) { return 0.5 * (phi + phip1); }


x86 assembly (clang, -O0):
<interp_2_pt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp_2_pt>:
addsd  %xmm1,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @interp_2_pt(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
%8 = fmul double 5.000000e-01, %7
ret double %8
}

LLVM IR (-O2):
define double @interp_2_pt(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fmul double %3, 5.000000e-01
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *u_strlcpy(char *dest, const char *src, size_t l) {
  strncpy(dest, src, l);
  dest[l - 1] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<u_strlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_strlcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @u_strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @u_strlcpy(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void reset_sigmask(void) {
  sigset_t set;
  sigemptyset(&set);
  sigprocmask(SIG_SETMASK, &set, NULL);
}


x86 assembly (clang, -O0):
<reset_sigmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_sigmask>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
define void @reset_sigmask() {
%1 = alloca i32
%2 = call i32 @sigemptyset(i32* %1)
%3 = load i32, i32* @SIG_SETMASK
%4 = call i32 @sigprocmask(i32 %3, i32* %1, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
define void @reset_sigmask() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIG_SETMASK
%5 = call i32 @sigprocmask(i32 %4, i32* %1, i32* null)
ret void
}
/* Variables and functions */
scalar_t__ fdimf(float, float);
int /*<<< orphan*/ link_failure_fdimf();
void test_fdimf(float f1, float f2) {
  if (fdimf(f1, f2) != fdimf(f1, f2))
    link_failure_fdimf();
}


x86 assembly (clang, -O0):
<test_fdimf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fdimf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fdimf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_fdimf+0x4b>
mov    $0x0,%al
call   1040 <link_failure_fdimf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fdimf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
call   1030 <fdimf@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1030 <fdimf@plt>
cmp    %rax,%rbx
jne    1155 <test_fdimf+0x35>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_fdimf@plt>

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

LLVM IR (-O2):
define void @test_fdimf(float %0, float %1) {
%3 = tail call i64 @fdimf(float %0, float %1)
%4 = tail call i64 @fdimf(float %0, float %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_fdimf()
br label %8
8: ; preds = %6, %2
ret void
}
TAG_CALLBACK(cpp_endif) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @TAG_CALLBACK(i32 %0) {
ret i32 -1
}
__attribute__((always_)) void __attribute__((__section__(".init.text")))
__attribute__((__cold__)) __attribute__((no_instrument_function))
setup_per_cpu_areas(void) {}


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

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

LLVM IR (-O0):
define void @setup_per_cpu_areas() section ".init.text" {
ret void
}

LLVM IR (-O2):
define void @setup_per_cpu_areas() section ".init.text" {
ret void
}
void yy_2_InternalLinkAutoCorrect(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_2_InternalLinkAutoCorrect(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
char toupper(char);
void convertToUppercase(char *string) {
  while (*string != '\0') {
    *string = toupper(*string);
    string++;
  }
}


x86 assembly (clang, -O0):
<convertToUppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <convertToUppercase+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <convertToUppercase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @convertToUppercase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %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 %15
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call signext i8 @toupper(i8 signext %10)
%12 = load i8*, i8** %2
store i8 %11, i8* %12
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @convertToUppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addch(char);
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
void DeleteMessage(void) {
  int Inc = 0;
  move(24 / 2, 0);
  for (; Inc < 80 - 1; ++Inc) {
    addch(' ');
  }
  refresh();
}


x86 assembly (clang, -O0):
<DeleteMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%edi
xor    %esi,%esi
call   1050 <move@plt>
cmpl   $0x4f,-0x4(%rbp)
jge    116d <DeleteMessage+0x3d>
mov    $0x20,%edi
call   1030 <addch@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <DeleteMessage+0x1b>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeleteMessage>:
push   %rbx
mov    $0xc,%edi
xor    %esi,%esi
call   1050 <move@plt>
mov    $0x4f,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <addch@plt>
add    $0xffffffff,%ebx
jne    1150 <DeleteMessage+0x20>
xor    %eax,%eax
pop    %rbx
jmp    1040 <refresh@plt>

LLVM IR (-O0):
define void @DeleteMessage() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @move(i32 12, i32 0)
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 79
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @addch(i8 signext 32)
br label %8
8: ; preds = %6
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
%12 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @DeleteMessage() {
%1 = tail call i32 @move(i32 12, i32 0)
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @addch(i8 signext 32)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 79
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int randomized_selectf_algo(int *, int /*<<< orphan*/, int, int);
int randomized_selectf(int *array, int size, int rank) {
  return randomized_selectf_algo(array, 0, size - 1, rank - 1);
}


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

x86 assembly (clang, -O2):
<randomized_selectf>:
lea    -0x1(%rsi),%eax
lea    -0x1(%rdx),%ecx
xor    %esi,%esi
mov    %eax,%edx
jmp    1030 <randomized_selectf_algo@plt>

LLVM IR (-O0):
define i32 @randomized_selectf(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
%12 = call i32 @randomized_selectf_algo(i32* %7, i32 0, i32 %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @randomized_selectf(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = add nsw i32 %2, -1
%6 = tail call i32 @randomized_selectf_algo(i32* %0, i32 0, i32 %4, i32 %5)
ret i32 %6
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int umask(int);
mode_t get_umask() {
  mode_t current_umask;
  current_umask = umask(022);
  umask(current_umask);
  return current_umask;
}


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

x86 assembly (clang, -O2):
<get_umask>:
push   %rbx
mov    $0x12,%edi
call   1030 <umask@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <umask@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_umask() {
%1 = alloca i32
%2 = call i32 @umask(i32 18)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @umask(i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_umask() {
%1 = tail call i32 @umask(i32 18)
%2 = tail call i32 @umask(i32 %1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ pthread_exit(void *);
int read(int, char *, int);
int cread(int fd, char *buf, int n) {
  int nread;
  if ((nread = read(fd, buf, n)) < 0) {
    perror("Reading data");
    pthread_exit((void *)1);
  }
  return nread;
}


x86 assembly (clang, -O0):
<cread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1173 <cread+0x43>
lea    0xe9c(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1040 <pthread_exit@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cread>:
push   %rbx
call   1030 <read@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1140 <cread+0x10>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1040 <pthread_exit@plt>
jmp    113c <cread+0xc>

LLVM IR (-O0):
@.str = [13 x i8] c"Reading data\00"
define i32 @cread(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @read(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @pthread_exit(i8* inttoptr (i64 1 to i8*))
br label %16
16: ; preds = %13, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@.str = [13 x i8] c"Reading data\00"
define i32 @cread(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @pthread_exit(i8* inttoptr (i64 1 to i8*))
br label %9
9: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Exiting...");
  exit(0);
  printf("This will not show!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Exiting...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"Exiting...\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void purge_quoted_args(char **argv) {
  if (argv)
    while (*argv) {
      if (**argv == '"')
        free(*argv);
      ++argv;
    }
}


x86 assembly (clang, -O0):
<purge_quoted_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116f <purge_quoted_args+0x5f>
jmp    112c <purge_quoted_args+0x1c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     116a <purge_quoted_args+0x5a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1159 <purge_quoted_args+0x49>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <purge_quoted_args+0x1c>
jmp    116f <purge_quoted_args+0x5f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<purge_quoted_args>:
push   %rbx
test   %rdi,%rdi
je     1148 <purge_quoted_args+0x38>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1148 <purge_quoted_args+0x38>
add    $0x8,%rbx
jmp    113c <purge_quoted_args+0x2c>
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
je     1148 <purge_quoted_args+0x38>
cmpb   $0x22,(%rdi)
jne    1130 <purge_quoted_args+0x20>
call   1030 <free@plt>
jmp    1130 <purge_quoted_args+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @purge_quoted_args(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %17, label %6
6: ; preds = %3, %13
%7 = phi i8* [ %15, %13 ], [ %4, %3 ]
%8 = phi i8** [ %14, %13 ], [ %0, %3 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 34
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @free(i8* %7)
br label %13
13: ; preds = %11, %6
%14 = getelementptr inbounds i8*, i8** %8, i64 1
%15 = load i8*, i8** %14
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %6
17: ; preds = %13, %3, %1
ret void
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x = rand();
  int y = rand();
  return x - y;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @rand()
store i32 %8, i32* %6
%9 = call i32 (...) @rand()
store i32 %9, i32* %7
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = sub nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = tail call i32 (...) @rand()
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap(uint32_t val) {
  return ((val & 0xFF) << 24) | ((val & 0xFF00) << 8) |
         ((val & 0xFF0000) >> 8) | ((val & 0xFF000000) >> 24);
}


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

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

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

LLVM IR (-O2):
define i32 @swap(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int sub(int, int *);
main() {
  int array[10];
  exit(sub(10, array) != 11);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0xa,%edi
call   1040 <sub@plt>
cmp    $0xb,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rsi
mov    $0xa,%edi
call   1040 <sub@plt>
xor    %edi,%edi
cmp    $0xb,%eax
setne  %dil
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%4 = call i32 @sub(i32 10, i32* %3)
%5 = icmp ne i32 %4, 11
%6 = zext i1 %5 to i32
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @sub(i32 10, i32* %3)
%5 = icmp ne i32 %4, 11
%6 = zext i1 %5 to i32
%7 = call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int rand();
unsigned char mk_rnd_u1(void) { return (rand() & 0x1); }


x86 assembly (clang, -O0):
<mk_rnd_u1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_rnd_u1>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @mk_rnd_u1() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 1
%3 = trunc i32 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @mk_rnd_u1() {
%1 = tail call i32 (...) @rand()
%2 = trunc i32 %1 to i8
%3 = and i8 %2, 1
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ InitCRCTable();
__attribute__((constructor)) void BlockMgrModuleInit() { InitCRCTable(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @BlockMgrModuleInit, i8* null }]
define void @BlockMgrModuleInit() {
%1 = call i32 (...) @InitCRCTable()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @BlockMgrModuleInit, i8* null }]
define void @BlockMgrModuleInit() {
%1 = tail call i32 (...) @InitCRCTable()
ret void
}
int get_bit(char ch, int n) {
  ch <<= n;
  return ((ch & 0x80) / 128);
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
movsbl -0x1(%rbp),%eax
shl    %cl,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x80,%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
movzbl %dil,%eax
shl    %cl,%eax
shr    $0x7,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_bit(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = shl i32 %7, %5
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = and i32 %11, 128
%13 = sdiv i32 %12, 128
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_bit(i8 signext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = shl i32 %3, %1
%5 = lshr i32 %4, 7
%6 = and i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ increase_1(int *);
void increase(int *a) { increase_1(a); }


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

x86 assembly (clang, -O2):
<increase>:
jmp    1030 <increase_1@plt>

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

LLVM IR (-O2):
define void @increase(i32* %0) {
%2 = tail call i32 @increase_1(i32* %0)
ret void
}
char *Q_strlwr(char *s) {
  char *p;
  if (s) {
    for (p = s; *s; s++)
      *s = tolower(*s);
    return p;
  }
  return ((void *)0);
}


x86 assembly (clang, -O0):
<Q_strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116e <Q_strlwr+0x5e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <Q_strlwr+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <Q_strlwr+0x1f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <Q_strlwr+0x66>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_strlwr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1146 <Q_strlwr+0x36>
mov    (%r14),%al
test   %al,%al
je     1146 <Q_strlwr+0x36>
lea    0x1(%r14),%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <Q_strlwr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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