xunge/DecIR huggingface dataset:
/* Type definitions */
struct DHCPSingleOption {
  int dummy;
};

/* Variables and functions */
size_t DHCP_getOptionLength(struct DHCPSingleOption *);
struct DHCPSingleOption *DHCP_nextSingleOption(struct DHCPSingleOption *opt) {
  size_t cnt = DHCP_getOptionLength(opt);
  return (((struct DHCPSingleOption *)(((char *)(opt)) + cnt)));
}


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

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

LLVM IR (-O0):
%struct.DHCPSingleOption = type { i32 }
define %struct.DHCPSingleOption* @DHCP_nextSingleOption(%struct.DHCPSingleOption* %0) {
%2 = alloca %struct.DHCPSingleOption*
%3 = alloca i64
store %struct.DHCPSingleOption* %0, %struct.DHCPSingleOption** %2
%4 = load %struct.DHCPSingleOption*, %struct.DHCPSingleOption** %2
%5 = call i64 @DHCP_getOptionLength(%struct.DHCPSingleOption* %4)
store i64 %5, i64* %3
%6 = load %struct.DHCPSingleOption*, %struct.DHCPSingleOption** %2
%7 = bitcast %struct.DHCPSingleOption* %6 to i8*
%8 = load i64, i64* %3
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = bitcast i8* %9 to %struct.DHCPSingleOption*
ret %struct.DHCPSingleOption* %10
}

LLVM IR (-O2):
%struct.DHCPSingleOption = type { i32 }
define %struct.DHCPSingleOption* @DHCP_nextSingleOption(%struct.DHCPSingleOption* %0) {
%2 = tail call i64 @DHCP_getOptionLength(%struct.DHCPSingleOption* %0)
%3 = bitcast %struct.DHCPSingleOption* %0 to i8*
%4 = getelementptr inbounds i8, i8* %3, i64 %2
%5 = bitcast i8* %4 to %struct.DHCPSingleOption*
ret %struct.DHCPSingleOption* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main_menu() {
  printf("Hello :)\n\n");
  printf("\t>Please select the option you want:\n");
  printf(
      "1) Input polynomials to be stored.\n2) Add stored polynomials.\n3) "
      "Subtract stored polynomials.\n4) Multiply stored polynomials.\n5) Print "
      "stored polynomials.\n6) Evaluate a polynomial to a value of X.\n\n\th) "
      "to get info about the program.\n\tq) To quit the program.\n");
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Hello :)\0A\0A\00"
@.str.1 = [38 x i8] c"\09>Please select the option you want:\0A\00"
@.str.2 = [259 x i8] c"1) Input polynomials to be stored.\0A2) Add stored polynomials.\0A3) Subtract stored polynomials.\0A4) Multiply stored polynomials.\0A5) Print stored polynomials.\0A6) Evaluate a polynomial to a value of X.\0A\0A\09h) to get info about the program.\0A\09q) To quit the program.\0A\00"
define void @main_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"Hello :)\0A\00"
@str.3 = [37 x i8] c"\09>Please select the option you want:\00"
@str.4 = [258 x i8] c"1) Input polynomials to be stored.\0A2) Add stored polynomials.\0A3) Subtract stored polynomials.\0A4) Multiply stored polynomials.\0A5) Print stored polynomials.\0A6) Evaluate a polynomial to a value of X.\0A\0A\09h) to get info about the program.\0A\09q) To quit the program.\00"
define void @main_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([258 x i8], [258 x i8]* @str.4, i64 0, i64 0))
ret void
}
void Parse_End(void) {}


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

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

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

LLVM IR (-O2):
define void @Parse_End() {
ret void
}
/* Type definitions */
typedef void uint;

/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *list_copy_uint(void *_data) {
  uint *new_data = malloc(sizeof(uint));
  memcpy(new_data, _data, sizeof(uint));
  return new_data;
}


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

x86 assembly (clang, -O2):
<list_copy_uint>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @list_copy_uint(i8* %0) {
%2 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%3 = tail call i32 @memcpy(i8* %2, i8* %0, i32 1)
ret i8* %2
}
void ReportLegacyProxy(char *cMonth, char *cYear, char *cRealm, char *cPasswd) {
  char cTableName[12] = {""};
  ConnectDb();
  sprintf(cTableName, "t%.3s%.7s", cMonth, cYear);
  AcctReportLegacyProxy(cRealm, cTableName);
  exit(0);
}


