xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;
typedef int /*<<< orphan*/ s1;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ sem_destroy(int /*<<< orphan*/ *);
int sem_init(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
int sem_post(int /*<<< orphan*/ *);
int sem_wait(int /*<<< orphan*/ *);
int /*<<< orphan*/ start_watchdog();
int main(void) {
  int r __attribute__((unused));
  sem_t s1;
  start_watchdog();
  r = sem_init(&s1, 0, ~0);
  r = sem_init(&s1, 0, 0);
  memset(&s1, 0x55, sizeof(s1));
  r = sem_wait(&s1);
  r = sem_post(&s1);
  sem_destroy(&s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <start_watchdog@plt>
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1070 <sem_init@plt>
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <sem_init@plt>
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x55,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
lea    -0xc(%rbp),%rdi
call   1040 <sem_wait@plt>
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1060 <sem_post@plt>
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1080 <sem_destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <start_watchdog@plt>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1070 <sem_init@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <sem_init@plt>
mov    %rbx,%rdi
mov    $0x55,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
call   1040 <sem_wait@plt>
mov    %rbx,%rdi
call   1060 <sem_post@plt>
mov    %rbx,%rdi
call   1080 <sem_destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @start_watchdog()
%5 = call i32 @sem_init(i32* %3, i32 0, i32 -1)
store i32 %5, i32* %2
%6 = call i32 @sem_init(i32* %3, i32 0, i32 0)
store i32 %6, i32* %2
%7 = call i32 @memset(i32* %3, i32 85, i32 4)
%8 = call i32 @sem_wait(i32* %3)
store i32 %8, i32* %2
%9 = call i32 @sem_post(i32* %3)
store i32 %9, i32* %2
%10 = call i32 @sem_destroy(i32* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @start_watchdog()
%4 = call i32 @sem_init(i32* %1, i32 0, i32 -1)
%5 = call i32 @sem_init(i32* %1, i32 0, i32 0)
%6 = call i32 @memset(i32* %1, i32 85, i32 4)
%7 = call i32 @sem_wait(i32* %1)
%8 = call i32 @sem_post(i32* %1)
%9 = call i32 @sem_destroy(i32* %1)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ print_ophead(int, char const *, int);
int /*<<< orphan*/ printf(char *, int, int);
void print_vx_nn(uint16_t op, const char *name, int index) {
  print_ophead(op, name, index);
  printf("V%X, %X\n", (op & 0x0F00) >> 8, op & 0x00FF);
}


x86 assembly (clang, -O0):
<print_vx_nn>:
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   1040 <print_ophead@plt>
mov    -0x4(%rbp),%esi
and    $0xf00,%esi
sar    $0x8,%esi
mov    -0x4(%rbp),%edx
and    $0xff,%edx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vx_nn>:
push   %rbx
mov    %edi,%ebx
call   1040 <print_ophead@plt>
mov    %ebx,%esi
shr    $0x8,%esi
and    $0xf,%esi
movzbl %bl,%edx
lea    0xec6(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"V%X, %X\0A\00"
define void @print_vx_nn(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @print_ophead(i32 %7, i8* %8, i32 %9)
%11 = load i32, i32* %4
%12 = and i32 %11, 3840
%13 = ashr i32 %12, 8
%14 = load i32, i32* %4
%15 = and i32 %14, 255
%16 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"V%X, %X\0A\00"
define void @print_vx_nn(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @print_ophead(i32 %0, i8* %1, i32 %2)
%5 = lshr i32 %0, 8
%6 = and i32 %5, 15
%7 = and i32 %0, 255
%8 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret void
}
int Operand_arr_decode(unsigned int *valp __attribute__((__unused__))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Operand_arr_decode(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int getpid();
int /*<<< orphan*/ stderr;
void rsocket_fatal(char *reason) {
  fprintf(stderr, "[Error] [Network] (PID: %d) %s\n", getpid(), reason);
  exit(1);
}


x86 assembly (clang, -O0):
<rsocket_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<rsocket_fatal>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb3(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
mov    %rbx,%rcx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"[Error] [Network] (PID: %d) %s\0A\00"
define void @rsocket_fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (...) @getpid()
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"[Error] [Network] (PID: %d) %s\0A\00"
define void @rsocket_fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void tree_sitter_javascript_external_scanner_destroy(void *p) {}


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

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

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

LLVM IR (-O2):
define void @tree_sitter_javascript_external_scanner_destroy(i8* nocapture %0) {
ret void
}
void avcodec_version() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_version() {
ret void
}
int pci_proc_detach_bus(struct pci_bus *bus) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pci_bus = type opaque
define i32 @pci_proc_detach_bus(%struct.pci_bus* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int pasm_get_literal(char *arg) { return atoi(arg + 1); }


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

x86 assembly (clang, -O2):
<pasm_get_literal>:
add    $0x1,%rdi
jmp    1030 <atoi@plt>

LLVM IR (-O0):
define i32 @pasm_get_literal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = call i32 @atoi(i8* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @pasm_get_literal(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i32 @atoi(i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void quota_report_heading_usageonly(void) {
  printf("%-10s %-11s %-12s\n", "User", "Space-used", "Files-used");
}


x86 assembly (clang, -O0):
<quota_report_heading_usageonly>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef1(%rip),%rsi
lea    0xeef(%rip),%rdx
lea    0xef3(%rip),%rcx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<quota_report_heading_usageonly>:
lea    0xee9(%rip),%rdi
lea    0xef5(%rip),%rsi
lea    0xef3(%rip),%rdx
lea    0xef7(%rip),%rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%-10s %-11s %-12s\0A\00"
@.str.1 = [5 x i8] c"User\00"
@.str.2 = [11 x i8] c"Space-used\00"
@.str.3 = [11 x i8] c"Files-used\00"
define void @quota_report_heading_usageonly() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%-10s %-11s %-12s\0A\00"
@.str.1 = [5 x i8] c"User\00"
@.str.2 = [11 x i8] c"Space-used\00"
@.str.3 = [11 x i8] c"Files-used\00"
define void @quota_report_heading_usageonly() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_abi_endian();
int test_abi_C(void) {
  if (!test_abi_endian()) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<test_abi_C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <test_abi_endian@plt>
cmp    $0x0,%eax
jne    1134 <test_abi_C+0x24>
movl   $0x0,-0x4(%rbp)
jmp    113b <test_abi_C+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_abi_C>:
push   %rax
xor    %eax,%eax
call   1030 <test_abi_endian@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_abi_C() {
%1 = alloca i32
%2 = call i32 (...) @test_abi_endian()
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_abi_C() {
%1 = tail call i32 (...) @test_abi_endian()
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ build_output(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_params(int, char **);
int main(int argc, char *argv[]) {
  if (argc < 4) {
    printf("Usage: ssg [min_length] [max_length] "
           "arg1 arg2 arg3...\n\n"
           "l - letters\nc - caps\nn - numbers\n"
           "s - special characters\n");
    return 1;
  } else
    build_output(set_params(argc, argv));
  return 0;
}


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)
cmpl   $0x4,-0x8(%rbp)
jge    1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1182 <main+0x52>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <set_params@plt>
mov    %eax,%edi
call   1040 <build_output@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jg     1149 <main+0x19>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret
call   1050 <set_params@plt>
mov    %eax,%edi
call   1040 <build_output@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [113 x i8] c"Usage: ssg [min_length] [max_length] arg1 arg2 arg3...\0A\0Al - letters\0Ac - caps\0An - numbers\0As - special characters\0A\00"
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 = icmp slt i32 %6, 4
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @set_params(i32 %11, i8** %12)
%14 = call i32 @build_output(i32 %13)
br label %15
15: ; preds = %10
store i32 0, i32* %3
br label %16
16: ; preds = %15, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@str = [112 x i8] c"Usage: ssg [min_length] [max_length] arg1 arg2 arg3...\0A\0Al - letters\0Ac - caps\0An - numbers\0As - special characters\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 4
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([112 x i8], [112 x i8]* @str, i64 0, i64 0))
br label %9
6: ; preds = %2
%7 = tail call i32 @set_params(i32 %0, i8** %1)
%8 = tail call i32 @build_output(i32 %7)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %10
}
int PortableUsleep_justHereToAvoidRanlibWarning(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PortableUsleep_justHereToAvoidRanlibWarning() {
ret i32 0
}
/* Variables and functions */
int *getIdentityFromZero(int);
int /*<<< orphan*/ randomizeArray(int, int *);
int *getRandomFromZero(int numOfElements) {
  int *result;
  result = getIdentityFromZero(numOfElements);
  randomizeArray(numOfElements, result);
  return result;
}


x86 assembly (clang, -O0):
<getRandomFromZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getIdentityFromZero@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <randomizeArray@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomFromZero>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <getIdentityFromZero@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
call   1040 <randomizeArray@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @getRandomFromZero(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32* @getIdentityFromZero(i32 %4)
store i32* %5, i32** %3
%6 = load i32, i32* %2
%7 = load i32*, i32** %3
%8 = call i32 @randomizeArray(i32 %6, i32* %7)
%9 = load i32*, i32** %3
ret i32* %9
}

LLVM IR (-O2):
define i32* @getRandomFromZero(i32 %0) {
%2 = tail call i32* @getIdentityFromZero(i32 %0)
%3 = tail call i32 @randomizeArray(i32 %0, i32* %2)
ret i32* %2
}
int main() {
  int a = 10, b = 15;
  a++;
  --a;
  ++a;
  a--;
  b -= ++a + 3;
  b = a - b;
  b--;
  b = b - 9;
  return b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xf,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    $0x3,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int adagain_more(int input) {
  static int one = 1;
  int two = 2;
  two += input;
  two += one;
  return two;
}


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

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

LLVM IR (-O0):
@adagain_more.one = internal global i32 1
define i32 @adagain_more(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %5, %4
store i32 %6, i32* %3
%7 = load i32, i32* @adagain_more.one
%8 = load i32, i32* %3
%9 = add nsw i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @adagain_more(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
int main() {
  int a;
  int b;
  int c;
  if (a && (b + a)) {
    c = -a;
  } else {
    b = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1131 <main+0x31>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1131 <main+0x31>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <main+0x38>
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Write(int, int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void send_alive(void) { Write(28, NULL, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<send_alive>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <Write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_alive>:
mov    $0x1c,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <Write@plt>

LLVM IR (-O0):
define void @send_alive() {
%1 = call i32 @Write(i32 28, i32* null, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @send_alive() {
%1 = tail call i32 @Write(i32 28, i32* null, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ memset(char **, int /*<<< orphan*/, int);
int /*<<< orphan*/ rotate_90(char **, char **, int);
void rotate_180(char before[][10], char trans[][10], int n) {
  char tmp[10][10];
  memset(tmp, 0, sizeof(tmp));
  rotate_90(before, tmp, n);
  rotate_90(tmp, trans, n);
}


x86 assembly (clang, -O0):
<rotate_180>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <rotate_90@plt>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <rotate_90@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_180>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1030 <rotate_90@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <rotate_90@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @rotate_180([10 x i8]* %0, [10 x i8]* %1, i32 %2) {
%4 = alloca [10 x i8]*
%5 = alloca [10 x i8]*
%6 = alloca i32
%7 = alloca [10 x [10 x i8]]
store [10 x i8]* %0, [10 x i8]** %4
store [10 x i8]* %1, [10 x i8]** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %7, i64 0, i64 0
%9 = bitcast [10 x i8]* %8 to i8**
%10 = call i32 @memset(i8** %9, i32 0, i32 100)
%11 = load [10 x i8]*, [10 x i8]** %4
%12 = bitcast [10 x i8]* %11 to i8**
%13 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %7, i64 0, i64 0
%14 = bitcast [10 x i8]* %13 to i8**
%15 = load i32, i32* %6
%16 = call i32 @rotate_90(i8** %12, i8** %14, i32 %15)
%17 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %7, i64 0, i64 0
%18 = bitcast [10 x i8]* %17 to i8**
%19 = load [10 x i8]*, [10 x i8]** %5
%20 = bitcast [10 x i8]* %19 to i8**
%21 = load i32, i32* %6
%22 = call i32 @rotate_90(i8** %18, i8** %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @rotate_180([10 x i8]* %0, [10 x i8]* %1, i32 %2) {
%4 = alloca [10 x [10 x i8]]
%5 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %4, i64 0, i64 0, i64 0
%6 = bitcast [10 x [10 x i8]]* %4 to i8**
%7 = call i32 @memset(i8** %6, i32 0, i32 100)
%8 = bitcast [10 x i8]* %0 to i8**
%9 = call i32 @rotate_90(i8** %8, i8** %6, i32 %2)
%10 = bitcast [10 x i8]* %1 to i8**
%11 = call i32 @rotate_90(i8** %6, i8** %10, i32 %2)
ret void
}
void DMTimerIntEnable(unsigned int baseAdd, unsigned int intFlags) {
  (*((volatile unsigned int *)(baseAdd + (0x2C)))) =
      (intFlags & ((0x00000004u) | (0x00000002u) | (0x00000001u)));
}


x86 assembly (clang, -O0):
<DMTimerIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0x7,%ecx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMTimerIntEnable>:
and    $0x7,%esi
add    $0x2c,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @DMTimerIntEnable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 7
%7 = load i32, i32* %3
%8 = add i32 %7, 44
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %6, i32* %10
ret void
}

LLVM IR (-O2):
define void @DMTimerIntEnable(i32 %0, i32 %1) {
%3 = and i32 %1, 7
%4 = add i32 %0, 44
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %3, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: dns-server-version [-4 | -6] [-n] host [port]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Usage: dns-server-version [-4 | -6] [-n] host [port]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [54 x i8] c"Usage: dns-server-version [-4 | -6] [-n] host [port]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int IntCompare(void *array, int i, int j) {
  return (((int *)array)[i] <= ((int *)array)[j]);
}


x86 assembly (clang, -O0):
<IntCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntCompare>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
xor    %eax,%eax
cmp    (%rdi,%rdx,4),%ecx
setle  %al
ret

LLVM IR (-O0):
define i32 @IntCompare(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
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = icmp sle i32 %12, %18
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @IntCompare(i8* nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %4, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i32, i32* %4, i64 %8
%10 = load i32, i32* %9
%11 = icmp sle i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ aaha_aux(double, double, double, double *, double *);
void aa_hadec(double lt, double alt, double az, double *ha, double *dec) {
  aaha_aux(lt, az, alt, ha, dec);
  if (*ha > 3.141592653589793)
    *ha -= 2 * 3.141592653589793;
}


x86 assembly (clang, -O0):
<aa_hadec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <aaha_aux@plt>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xea5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117d <aa_hadec+0x6d>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe93(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_hadec>:
push   %rbx
mov    %rdi,%rbx
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
call   1030 <aaha_aux@plt>
movsd  (%rbx),%xmm0
ucomisd 0xed2(%rip),%xmm0
jbe    113c <aa_hadec+0x2c>
addsd  0xed0(%rip),%xmm0
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @aa_hadec(double %0, double %1, double %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double*
%10 = alloca double*
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double, double* %6
%12 = load double, double* %8
%13 = load double, double* %7
%14 = load double*, double** %9
%15 = load double*, double** %10
%16 = call i32 @aaha_aux(double %11, double %12, double %13, double* %14, double* %15)
%17 = load double*, double** %9
%18 = load double, double* %17
%19 = fcmp ogt double %18, 0x400921FB54442D18
br i1 %19, label %20, label %24
20: ; preds = %5
%21 = load double*, double** %9
%22 = load double, double* %21
%23 = fsub double %22, 0x401921FB54442D18
store double %23, double* %21
br label %24
24: ; preds = %20, %5
ret void
}

LLVM IR (-O2):
define void @aa_hadec(double %0, double %1, double %2, double* %3, double* %4) {
%6 = tail call i32 @aaha_aux(double %0, double %2, double %1, double* %3, double* %4)
%7 = load double, double* %3
%8 = fcmp ogt double %7, 0x400921FB54442D18
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = fadd double %7, 0xC01921FB54442D18
store double %10, double* %3
br label %11
11: ; preds = %9, %5
ret void
}
/* Variables and functions */
int pm8058_mpp_config(unsigned int, int /*<<< orphan*/, unsigned int,
                      unsigned int);
int pm8058_mpp_config_digital_in(unsigned mpp, unsigned level,
                                 unsigned control) {
  return pm8058_mpp_config(mpp, 0, level, control);
}


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

x86 assembly (clang, -O2):
<pm8058_mpp_config_digital_in>:
mov    %edx,%ecx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <pm8058_mpp_config@plt>

LLVM IR (-O0):
define i32 @pm8058_mpp_config_digital_in(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 = load i32, i32* %6
%10 = call i32 @pm8058_mpp_config(i32 %7, i32 0, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pm8058_mpp_config_digital_in(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8058_mpp_config(i32 %0, i32 0, i32 %1, i32 %2)
ret i32 %4
}
int test_imm_04uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x04 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_04uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 4
%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_04uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 262144
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int squares(int n) {
  if (n == 0)
    return 0;
  else
    return n * n + squares(n - 1);
}


x86 assembly (clang, -O0):
<squares>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <squares+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1150 <squares+0x40>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <squares@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<squares>:
test   %edi,%edi
je     1146 <squares+0x46>
mov    %edi,%eax
lea    -0x1(%rax),%r8d
lea    -0x2(%rax),%esi
mov    %esi,%ecx
imul   %edi,%ecx
add    $0x1,%ecx
imul   %r8d,%ecx
mov    $0x3,%edx
sub    %eax,%edx
sub    %eax,%edx
imul   %r8,%rsi
lea    -0x3(%rax),%edi
imul   %rsi,%rdi
shr    %rsi
imul   %edx,%esi
shr    %rdi
imul   $0x55555556,%edi,%edx
imul   %eax,%eax
add    %ecx,%eax
add    %esi,%eax
add    %edx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @squares(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %27, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = add i32 %0, -2
%6 = mul i32 %5, %0
%7 = add i32 %6, 1
%8 = mul i32 %4, %7
%9 = mul i32 %0, -2
%10 = add i32 %9, 3
%11 = zext i32 %4 to i33
%12 = zext i32 %5 to i33
%13 = mul i33 %11, %12
%14 = lshr i33 %13, 1
%15 = trunc i33 %14 to i32
%16 = mul i32 %10, %15
%17 = add i32 %0, -3
%18 = zext i32 %17 to i33
%19 = mul i33 %13, %18
%20 = lshr i33 %19, 1
%21 = trunc i33 %20 to i32
%22 = mul i32 %21, 1431655766
%23 = mul i32 %0, %0
%24 = add i32 %23, %8
%25 = add i32 %24, %16
%26 = add i32 %25, %22
br label %27
27: ; preds = %3, %1
%28 = phi i32 [ 0, %1 ], [ %26, %3 ]
ret i32 %28
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ put_string(char *, int /*<<< orphan*/ *, int);
void draw_string_at_position(char *string, uint8_t *buf, int x, int y,
                             int stride) {
  put_string(string, buf + y * stride + x, stride);
}


x86 assembly (clang, -O0):
<draw_string_at_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
call   1030 <put_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_string_at_position>:
imul   %r8d,%ecx
movslq %ecx,%rax
lea    (%rsi,%rax,4),%rax
movslq %edx,%rcx
lea    (%rax,%rcx,4),%rsi
mov    %r8d,%edx
jmp    1030 <put_string@plt>

LLVM IR (-O0):
define void @draw_string_at_position(i8* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = mul nsw i32 %13, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %12, i64 %16
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %10
%22 = call i32 @put_string(i8* %11, i32* %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @draw_string_at_position(i8* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = mul nsw i32 %4, %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = tail call i32 @put_string(i8* %0, i32* %10, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  long i = 1;
  const char *p = (const char *)&i;
  if (p[0] == 1)
    printf("LITTLE ENDIAN\n");
  else
    printf("BIG ENDIAN\n");
  exit(EXIT_SUCCESS);
}


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)
movq   $0x1,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    1167 <main+0x47>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1173 <main+0x53>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [14 x i8] c"LITTLE ENDIAN\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
scalar_t__ config_WITH_CARDREADER();
int config_READER_TONGFANG(void) { return config_WITH_CARDREADER() ? 1 : 0; }


x86 assembly (clang, -O0):
<config_READER_TONGFANG>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <config_WITH_CARDREADER@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_READER_TONGFANG>:
push   %rax
xor    %eax,%eax
call   1030 <config_WITH_CARDREADER@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @config_READER_TONGFANG() {
%1 = call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @config_READER_TONGFANG() {
%1 = tail call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void AVCDecodeTruncatedExpGolomb() {}


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

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

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

LLVM IR (-O2):
define void @AVCDecodeTruncatedExpGolomb() {
ret void
}
char *default_name(void) { return "/dev/ttyUSB0"; }


x86 assembly (clang, -O0):
<default_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/ttyUSB0\00"
define i8* @default_name() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/ttyUSB0\00"
define i8* @default_name() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char *READTEST(char *);
int /*<<< orphan*/ WRITETEST(char *);
scalar_t__ strcmp(char *, char *);
int CheckTermStatus() {
  char *Ptr;
  WRITETEST("\033[5n");
  Ptr = READTEST("n");
  if (strcmp(Ptr, "\033[0n") == 0)
    return (0);
  else
    return (-1);
}


x86 assembly (clang, -O0):
<CheckTermStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <WRITETEST@plt>
lea    0xebd(%rip),%rdi
call   1030 <READTEST@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    117a <CheckTermStatus+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1181 <CheckTermStatus+0x51>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckTermStatus>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <WRITETEST@plt>
lea    0xec4(%rip),%rdi
call   1030 <READTEST@plt>
lea    0xeb5(%rip),%rsi
mov    %rax,%rdi
call   1050 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[5n\00"
@.str.1 = [2 x i8] c"n\00"
@.str.2 = [5 x i8] c"\1B[0n\00"
define i32 @CheckTermStatus() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 @WRITETEST(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @READTEST(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 0, i32* %1
br label %10
9: ; preds = %0
store i32 -1, i32* %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[5n\00"
@.str.1 = [2 x i8] c"n\00"
@.str.2 = [5 x i8] c"\1B[0n\00"
define i32 @CheckTermStatus() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @READTEST(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
int parse_hex(char ch) {
  return (ch >= '0' && ch <= '9')   ? ch - '0'
         : (ch >= 'a' && ch <= 'f') ? ch - 'a' + 10
                                    : ch - 'A' + 10;
}


x86 assembly (clang, -O0):
<parse_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <parse_hex+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <parse_hex+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1172 <parse_hex+0x72>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     115f <parse_hex+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x66,%eax
jg     115f <parse_hex+0x5f>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    116c <parse_hex+0x6c>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_hex>:
lea    -0x30(%rdi),%eax
lea    -0x61(%rdi),%ecx
xor    %edx,%edx
cmp    $0x6,%cl
setae  %dl
shl    $0x5,%edx
add    $0xffffffa9,%edx
cmp    $0xa,%al
mov    $0xffffffd0,%eax
cmovae %edx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @parse_hex(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = add i8 %0, -97
%6 = icmp ult i8 %5, 6
%7 = select i1 %6, i32 -87, i32 -55
%8 = select i1 %4, i32 -48, i32 %7
%9 = add nsw i32 %8, %2
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ DoSQVHQ(int /*<<< orphan*/);
void DoSQV1HQ(void) { DoSQVHQ(0); }


x86 assembly (clang, -O0):
<DoSQV1HQ>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <DoSQVHQ@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoSQV1HQ>:
xor    %edi,%edi
jmp    1030 <DoSQVHQ@plt>

LLVM IR (-O0):
define void @DoSQV1HQ() {
%1 = call i32 @DoSQVHQ(i32 0)
ret void
}

LLVM IR (-O2):
define void @DoSQV1HQ() {
%1 = tail call i32 @DoSQVHQ(i32 0)
ret void
}
void rotr(int *a, int *b, int *c) {
  int swap1 = 0, swap2 = 0;
  swap1 = *a;
  *a = *c;
  swap2 = *b;
  *b = swap1;
  *c = swap2;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
mov    %eax,(%rsi)
mov    %ecx,(%rdx)
ret

LLVM IR (-O0):
define void @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 0, i32* %7
store i32 0, i32* %8
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
store i32 %12, i32* %13
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = load i32*, i32** %5
store i32 %16, i32* %17
%18 = load i32, i32* %8
%19 = load i32*, i32** %6
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
store i32 %5, i32* %0
%6 = load i32, i32* %1
store i32 %4, i32* %1
store i32 %6, i32* %2
ret void
}