xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ parameterCheck();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readSettings();
int main(int argc, const char *argv[]) {
  readSettings();
  if (parameterCheck()) {
    printf("error");
  } else {
    printf("okay");
  }
  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)
mov    $0x0,%al
call   1040 <readSettings@plt>
mov    $0x0,%al
call   1050 <parameterCheck@plt>
cmp    $0x0,%rax
je     116f <main+0x3f>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <main+0x4b>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <readSettings@plt>
xor    %eax,%eax
call   1050 <parameterCheck@plt>
test   %rax,%rax
lea    0xebd(%rip),%rax
lea    0xeb0(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"error\00"
@.str.1 = [5 x i8] c"okay\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 = call i32 (...) @readSettings()
%7 = call i64 (...) @parameterCheck()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"error\00"
@.str.1 = [5 x i8] c"okay\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @readSettings()
%4 = tail call i64 (...) @parameterCheck()
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ capture_event(void *, int, int, int /*<<< orphan*/);
void capture_write_adlib(uint16_t port, uint8_t val, void *p) {
  capture_event(p, (3 << 8), 1, port);
}


x86 assembly (clang, -O0):
<capture_write_adlib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x300,%esi
mov    $0x1,%edx
call   1030 <capture_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_write_adlib>:
mov    %edi,%ecx
mov    %rdx,%rdi
mov    $0x300,%esi
mov    $0x1,%edx
jmp    1030 <capture_event@plt>

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

LLVM IR (-O2):
define void @capture_write_adlib(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @capture_event(i8* %2, i32 768, i32 1, i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ readlink(char *, char *, size_t);
int ship_find_exe_path(char *bfr, size_t bfr_size) {
  ssize_t rv = readlink("/proc/self/exe", bfr, bfr_size - 1);
  if (rv < 0)
    rv = 0;
  return rv;
}


x86 assembly (clang, -O0):
<ship_find_exe_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
lea    0xecd(%rip),%rdi
call   1030 <readlink@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    114f <ship_find_exe_path+0x3f>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ship_find_exe_path>:
push   %rax
mov    %rdi,%rax
lea    -0x1(%rsi),%rdx
lea    0xee1(%rip),%rdi
mov    %rax,%rsi
call   1030 <readlink@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmovle %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/self/exe\00"
define i32 @ship_find_exe_path(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = sub i64 %7, 1
%9 = call i64 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6, i64 %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i64 0, i64* %5
br label %13
13: ; preds = %12, %2
%14 = load i64, i64* %5
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/self/exe\00"
define i32 @ship_find_exe_path(i8* nocapture %0, i64 %1) {
%3 = add i64 %1, -1
%4 = tail call i64 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %3)
%5 = icmp sgt i64 %4, 0
%6 = select i1 %5, i64 %4, i64 0
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ confirm_array_is_sorted(int *, int);
int *copy_array(int *, int);
int /*<<< orphan*/ finish();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ selection_sort(int *, int);
int /*<<< orphan*/ start();
void test_insertion_sort(int *original, int size) {
  int *array = copy_array(original, size);
  puts("---------- insertion sort");
  start();
  selection_sort(array, size);
  finish();
  confirm_array_is_sorted(array, size);
}


x86 assembly (clang, -O0):
<test_insertion_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <copy_array@plt>
mov    %rax,-0x18(%rbp)
lea    0xe7a(%rip),%rdi
call   1050 <puts@plt>
mov    $0x0,%al
call   1060 <start@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <selection_sort@plt>
mov    $0x0,%al
call   1040 <finish@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <confirm_array_is_sorted@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_insertion_sort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
call   1070 <copy_array@plt>
mov    %rax,%r14
lea    0xe8b(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1060 <start@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <selection_sort@plt>
xor    %eax,%eax
call   1040 <finish@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1080 <confirm_array_is_sorted@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"---------- insertion sort\00"
define void @test_insertion_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32* @copy_array(i32* %6, i32 %7)
store i32* %8, i32** %5
%9 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @start()
%11 = load i32*, i32** %5
%12 = load i32, i32* %4
%13 = call i32 @selection_sort(i32* %11, i32 %12)
%14 = call i32 (...) @finish()
%15 = load i32*, i32** %5
%16 = load i32, i32* %4
%17 = call i32 @confirm_array_is_sorted(i32* %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"---------- insertion sort\00"
define void @test_insertion_sort(i32* %0, i32 %1) {
%3 = tail call i32* @copy_array(i32* %0, i32 %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @start()
%6 = tail call i32 @selection_sort(i32* %3, i32 %1)
%7 = tail call i32 (...) @finish()
%8 = tail call i32 @confirm_array_is_sorted(i32* %3, i32 %1)
ret void
}
/* Variables and functions */
char *foo();
int /*<<< orphan*/ mtrace();
int /*<<< orphan*/ printf(char *, char const *);
int strcmp(char const *, char *);
int main(void) {
  const char *s;
  mtrace();
  s = foo();
  printf("called `foo' from `%s'\n", s);
  return strcmp(s, "filtmod2.c");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <mtrace@plt>
mov    $0x0,%al
call   1050 <foo@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1040 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <mtrace@plt>
xor    %eax,%eax
call   1050 <foo@plt>
mov    %rax,%rbx
lea    0xea7(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcmp@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"called `foo' from `%s'\0A\00"
@.str.1 = [11 x i8] c"filtmod2.c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (...) @mtrace()
%4 = call i8* (...) @foo()
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
@.str = [24 x i8] c"called `foo' from `%s'\0A\00"
@.str.1 = [11 x i8] c"filtmod2.c\00"
define i32 @main() {
%1 = tail call i32 (...) @mtrace()
%2 = tail call i8* (...) @foo()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}
void gtk_path_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_path_type_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pollard_rho(int);
void pr() { pollard_rho(44895587973889); }


x86 assembly (clang, -O0):
<pr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1192bb01,%edi
call   1030 <pollard_rho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr>:
mov    $0x1192bb01,%edi
jmp    1030 <pollard_rho@plt>

LLVM IR (-O0):
define void @pr() {
%1 = call i32 @pollard_rho(i32 294828801)
ret void
}

LLVM IR (-O2):
define void @pr() {
%1 = tail call i32 @pollard_rho(i32 294828801)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void do_exit(int sig) { exit(5); }


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

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

LLVM IR (-O0):
define void @do_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 5)
unreachable
}

LLVM IR (-O2):
define void @do_exit(i32 %0) {
%2 = tail call i32 @exit(i32 5)
unreachable
}
ISR(BADISR_vect) {
  DEBUG("ISR "
        "BADISR"
        " occured");
}


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

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"ISR BADISR occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int getTestSelection() {
  int selection;
  do {
    printf("Ten tests are available. Select a test: ");
    scanf("%i", &selection);
    if (!(0 < selection <= 10))
      printf("Invalid Selection. Try again.\n");
  } while (!(0 < selection <= 10));
  return selection;
}


x86 assembly (clang, -O0):
<getTestSelection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0xa,%eax
jle    1166 <getTestSelection+0x46>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
jmp    116b <getTestSelection+0x4b>
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0xa,%eax
setle  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <getTestSelection+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTestSelection>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Ten tests are available. Select a test: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [31 x i8] c"Invalid Selection. Try again.\0A\00"
define i32 @getTestSelection() {
%1 = alloca i32
br label %2
2: ; preds = %12, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 0, %5
%7 = zext i1 %6 to i32
%8 = icmp sle i32 %7, 10
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
br label %12
12: ; preds = %11
%13 = load i32, i32* %1
%14 = icmp slt i32 0, %13
%15 = zext i1 %14 to i32
%16 = icmp sle i32 %15, 10
%17 = xor i1 %16, true
br i1 %17, label %2, label %18
18: ; preds = %12
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [41 x i8] c"Ten tests are available. Select a test: \00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @getTestSelection() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
unsigned int f43(unsigned int x, int y __attribute__((unused))) {
  return (x >> 1) | (x << ((-1) & (8 * sizeof(unsigned int) - 1)));
}


x86 assembly (clang, -O0):
<f43>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f43(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 = lshr i32 %5, 1
%7 = load i32, i32* %3
%8 = shl i32 %7, 31
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f43(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 31)
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void chs(uint16_t LinearSector, unsigned char *values) {
  values[2] = LinearSector / (2 * 18);
  LinearSector %= (2 * 18);
  values[1] = LinearSector / (18);
  LinearSector %= (18);
  values[0] = LinearSector + 1;
}


x86 assembly (clang, -O0):
<chs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x12,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
mov    $0x12,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<chs>:
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
mov    %cl,0x2(%rsi)
shl    $0x2,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
movsbl %al,%ecx
imul   $0x39,%ecx,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
shr    $0xa,%edx
add    %cl,%dl
mov    %dl,0x1(%rsi)
movzbl %dl,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %cl,%al
add    $0x1,%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @chs(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 36
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 2
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = srem i32 %10, 36
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 18
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %3
%18 = srem i32 %17, 18
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 0
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @chs(i32 %0, i8* nocapture writeonly %1) {
%3 = sdiv i32 %0, 36
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %4, i8* %5
%6 = srem i32 %0, 36
%7 = trunc i32 %6 to i8
%8 = sdiv i8 %7, 18
%9 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %8, i8* %9
%10 = srem i8 %7, 18
%11 = add nsw i8 %10, 1
store i8 %11, i8* %1
ret void
}
int isxmlmeta(int c) {
  return c < 32 || c >= 128 || c == '&' || c == '<' || c == '>' || c == '\'' ||
         c == '"';
}


x86 assembly (clang, -O0):
<isxmlmeta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     116e <isxmlmeta+0x6e>
mov    $0x1,%al
cmpl   $0x80,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jge    116e <isxmlmeta+0x6e>
mov    $0x1,%al
cmpl   $0x26,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <isxmlmeta+0x6e>
mov    $0x1,%al
cmpl   $0x3c,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <isxmlmeta+0x6e>
mov    $0x1,%al
cmpl   $0x3e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <isxmlmeta+0x6e>
mov    $0x1,%al
cmpl   $0x27,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <isxmlmeta+0x6e>
cmpl   $0x22,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxmlmeta>:
lea    -0x80(%rdi),%ecx
mov    $0x1,%eax
cmp    $0xffffffa0,%ecx
jb     1124 <isxmlmeta+0x24>
cmp    $0x3e,%edi
ja     1125 <isxmlmeta+0x25>
mov    %edi,%ecx
movabs $0x500000c000000000,%rdx
bt     %rcx,%rdx
jae    1125 <isxmlmeta+0x25>
ret
xor    %eax,%eax
cmp    $0x22,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isxmlmeta(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 32
br i1 %4, label %23, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 128
br i1 %7, label %23, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 38
br i1 %10, label %23, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 60
br i1 %13, label %23, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 62
br i1 %16, label %23, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 39
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 34
br label %23
23: ; preds = %20, %17, %14, %11, %8, %5, %1
%24 = phi i1 [ true, %17 ], [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %22, %20 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @isxmlmeta(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, -96
br i1 %3, label %8, label %4
4: ; preds = %1
switch i32 %0, label %5 [
i32 62, label %8
i32 60, label %8
i32 39, label %8
i32 38, label %8
]
5: ; preds = %4
%6 = icmp eq i32 %0, 34
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %4, %4, %4, %1, %5
%9 = phi i32 [ 1, %4 ], [ %7, %5 ], [ 1, %1 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ]
ret i32 %9
}
void dfn_acs(_Complex short s) {}


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

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

LLVM IR (-O0):
define void @dfn_acs(i32 %0) {
%2 = alloca { i16, i16 }
%3 = bitcast { i16, i16 }* %2 to i32*
store i32 %0, i32* %3
ret void
}

LLVM IR (-O2):
define void @dfn_acs(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *malloc(size_t);
void *Malloc(size_t size) {
  void *result = malloc(size);
  assert(size == 0 || result != NULL);
  return result;
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1154 <Malloc+0x34>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
sete   %al
test   %r14,%r14
setne  %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i64 %0, 0
%4 = icmp ne i8* %2, null
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i8* %2
}
void str_uppercase(char *str) {
  while (*str) {
    if (*str >= 'a' && *str <= 'z') {
      *str = *str - 'a' + 'A';
    }
    ++str;
  }
}


x86 assembly (clang, -O0):
<str_uppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <str_uppercase+0x5b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     114a <str_uppercase+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     114a <str_uppercase+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <str_uppercase+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_uppercase>:
mov    (%rdi),%al
test   %al,%al
je     112a <str_uppercase+0x2a>
add    $0x1,%rdi
jmp    111b <str_uppercase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <str_uppercase+0x2a>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <str_uppercase+0x10>
add    $0xe0,%al
mov    %al,-0x1(%rdi)
jmp    1110 <str_uppercase+0x10>
ret

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

LLVM IR (-O2):
define void @str_uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
int bitcnt_e(unsigned int a) {
  int count = 0;
  int loop = 0;
  while (a) {
    loop++;
    count++;
    a = a & (a - 1);
  }
  printf("%s:   Loop count: %d\n", __FUNCTION__, loop);
  return count;
}


x86 assembly (clang, -O0):
<bitcnt_e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1158 <bitcnt_e+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <bitcnt_e+0x19>
mov    -0xc(%rbp),%edx
lea    0xe9e(%rip),%rdi
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcnt_e>:
push   %rbx
xor    %ebx,%ebx
test   %edi,%edi
je     112c <bitcnt_e+0x1c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
lea    -0x1(%rdi),%eax
and    %edi,%eax
mov    %eax,%edi
jne    1120 <bitcnt_e+0x10>
lea    0xecd(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"%s: Loop count: %d\0A\00"
@__FUNCTION__.bitcnt_e = [9 x i8] c"bitcnt_e\00"
define i32 @bitcnt_e(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 ]
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.bitcnt_e, i64 0, i64 0), i32 %11)
ret i32 %11
}
/* Type definitions */
struct sockaddr {
  scalar_t__ sa_family;
};

/* Variables and functions */
scalar_t__ AF_INET;
int socket_address_is_ipv6(const struct sockaddr *address) {
  return (address->sa_family != AF_INET);
}


x86 assembly (clang, -O0):
<socket_address_is_ipv6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2ed2(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_address_is_ipv6>:
mov    (%rdi),%rcx
mov    0x2ede(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
setne  %al
ret

LLVM IR (-O0):
%struct.sockaddr = type { i64 }
@AF_INET = global i64 0
define i32 @socket_address_is_ipv6(%struct.sockaddr* %0) {
%2 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %2
%3 = load %struct.sockaddr*, %struct.sockaddr** %2
%4 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @AF_INET
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.sockaddr = type { i64 }
@AF_INET = global i64 0
define i32 @socket_address_is_ipv6(%struct.sockaddr* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @AF_INET
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int test_imm_A4int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xA4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A4int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 164
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_A4int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 704374636544
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UARTDMADisable(unsigned long ulBase, unsigned long ulDMAFlags) {
  DEBUG_ASSERT(UARTBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000048))) &= ~ulDMAFlags;
}


x86 assembly (clang, -O0):
<UARTDMADisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x48(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDMADisable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
not    %rbx
and    %rbx,0x48(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @UARTDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @UARTBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = xor i64 %8, -1
%10 = load i64, i64* %3
%11 = add i64 %10, 72
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @UARTDMADisable(i64 %0, i64 %1) {
%3 = tail call i32 @UARTBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = xor i64 %1, -1
%6 = add i64 %0, 72
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EmitIndented(int, char *, char *);
void EmitTest(int indent, char *name) {
  EmitIndented(indent, "cut_start( \"%s\", 0 );", name);
  EmitIndented(indent, "__CUT__%s();", name);
  EmitIndented(indent, "cut_end( \"%s\" );", name);
}


x86 assembly (clang, -O0):
<EmitTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rsi
call   1030 <EmitIndented@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed6(%rip),%rsi
call   1030 <EmitIndented@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <EmitIndented@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EmitTest>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xee1(%rip),%rsi
mov    %rbx,%rdx
call   1030 <EmitIndented@plt>
lea    0xee8(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
call   1030 <EmitIndented@plt>
lea    0xee4(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <EmitIndented@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"cut_start( \22%s\22, 0 );\00"
@.str.1 = [13 x i8] c"__CUT__%s();\00"
@.str.2 = [17 x i8] c"cut_end( \22%s\22 );\00"
define void @EmitTest(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @EmitIndented(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i32 @EmitIndented(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32, i32* %3
%12 = load i8*, i8** %4
%13 = call i32 @EmitIndented(i32 %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"cut_start( \22%s\22, 0 );\00"
@.str.1 = [13 x i8] c"__CUT__%s();\00"
@.str.2 = [17 x i8] c"cut_end( \22%s\22 );\00"
define void @EmitTest(i32 %0, i8* %1) {
%3 = tail call i32 @EmitIndented(i32 %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @EmitIndented(i32 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = tail call i32 @EmitIndented(i32 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void bzero(void *str, size_t count) { memset(str, 0, count); }


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

x86 assembly (clang, -O2):
<bzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int __bswap_variable_32(int);
__attribute__((always_, const)) uint64_t __bswap_variable_64(uint64_t x) {
  uint32_t in_high = (x >> 32);
  uint32_t in_low = (x & 0xffffffffUL);
  uint32_t out_high = __bswap_variable_32(in_low);
  uint32_t out_low = __bswap_variable_32(in_high);
  return ((((uint64_t)out_high) << 32) | ((uint64_t)out_low));
}


x86 assembly (clang, -O0):
<__bswap_variable_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <__bswap_variable_32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <__bswap_variable_32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bswap_variable_64>:
push   %rax
call   1030 <__bswap_variable_32@plt>
pop    %rax
jmp    1030 <__bswap_variable_32@plt>

LLVM IR (-O0):
define i32 @__bswap_variable_64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 32
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = and i64 %10, 4294967295
%12 = trunc i64 %11 to i32
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @__bswap_variable_32(i32 %13)
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = call i32 @__bswap_variable_32(i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = shl i32 %17, 32
%19 = load i32, i32* %6
%20 = or i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @__bswap_variable_64(i32 %0) {
%2 = tail call i32 @__bswap_variable_32(i32 %0)
%3 = tail call i32 @__bswap_variable_32(i32 poison)
ret i32 poison
}
/* Type definitions */
typedef scalar_t__ int_least16_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_int_least16_t(int_least16_t const k1,
                                          int_least16_t const k2) {
  return k1 < k2;
}


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

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

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

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_int_least16_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int pcibios_read_config_byte(unsigned char, unsigned char, unsigned char,
                             unsigned char *);
extern int __pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn,
                                      unsigned char where, unsigned char *to) {
  return pcibios_read_config_byte(bus, dev_fn, where, to);
}


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

x86 assembly (clang, -O2):
<__pcibios_read_config_byte>:
jmp    1030 <pcibios_read_config_byte@plt>

LLVM IR (-O0):
define i32 @__pcibios_read_config_byte(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8* %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8*
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8* %3, i8** %8
%9 = load i8, i8* %5
%10 = load i8, i8* %6
%11 = load i8, i8* %7
%12 = load i8*, i8** %8
%13 = call i32 @pcibios_read_config_byte(i8 zeroext %9, i8 zeroext %10, i8 zeroext %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @__pcibios_read_config_byte(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8* %3) {
%5 = tail call i32 @pcibios_read_config_byte(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8* %3)
ret i32 %5
}
int imod(int m, int n) {
  if (n <= 0)
    return 0;
  if (m >= 0)
    return m % n;
  {
    int r = -m % n;
    return (r == 0 ? 0 : n - r);
  }
}


x86 assembly (clang, -O0):
<imod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1120 <imod+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1168 <imod+0x68>
cmpl   $0x0,-0x8(%rbp)
jl     1139 <imod+0x39>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
jmp    1168 <imod+0x68>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1159 <imod+0x59>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1162 <imod+0x62>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imod>:
test   %esi,%esi
jle    1111 <imod+0x11>
test   %edi,%edi
js     1114 <imod+0x14>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret
xor    %eax,%eax
ret
neg    %edi
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %edx,%esi
test   %edx,%edx
cmove  %edx,%esi
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @imod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %31
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = srem i32 %14, %15
store i32 %16, i32* %3
br label %31
17: ; preds = %10
%18 = load i32, i32* %4
%19 = sub nsw i32 0, %18
%20 = load i32, i32* %5
%21 = srem i32 %19, %20
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %17
br label %29
25: ; preds = %17
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = sub nsw i32 %26, %27
br label %29
29: ; preds = %25, %24
%30 = phi i32 [ 0, %24 ], [ %28, %25 ]
store i32 %30, i32* %3
br label %31
31: ; preds = %29, %13, %9
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @imod(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, -1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = urem i32 %0, %1
br label %14
8: ; preds = %4
%9 = sub i32 0, %0
%10 = urem i32 %9, %1
%11 = icmp eq i32 %10, 0
%12 = sub i32 %1, %10
%13 = select i1 %11, i32 0, i32 %12
br label %14
14: ; preds = %2, %8, %6
%15 = phi i32 [ %7, %6 ], [ %13, %8 ], [ 0, %2 ]
ret i32 %15
}
/* Type definitions */
struct stat64 {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int compare_geom(struct device *, struct device *);
int init_geom(int fd, struct device *dev, struct device *orig_dev,
              struct stat64 *statbuf) {
  return compare_geom(dev, orig_dev);
}


x86 assembly (clang, -O0):
<init_geom>:
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    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <compare_geom@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_geom>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <compare_geom@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.stat64 = type { i32 }
define i32 @init_geom(i32 %0, %struct.device* %1, %struct.device* %2, %struct.stat64* %3) {
%5 = alloca i32
%6 = alloca %struct.device*
%7 = alloca %struct.device*
%8 = alloca %struct.stat64*
store i32 %0, i32* %5
store %struct.device* %1, %struct.device** %6
store %struct.device* %2, %struct.device** %7
store %struct.stat64* %3, %struct.stat64** %8
%9 = load %struct.device*, %struct.device** %6
%10 = load %struct.device*, %struct.device** %7
%11 = call i32 @compare_geom(%struct.device* %9, %struct.device* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.stat64 = type { i32 }
define i32 @init_geom(i32 %0, %struct.device* %1, %struct.device* %2, %struct.stat64* nocapture readnone %3) {
%5 = tail call i32 @compare_geom(%struct.device* %1, %struct.device* %2)
ret i32 %5
}
/* Variables and functions */
int log(double);
int temp_to_time(double *par, double temp) {
  return -(1 / par[2]) * log((temp - par[0]) / (par[1] - par[0]));
}


x86 assembly (clang, -O0):
<temp_to_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xed3(%rip),%xmm0
divsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<temp_to_time>:
push   %rax
movsd  0xee7(%rip),%xmm1
divsd  0x10(%rdi),%xmm1
movsd  %xmm1,(%rsp)
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm2
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
call   1030 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @temp_to_time(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 2
%7 = load double, double* %6
%8 = fdiv double 1.000000e+00, %7
%9 = fneg double %8
%10 = load double, double* %4
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = fsub double %10, %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = fsub double %17, %20
%22 = fdiv double %14, %21
%23 = call i32 @log(double %22)
%24 = sitofp i32 %23 to double
%25 = fmul double %9, %24
%26 = fptosi double %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @temp_to_time(double* nocapture %0, double %1) {
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = load double, double* %3
%5 = fdiv double -1.000000e+00, %4
%6 = load double, double* %0
%7 = fsub double %1, %6
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fsub double %9, %6
%11 = fdiv double %7, %10
%12 = tail call i32 @log(double %11)
%13 = sitofp i32 %12 to double
%14 = fmul double %5, %13
%15 = fptosi double %14 to i32
ret i32 %15
}
double clad_maxd(double one, double two) { return (one > two) ? one : two; }


x86 assembly (clang, -O0):
<clad_maxd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <clad_maxd+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <clad_maxd+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_maxd>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @clad_maxd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @clad_maxd(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}