x86 assembly (clang, -O0):
<ReportLegacyProxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x2c(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
mov    $0x0,%al
call   1030 <ConnectDb@plt>
lea    -0x2c(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe6e(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
mov    $0x0,%al
call   1050 <AcctReportLegacyProxy@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<ReportLegacyProxy>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movl   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
xor    %eax,%eax
call   1030 <ConnectDb@plt>
lea    0xe8d(%rip),%rsi
lea    0x8(%rsp),%r12
mov    %r12,%rdi
mov    %rbx,%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <AcctReportLegacyProxy@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"t%.3s%.7s\00"
define void @ReportLegacyProxy(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [12 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = bitcast [12 x i8]* %9 to i8*
%11 = call i32 (...) @ConnectDb()
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 0
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
%16 = load i8*, i8** %7
%17 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 0
%18 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @AcctReportLegacyProxy to i32 (i8*, i8*, ...)*)(i8* %16, i8* %17)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"t%.3s%.7s\00"
define void @ReportLegacyProxy(i8* %0, i8* %1, i8* %2, i8* nocapture readnone %3) {
%5 = alloca [12 x i8]
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%7 = tail call i32 (...) @ConnectDb()
%8 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @AcctReportLegacyProxy to i32 (i8*, i8*, ...)*)(i8* %2, i8* %6)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ queue_test(int, int, int);
void queue_test_500K_10(void) { queue_test(0x00, 0x1c, 10); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1c,%esi
mov    $0xa,%edx
call   1030 <queue_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %edi,%edi
mov    $0x1c,%esi
mov    $0xa,%edx
jmp    1030 <queue_test@plt>

LLVM IR (-O0):
define void @queue_test_500K_10() {
%1 = call i32 @queue_test(i32 0, i32 28, i32 10)
ret void
}

LLVM IR (-O2):
define void @queue_test_500K_10() {
%1 = tail call i32 @queue_test(i32 0, i32 28, i32 10)
ret void
}
/* Variables and functions */
scalar_t__ exp10(double);
int /*<<< orphan*/ link_failure_exp10();
void test_exp10(double d) {
  if (exp10(d) != exp10(d))
    link_failure_exp10();
}


x86 assembly (clang, -O0):
<test_exp10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <exp10@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <exp10@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_exp10+0x3c>
mov    $0x0,%al
call   1030 <link_failure_exp10@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_exp10>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <exp10@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <exp10@plt>
cmp    %rax,%rbx
jne    1149 <test_exp10+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_exp10@plt>

LLVM IR (-O0):
define void @test_exp10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @exp10(double %3)
%5 = load double, double* %2
%6 = call i64 @exp10(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_exp10()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_exp10(double %0) {
%2 = tail call i64 @exp10(double %0)
%3 = tail call i64 @exp10(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_exp10()
br label %7
7: ; preds = %5, %1
ret void
}
unsigned long http_parser_version(void) {
  return 2 * 0x10000 | 5 * 0x00100 | 0 * 0x00001;
}


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

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

LLVM IR (-O0):
define i64 @http_parser_version() {
ret i64 132352
}

LLVM IR (-O2):
define i64 @http_parser_version() {
ret i64 132352
}
/* Type definitions */
typedef int /*<<< orphan*/ sa_family_t;

/* Variables and functions */
scalar_t__ inet_ntop(int /*<<< orphan*/, void const *, char *, size_t);
int /*<<< orphan*/ strcpy(char *, char *);
char *Xinet_ntop(sa_family_t af, void const *src, char *dst, size_t cnt) {
  if (inet_ntop(af, src, dst, cnt) == 0) {
    strcpy(dst, "< ???? >");
  }
  return dst;
}


x86 assembly (clang, -O0):
<Xinet_ntop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <inet_ntop@plt>
cmp    $0x0,%rax
jne    1165 <Xinet_ntop+0x45>
mov    -0x18(%rbp),%rdi
lea    0xea0(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xinet_ntop>:
push   %rbx
mov    %rdx,%rbx
call   1030 <inet_ntop@plt>
test   %rax,%rax
jne    113d <Xinet_ntop+0x1d>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"< ???? >\00"
define i8* @Xinet_ntop(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i64 @inet_ntop(i32 %9, i8* %10, i8* %11, i64 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %4
%16 = load i8*, i8** %7
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %15, %4
%19 = load i8*, i8** %7
ret i8* %19
}

LLVM IR (-O2):
@.str = [9 x i8] c"< ???? >\00"
define i8* @Xinet_ntop(i32 %0, i8* %1, i8* returned %2, i64 %3) {
%5 = tail call i64 @inet_ntop(i32 %0, i8* %1, i8* %2, i64 %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ tulip_system_init(int, char **);
int tulip_task_exec();
int main(int argc, char **argv) {
  tulip_system_init(argc, argv);
  return tulip_task_exec();
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <tulip_system_init@plt>
mov    $0x0,%al
call   1040 <tulip_task_exec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <tulip_system_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <tulip_task_exec@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @tulip_system_init(i32 %6, i8** %7)
%9 = call i32 (...) @tulip_task_exec()
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @tulip_system_init(i32 %0, i8** %1)
%4 = tail call i32 (...) @tulip_task_exec()
ret i32 %4
}
int foo(int a) {
  int PRIVATE = 2;
  return PRIVATE + a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
void pv_screensize(unsigned int *width, unsigned int *height) {}


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

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

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

LLVM IR (-O2):
define void @pv_screensize(i32* nocapture %0, i32* nocapture %1) {
ret void
}
int main() {
  volatile unsigned int *address = 0x63F0FFFF;
  *address = 0xbbbbbbbb;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
movl   $0xbbbbbbbb,0x63f0ffff
bb bb bb bb
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* inttoptr (i64 1676738559 to i32*), i32** %2
%3 = load i32*, i32** %2
store volatile i32 -1145324613, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
store volatile i32 -1145324613, i32* inttoptr (i64 1676738559 to i32*)
ret i32 0
}
int test_imm_82int64_lowword_mem(long long *val) {
  return ((*val) & (0x82 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_82int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 130
%6 = icmp ne i64 %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_82int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 130
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr2setBank2(int);
void s3setParamsA800(uint16_t addr, uint8_t val) {
  (void)addr;
  chr2setBank2(val << 11);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xb,%edi
jmp    1030 <chr2setBank2@plt>

LLVM IR (-O0):
define void @s3setParamsA800(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %6, 11
%8 = call i32 @chr2setBank2(i32 %7)
ret void
}

LLVM IR (-O2):
define void @s3setParamsA800(i32 %0, i32 %1) {
%3 = shl i32 %1, 11
%4 = tail call i32 @chr2setBank2(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("foo()\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"foo()\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"foo()\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((always_)) void stihlt(void) {
  __asm__ __volatile__("sti\n    hlt");
}


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

x86 assembly (clang, -O2):
<stihlt>:
sti
hlt
ret

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

LLVM IR (-O2):
define void @stihlt() {
tail call void asm sideeffect "sti\0A hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void _CATCAT_Xran(void) {
  fputs("Out of range: invalid dynamic array position\n", stderr);
  abort();
}


x86 assembly (clang, -O0):
<_CATCAT_Xran>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_CATCAT_Xran>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Out of range: invalid dynamic array position\0A\00"
@stderr = global i32 0
define void @_CATCAT_Xran() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [46 x i8] c"Out of range: invalid dynamic array position\0A\00"
@stderr = global i32 0
define void @_CATCAT_Xran() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
scalar_t__ isspace(int);
char *skip_over_blanks(char *cp) {
  while (*cp && isspace((int)(*cp)))
    cp++;
  return cp;
}


x86 assembly (clang, -O0):
<skip_over_blanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <skip_over_blanks+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <skip_over_blanks+0x47>
jmp    1168 <skip_over_blanks+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_over_blanks+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_over_blanks>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skip_over_blanks+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skip_over_blanks+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_over_blanks+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_over_blanks(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %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 %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i64 @isspace(i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @skip_over_blanks(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %12, %10 ], [ %2, %1 ]
%6 = phi i8* [ %11, %10 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @isspace(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %10, %1
%15 = phi i8* [ %0, %1 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ msg_exit(char *);
void sigalarm(int arg) { msg_exit("timed out"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"timed out\00"
define void @sigalarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @msg_exit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"timed out\00"
define void @sigalarm(i32 %0) {
%2 = tail call i32 @msg_exit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void banner_error(void) {
  printf("Configuration error\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Configuration error\0A\00"
define void @banner_error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [20 x i8] c"Configuration error\00"
define void @banner_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ printf(char *, long, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_testcancel();
void *thread(void *arg) {
  printf("thread %ld %d\n", (long)arg, getpid());
  while (1) {
    pthread_testcancel();
  }
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <pthread_testcancel@plt>
jmp    115d <thread+0x2d>

x86 assembly (clang, -O2):
<thread>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <pthread_testcancel@plt>
jmp    1150 <thread+0x20>

LLVM IR (-O0):
@.str = [15 x i8] c"thread %ld %d\0A\00"
define i8* @thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i32 (...) @getpid()
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %4, i32 %5)
br label %7
7: ; preds = %1, %7
%8 = call i32 (...) @pthread_testcancel()
br label %7
}

LLVM IR (-O2):
@.str = [15 x i8] c"thread %ld %d\0A\00"
define noalias i8* @thread(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %2, i32 %3)
br label %5
5: ; preds = %1, %5
%6 = tail call i32 (...) @pthread_testcancel()
br label %5
}
/* Variables and functions */
char *strrchr(char *, char);
char *get_basename(char *s) {
  char *p;
  if (s == NULL)
    return NULL;
  p = strrchr(s, '/');
  return (p == NULL) ? s : p + 1;
}


x86 assembly (clang, -O0):
<get_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <get_basename+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1172 <get_basename+0x62>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <get_basename+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    116a <get_basename+0x5a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_basename>:
test   %rdi,%rdi
je     1133 <get_basename+0x23>
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,%rcx
add    $0x1,%rax
test   %rcx,%rcx
cmove  %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @get_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %20
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strrchr(i8* %9, i8 signext 47)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i8*, i8** %3
br label %18
15: ; preds = %8
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
br label %18
18: ; preds = %15, %13
%19 = phi i8* [ %14, %13 ], [ %17, %15 ]
store i8* %19, i8** %2
br label %20
20: ; preds = %18, %7
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @get_basename(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 47)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* %0, i8* %6
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %9
}
char test_char_2(char a, char b) { return 0xf6; }


x86 assembly (clang, -O0):
<test_char_2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0xf6,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_char_2>:
mov    $0xf6,%al
ret

LLVM IR (-O0):
define signext i8 @test_char_2(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
ret i8 -10
}

LLVM IR (-O2):
define signext i8 @test_char_2(i8 signext %0, i8 signext %1) {
ret i8 -10
}
/* Variables and functions */
int /*<<< orphan*/ message(int /*<<< orphan*/, char *, int const);
void ioctl_error(const int line) {
  message(0, "IOCTL call to wireless extensions in line %d returned error",
          line);
}


x86 assembly (clang, -O0):
<ioctl_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %edi,%edi
lea    0xed9(%rip),%rsi
call   1030 <message@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioctl_error>:
mov    %edi,%edx
lea    0xee7(%rip),%rsi
xor    %edi,%edi
jmp    1030 <message@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"IOCTL call to wireless extensions in line %d returned error\00"
define void @ioctl_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @message(i32 0, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"IOCTL call to wireless extensions in line %d returned error\00"
define void @ioctl_error(i32 %0) {
%2 = tail call i32 @message(i32 0, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
void ion_cmd_ping(char *cmd) { printw("\n\rping command\n\r\n\r"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"\0A\0Dping command\0A\0D\0A\0D\00"
define void @ion_cmd_ping(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printw(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0A\0Dping command\0A\0D\0A\0D\00"
define void @ion_cmd_ping(i8* nocapture readnone %0) {
%2 = tail call i32 @printw(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
void ar5312_arch_init_irq(void) {}


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

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

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

LLVM IR (-O2):
define void @ar5312_arch_init_irq() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Possible Commands:\n help  mkdir  rmdir  cd  ls  pwd  creat  rm  "
         "save  reload  quit\n");
}


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

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

LLVM IR (-O0):
@.str = [84 x i8] c"Possible Commands:\0A help mkdir rmdir cd ls pwd creat rm save reload quit\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [83 x i8] c"Possible Commands:\0A help mkdir rmdir cd ls pwd creat rm save reload quit\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ voronoi(float, float, float, float *, float *, int,
                           int /*<<< orphan*/);
float voronoi_F1F2S(float x, float y, float z) {
  float da[4], pa[12];
  voronoi(x, y, z, da, pa, 1, 0);
  return (2.0f * (da[1] - da[0]) - 1.0f);
}


x86 assembly (clang, -O0):
<voronoi_F1F2S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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
lea    -0x20(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <voronoi@plt>
movss  -0x1c(%rbp),%xmm0
subss  -0x20(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xea0(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voronoi_F1F2S>:
sub    $0x48,%rsp
mov    %rsp,%rdi
lea    0x10(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <voronoi@plt>
movss  0x4(%rsp),%xmm0
subss  (%rsp),%xmm0
addss  %xmm0,%xmm0
addss  0xec1(%rip),%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define float @voronoi_F1F2S(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca [4 x float]
%8 = alloca [12 x float]
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %4
%10 = load float, float* %5
%11 = load float, float* %6
%12 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
%13 = getelementptr inbounds [12 x float], [12 x float]* %8, i64 0, i64 0
%14 = call i32 @voronoi(float %9, float %10, float %11, float* %12, float* %13, i32 1, i32 0)
%15 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 1
%16 = load float, float* %15
%17 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
%18 = load float, float* %17
%19 = fsub float %16, %18
%20 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %19, float -1.000000e+00)
ret float %20
}

LLVM IR (-O2):
define float @voronoi_F1F2S(float %0, float %1, float %2) {
%4 = alloca [4 x float]
%5 = alloca [12 x float]
%6 = bitcast [4 x float]* %4 to i8*
%7 = bitcast [12 x float]* %5 to i8*
%8 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 0
%9 = getelementptr inbounds [12 x float], [12 x float]* %5, i64 0, i64 0
%10 = call i32 @voronoi(float %0, float %1, float %2, float* %8, float* %9, i32 1, i32 0)
%11 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 1
%12 = load float, float* %11
%13 = load float, float* %8
%14 = fsub float %12, %13
%15 = call float @llvm.fmuladd.f32(float %14, float 2.000000e+00, float -1.000000e+00)
ret float %15
}
char bg(char chr) {
  if (chr >= 'a' && chr <= 'z')
    return chr - 'a' + 'A';
  return chr;
}


x86 assembly (clang, -O0):
<bg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <bg+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1136 <bg+0x36>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    113c <bg+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bg>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @bg(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 %14, 65
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %19
17: ; preds = %7, %1
%18 = load i8, i8* %3
store i8 %18, i8* %2
br label %19
19: ; preds = %17, %11
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @bg(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
void test60_TestProg_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test60_TestProg_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int getAverage(int arr[], int size) {
  int i;
  for (i = 0; i < size; ++i) {
    printf("%d\n", arr[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<getAverage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <getAverage+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <getAverage+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAverage>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <getAverage+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <getAverage+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @getAverage(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *indirectString(struct sqlConnection *, int, char *, char *);
char *bioImageSliceType(struct sqlConnection *conn, int id) {
  return indirectString(conn, id, "sliceType", "name");
}


x86 assembly (clang, -O0):
<bioImageSliceType>:
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
lea    0xed6(%rip),%rcx
call   1030 <indirectString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bioImageSliceType>:
lea    0xee9(%rip),%rdx
lea    0xeec(%rip),%rcx
jmp    1030 <indirectString@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [10 x i8] c"sliceType\00"
@.str.1 = [5 x i8] c"name\00"
define i8* @bioImageSliceType(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @indirectString(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [10 x i8] c"sliceType\00"
@.str.1 = [5 x i8] c"name\00"
define i8* @bioImageSliceType(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @indirectString(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i8* %3
}
void initialise_monitor_handles(void) {}


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

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

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

LLVM IR (-O2):
define void @initialise_monitor_handles() {
ret void
}
int bitcount(unsigned x) {
  int b;
  for (b = 0; x; x &= (x - 1))
    b++;
  return b;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <bitcount+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ abs(int);
int get_class(int value) {
  int class = 0;
  value = (int)abs(value);
  while (value > 0) {
    value >>= 1;
    class ++;
  }
  return class;
}


x86 assembly (clang, -O0):
<get_class>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114e <get_class+0x3e>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <get_class+0x1d>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_class>:
push   %rax
call   1030 <abs@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %ecx,%ecx
jle    113c <get_class+0x2c>
mov    %ecx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
shr    %edx
add    $0x1,%eax
cmp    $0x1,%ecx
mov    %edx,%ecx
ja     1130 <get_class+0x20>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_class(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i64 @abs(i32 %4)
%6 = trunc i64 %5 to i32
store i32 %6, i32* %2
br label %7
7: ; preds = %10, %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %2
%12 = ashr i32 %11, 1
store i32 %12, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %7
15: ; preds = %7
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_class(i32 %0) {
%2 = tail call i64 @abs(i32 %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i32 [ %8, %5 ], [ %3, %1 ]
%8 = lshr i32 %7, 1
%9 = add nuw nsw i32 %6, 1
%10 = icmp ult i32 %7, 2
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %12
}
int count_extfrag(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @count_extfrag() {
ret i32 0
}

LLVM IR (-O2):
define i32 @count_extfrag() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ testPartition();
int main(void) {
  srand(1927);
  testPartition();
  printf("i am satisfied with your function. congratulations. asian father "
         "approves.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x787,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1050 <testPartition@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x787,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1050 <testPartition@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"i am satisfied with your function. congratulations. asian father approves.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @srand(i32 1927)
%3 = call i32 (...) @testPartition()
%4 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [75 x i8] c"i am satisfied with your function. congratulations. asian father approves.\00"
define i32 @main() {
%1 = tail call i32 @srand(i32 1927)
%2 = tail call i32 (...) @testPartition()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
ret i32 0
}