xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *, int);
int main() {
  pid_t pid = fork();
  int count = 0;
  ++count;
  if (pid == 0) {
    printf("child count:%d\n", count);
  } else if (pid > 0) {
    printf("parent count:%d\n", count);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1169 <main+0x49>
mov    -0x14(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <main+0x68>
cmpq   $0x0,-0x10(%rbp)
jle    1183 <main+0x63>
mov    -0x14(%rbp),%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <main+0x68>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
je     1138 <main+0x18>
jle    1149 <main+0x29>
lea    0xeda(%rip),%rdi
jmp    113f <main+0x1f>
lea    0xec1(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"child count:%d\0A\00"
@.str.1 = [17 x i8] c"parent count:%d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = icmp sgt i64 %1, 0
br i1 %4, label %5, label %8
5: ; preds = %3, %0
%6 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %3 ]
%7 = tail call i32 @printf(i8* %6, i32 1)
br label %8
8: ; preds = %5, %3
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
int zmtime_left(long timeout) {
  long r;
  struct timeval tv;
  gettimeofday(&tv, 0);
  r = timeout - (tv.tv_sec * 1000 + tv.tv_usec / 1000);
  return r;
}


x86 assembly (clang, -O0):
<zmtime_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
imul   $0x3e8,-0x18(%rbp),%ecx
mov    -0x14(%rbp),%eax
mov    $0x3e8,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x20(%rbp),%rax
add    %edx,%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zmtime_left>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xfffffc18,0x8(%rsp),%eax
ff
movslq 0xc(%rsp),%rcx
imul   $0xffffffffef9db22d,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
add    %eax,%ebx
add    %ecx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @zmtime_left(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca %struct.timeval
store i64 %0, i64* %2
%5 = call i32 @gettimeofday(%struct.timeval* %4, i32 0)
%6 = load i64, i64* %2
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 1000
%13 = add nsw i32 %9, %12
%14 = sext i32 %13 to i64
%15 = sub nsw i64 %6, %14
store i64 %15, i64* %3
%16 = load i64, i64* %3
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @zmtime_left(i64 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul i32 %6, -1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, -1000
%11 = trunc i64 %0 to i32
%12 = add i32 %7, %11
%13 = add i32 %12, %10
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_welcome(void) { printf("Hello!\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"Hello!\00"
define void @print_welcome() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DrawGL();
int /*<<< orphan*/ glutSwapBuffers();
void GlutDrawGL(void) {
  DrawGL();
  glutSwapBuffers();
}


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

x86 assembly (clang, -O2):
<GlutDrawGL>:
push   %rax
xor    %eax,%eax
call   1040 <DrawGL@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glutSwapBuffers@plt>

LLVM IR (-O0):
define void @GlutDrawGL() {
%1 = call i32 (...) @DrawGL()
%2 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
define void @GlutDrawGL() {
%1 = tail call i32 (...) @DrawGL()
%2 = tail call i32 (...) @glutSwapBuffers()
ret void
}
int calculateCharacterValue(char c) { return c - 'a'; }


x86 assembly (clang, -O0):
<calculateCharacterValue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @calculateCharacterValue(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 97
ret i32 %5
}

LLVM IR (-O2):
define i32 @calculateCharacterValue(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -97
ret i32 %3
}
int test_imm_75int16_mem(short *val) {
  return ((*val) & (-0x75 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_75int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -117
%7 = icmp ne i32 %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_75int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -117
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int unsignedint_ignoring_unsignedlongint(unsigned int x,
                                                  unsigned long int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedint_ignoring_unsignedlongint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @unsignedint_ignoring_unsignedlongint(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @unsignedint_ignoring_unsignedlongint(i32 returned %0, i64 %1) {
ret i32 %0
}
int long_float_ne_xxxx(long a, long b) {
  if (a < 0) {
    a = 0x8000000000000000lu - a;
  }
  if (b < 0) {
    b = 0x8000000000000000lu - b;
  }
  return a != b;
}


x86 assembly (clang, -O0):
<long_float_ne_xxxx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1129 <long_float_ne_xxxx+0x29>
movabs $0x8000000000000000,%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1146 <long_float_ne_xxxx+0x46>
movabs $0x8000000000000000,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_float_ne_xxxx>:
movabs $0x8000000000000000,%rcx
mov    %rcx,%rdx
sub    %rdi,%rdx
test   %rdi,%rdi
cmovns %rdi,%rdx
sub    %rsi,%rcx
test   %rsi,%rsi
cmovns %rsi,%rcx
xor    %eax,%eax
cmp    %rcx,%rdx
setne  %al
ret

LLVM IR (-O0):
define i32 @long_float_ne_xxxx(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 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %3
%9 = sub i64 -9223372036854775808, %8
store i64 %9, i64* %3
br label %10
10: ; preds = %7, %2
%11 = load i64, i64* %4
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i64, i64* %4
%15 = sub i64 -9223372036854775808, %14
store i64 %15, i64* %4
br label %16
16: ; preds = %13, %10
%17 = load i64, i64* %3
%18 = load i64, i64* %4
%19 = icmp ne i64 %17, %18
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @long_float_ne_xxxx(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, 0
%4 = sub i64 -9223372036854775808, %0
%5 = select i1 %3, i64 %4, i64 %0
%6 = icmp slt i64 %1, 0
%7 = sub i64 -9223372036854775808, %1
%8 = select i1 %6, i64 %7, i64 %1
%9 = icmp ne i64 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ e_iny();
void e_iny_accu() { e_iny(); }


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

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

LLVM IR (-O0):
define void @e_iny_accu() {
%1 = call i32 (...) @e_iny()
ret void
}

LLVM IR (-O2):
define void @e_iny_accu() {
%1 = tail call i32 (...) @e_iny()
ret void
}
int main() {
  int arg = 0xA0000000;
  int out = 0;
  __asm__("movl %%eax, %0;" : "=r"(out) : "a"(arg));
  return arg == out;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa0000000,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xa0000000,%eax
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xa0000000,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -1610612736, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm "movl %eax, $0;", "=r,{ax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "movl %eax, $0;", "=r,{ax},~{dirflag},~{fpsr},~{flags}"(i32 -1610612736)
%2 = icmp eq i32 %1, -1610612736
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ rtc_read_to_struct(struct tm *, unsigned int *);
time_t rtc_get_epoch(unsigned int *milliseconds) {
  struct tm tm;
  rtc_read_to_struct(&tm, milliseconds);
  return mktime(&tm);
}


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

x86 assembly (clang, -O2):
<rtc_get_epoch>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <rtc_read_to_struct@plt>
mov    %rbx,%rdi
call   1030 <mktime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @rtc_get_epoch(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.tm
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @rtc_read_to_struct(%struct.tm* %3, i32* %4)
%6 = call i32 @mktime(%struct.tm* %3)
ret i32 %6
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @rtc_get_epoch(i32* %0) {
%2 = alloca %struct.tm
%3 = bitcast %struct.tm* %2 to i8*
%4 = call i32 @rtc_read_to_struct(%struct.tm* %2, i32* %0)
%5 = call i32 @mktime(%struct.tm* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ serial_configure_baud_rate(int, int);
int /*<<< orphan*/ serial_configure_buffer(int);
int /*<<< orphan*/ serial_configure_line(int);
int /*<<< orphan*/ serial_configure_modem(int);
void configure_serial() {
  serial_configure_baud_rate(0x3F8, 0x03);
  serial_configure_line(0x3F8);
  serial_configure_buffer(0x3F8);
  serial_configure_modem(0x3F8);
}


x86 assembly (clang, -O0):
<configure_serial>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f8,%edi
mov    $0x3,%esi
call   1050 <serial_configure_baud_rate@plt>
mov    $0x3f8,%edi
call   1040 <serial_configure_line@plt>
mov    $0x3f8,%edi
call   1060 <serial_configure_buffer@plt>
mov    $0x3f8,%edi
call   1030 <serial_configure_modem@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<configure_serial>:
push   %rax
mov    $0x3f8,%edi
mov    $0x3,%esi
call   1050 <serial_configure_baud_rate@plt>
mov    $0x3f8,%edi
call   1040 <serial_configure_line@plt>
mov    $0x3f8,%edi
call   1060 <serial_configure_buffer@plt>
mov    $0x3f8,%edi
pop    %rax
jmp    1030 <serial_configure_modem@plt>

LLVM IR (-O0):
define void @configure_serial() {
%1 = call i32 @serial_configure_baud_rate(i32 1016, i32 3)
%2 = call i32 @serial_configure_line(i32 1016)
%3 = call i32 @serial_configure_buffer(i32 1016)
%4 = call i32 @serial_configure_modem(i32 1016)
ret void
}

LLVM IR (-O2):
define void @configure_serial() {
%1 = tail call i32 @serial_configure_baud_rate(i32 1016, i32 3)
%2 = tail call i32 @serial_configure_line(i32 1016)
%3 = tail call i32 @serial_configure_buffer(i32 1016)
%4 = tail call i32 @serial_configure_modem(i32 1016)
ret void
}
short int GetDriveParam_cx(char drive) {
  if (drive == 0)
    return 0x4F12;
  else
    return 0;
}


x86 assembly (clang, -O0):
<GetDriveParam_cx>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
cmp    $0x0,%eax
jne    1122 <GetDriveParam_cx+0x22>
movw   $0x4f12,-0x2(%rbp)
jmp    1128 <GetDriveParam_cx+0x28>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDriveParam_cx>:
xor    %ecx,%ecx
test   %dil,%dil
mov    $0x4f12,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @GetDriveParam_cx(i8 signext %0) {
%2 = alloca i16
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 20242, i16* %2
br label %9
8: ; preds = %1
store i16 0, i16* %2
br label %9
9: ; preds = %8, %7
%10 = load i16, i16* %2
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @GetDriveParam_cx(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i16 20242, i16 0
ret i16 %3
}
void OSTaskIdleHook(void) {}


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

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

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

LLVM IR (-O2):
define void @OSTaskIdleHook() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void null_write_data(int drive, int side, uint16_t pos, uint8_t data) {
  return;
}


x86 assembly (clang, -O0):
<null_write_data>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @null_write_data(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @null_write_data(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
char isBlank(char c) { return (c == ' ' || c == '\t'); }


x86 assembly (clang, -O0):
<isBlank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <isBlank+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBlank>:
cmp    $0x20,%dil
sete   %cl
cmp    $0x9,%dil
sete   %al
or     %cl,%al
ret

LLVM IR (-O0):
define signext i8 @isBlank(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @isBlank(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Variables and functions */
char *memcpy(char *, char *, scalar_t__);
scalar_t__ strlen(char *);
char *strcpy(char *d, char *s) { return memcpy(d, s, strlen(s) + 1); }


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @memcpy(i8* %5, i8* %6, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %4, i1 false)
ret i8* %0
}
/* Variables and functions */
int get_hardware_revision();
int get_pigpio_version();
int /*<<< orphan*/ printf(char *, ...);
void t0() {
  printf("\nTesting pigpiod C I/F 1\n");
  printf("pigpio version %d.\n", get_pigpio_version());
  printf("Hardware revision %d.\n", get_hardware_revision());
}


x86 assembly (clang, -O0):
<t0>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <get_pigpio_version@plt>
mov    %eax,%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <get_hardware_revision@plt>
mov    %eax,%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t0>:
push   %rax
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <get_pigpio_version@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <get_hardware_revision@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0ATesting pigpiod C I/F 1\0A\00"
@.str.1 = [20 x i8] c"pigpio version %d.\0A\00"
@.str.2 = [23 x i8] c"Hardware revision %d.\0A\00"
define void @t0() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @get_pigpio_version()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @get_hardware_revision()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"pigpio version %d.\0A\00"
@.str.2 = [23 x i8] c"Hardware revision %d.\0A\00"
@str = [25 x i8] c"\0ATesting pigpiod C I/F 1\00"
define void @t0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @get_pigpio_version()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @get_hardware_revision()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_GREEN_LED_PIN() { return 0x01 & (inp_emulate(0x35) >> 1); }


x86 assembly (clang, -O0):
<TOSH_READ_GREEN_LED_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x35,%edi
call   1030 <inp_emulate@plt>
sar    $0x1,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_GREEN_LED_PIN>:
push   %rax
mov    $0x35,%edi
call   1030 <inp_emulate@plt>
shr    %al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_GREEN_LED_PIN() {
%1 = call i32 @inp_emulate(i32 53)
%2 = ashr i32 %1, 1
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_GREEN_LED_PIN() {
%1 = tail call i32 @inp_emulate(i32 53)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 1
%4 = and i8 %3, 1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ game_loop();
int /*<<< orphan*/ init_game(int, char **);
int /*<<< orphan*/ terminate_game();
int main(int argc, char **argv) {
  init_game(argc, argv);
  game_loop();
  terminate_game();
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <init_game@plt>
mov    $0x0,%al
call   1030 <game_loop@plt>
mov    $0x0,%al
call   1050 <terminate_game@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <init_game@plt>
xor    %eax,%eax
call   1030 <game_loop@plt>
xor    %eax,%eax
call   1050 <terminate_game@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init_game(i32 %0, i8** %1)
%4 = tail call i32 (...) @game_loop()
%5 = tail call i32 (...) @terminate_game()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int getsize(FILE *fp) {
  int size;
  fseek(fp, SEEK_SET, 0);
  fscanf(fp, "%d", &size);
  printf("%d\n", size);
  return size;
}


x86 assembly (clang, -O0):
<getsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0xc(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsize>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <fseek@plt>
lea    0xeb1(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <fscanf@plt>
mov    0xc(%rsp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @getsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_SET
%6 = call i32 @fseek(i32* %4, i32 %5, i32 0)
%7 = load i32*, i32** %2
%8 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @getsize(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @fseek(i32* %0, i32 %4, i32 0)
%6 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main() {
  if (""[0] != '\0') {
    write(1, "-DCROSSCOMPILEDIR=", sizeof("-DCROSSCOMPILEDIR=") - 1);
    write(1, "\"", 1);
    write(1, "", sizeof("") - 1);
    write(1, "\"", 1);
    write(1, " -DCROSSCOMPILE ", sizeof(" -DCROSSCOMPILE ") - 1);
  }
  write(1, "-O", sizeof("-O") - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"-O\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void store_u64(uint8_t *buf, uint64_t val) { memcpy(buf, &val, sizeof(val)); }


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

x86 assembly (clang, -O2):
<store_u64>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @store_u64(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 = call i32 @memcpy(i32* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @store_u64(i32* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i32* %0, i32* %3, i32 4)
ret void
}
void serial_puts(char *string) {
  __asm__("mov $0x02, %%eax" ::"b"(string));
  __asm__("int $0x86");
}


x86 assembly (clang, -O0):
<serial_puts>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
mov    $0x2,%eax
int    $0x86
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_puts>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%eax
int    $0x86
pop    %rbx
ret

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

LLVM IR (-O2):
define void @serial_puts(i8* %0) {
tail call void asm sideeffect "mov $$0x02, %eax", "{bx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
tail call void asm sideeffect "int $$0x86", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
__attribute__((always_)) void pgdat_resize_unlock(struct pglist_data *p,
                                                  unsigned long *f) {}


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

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

LLVM IR (-O0):
%struct.pglist_data = type opaque
define void @pgdat_resize_unlock(%struct.pglist_data* %0, i64* %1) {
%3 = alloca %struct.pglist_data*
%4 = alloca i64*
store %struct.pglist_data* %0, %struct.pglist_data** %3
store i64* %1, i64** %4
ret void
}

LLVM IR (-O2):
%struct.pglist_data = type opaque
define void @pgdat_resize_unlock(%struct.pglist_data* nocapture %0, i64* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int main() {
  int *x;
  x = (int *)malloc(8);
  *x = 1234;
  *(x + 1) = 2345;
  ++x;
  return *x;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
movabs $0x929000004d2,%rcx
mov    %rcx,(%rax)
mov    $0x929,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 8)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
store i32 1234, i32* %5
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32 2345, i32* %7
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i32 1
store i32* %9, i32** %2
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to i32*
store i32 1234, i32* %2
%3 = getelementptr inbounds i32, i32* %2, i64 1
store i32 2345, i32* %3
ret i32 2345
}
void dyna_start(void (*code)()) {}


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

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

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

LLVM IR (-O2):
define void @dyna_start(void (...)* nocapture %0) {
ret void
}
char _mtoupper(const char ca) {
  if (ca >= 'a' && ca <= 'z')
    return ca - 'a' + 'A';
  return ca;
}


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

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

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

LLVM IR (-O2):
define signext i8 @_mtoupper(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_length_current_quaddobl_solution_string(int *cursor, int *n) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(527, cursor, n, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_length_current_quaddobl_solution_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x20f,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_length_current_quaddobl_solution_string>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x20f,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_length_current_quaddobl_solution_string(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = load double*, double** %6
%10 = call i32 @_ada_use_c2phc4c(i32 527, i32* %7, i32* %8, double* %9, i32 0)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @solcon_length_current_quaddobl_solution_string(i32* %0, i32* %1) {
%3 = tail call i32 @_ada_use_c2phc4c(i32 527, i32* %0, i32* %1, double* undef, i32 0)
ret i32 %3
}
int ptr2arg(int **x) { return **x + 2; }


x86 assembly (clang, -O0):
<ptr2arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr2arg>:
mov    (%rdi),%rax
mov    (%rax),%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @ptr2arg(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint8_t *bstr16_create(uint8_t *data, uint16_t len) {
  uint8_t *str = malloc(2 + len * sizeof(uint8_t));
  if (!str)
    return 0;
  *((uint16_t *)str) = len;
  memcpy(str + 2, data, len);
  return str;
}


x86 assembly (clang, -O0):
<bstr16_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115e <bstr16_create+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    1183 <bstr16_create+0x63>
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bstr16_create>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x2(,%r15,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1155 <bstr16_create+0x35>
mov    %r15d,(%rbx)
mov    %rbx,%rdi
add    $0x8,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @bstr16_create(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 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = add i64 2, %9
%11 = trunc i64 %10 to i32
%12 = call i32* @malloc(i32 %11)
store i32* %12, i32** %6
%13 = load i32*, i32** %6
%14 = icmp ne i32* %13, null
br i1 %14, label %16, label %15
15: ; preds = %2
store i32* null, i32** %3
br label %25
16: ; preds = %2
%17 = load i32, i32* %5
%18 = load i32*, i32** %6
store i32 %17, i32* %18
%19 = load i32*, i32** %6
%20 = getelementptr inbounds i32, i32* %19, i64 2
%21 = load i32*, i32** %4
%22 = load i32, i32* %5
%23 = call i32 @memcpy(i32* %20, i32* %21, i32 %22)
%24 = load i32*, i32** %6
store i32* %24, i32** %3
br label %25
25: ; preds = %16, %15
%26 = load i32*, i32** %3
ret i32* %26
}

LLVM IR (-O2):
define i32* @bstr16_create(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = or i32 %3, 2
%5 = tail call i32* @malloc(i32 %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
store i32 %1, i32* %5
%8 = getelementptr inbounds i32, i32* %5, i64 2
%9 = tail call i32 @memcpy(i32* %8, i32* %0, i32 %1)
br label %10
10: ; preds = %2, %7
ret i32* %5
}
/* Variables and functions */
int isonum_721(unsigned char *);
int isonum_723(unsigned char *p) { return (isonum_721(p)); }


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

x86 assembly (clang, -O2):
<isonum_723>:
jmp    1030 <isonum_721@plt>

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

LLVM IR (-O2):
define i32 @isonum_723(i8* %0) {
%2 = tail call i32 @isonum_721(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint16_t;

/* Variables and functions */
uint16_t LittleToHostEndian16(const uint16_t In) { return In; }


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

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

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

LLVM IR (-O2):
define i32 @LittleToHostEndian16(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ three();
int main() {
  three();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <three@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <three@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @three()
ret i32 0
}
/* Variables and functions */
int WEXITSTATUS(int);
int WEXITSTATUS_(int status) { return WEXITSTATUS(status); }


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

x86 assembly (clang, -O2):
<WEXITSTATUS_>:
jmp    1030 <WEXITSTATUS@plt>

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

LLVM IR (-O2):
define i32 @WEXITSTATUS_(i32 %0) {
%2 = tail call i32 @WEXITSTATUS(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) { printf("    There are no options for dummy audio.\n"); }


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

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

LLVM IR (-O0):
@.str = [43 x i8] c" There are no options for dummy audio.\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c" There are no options for dummy audio.\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ sched_setaffinity(int /*<<< orphan*/, int,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ testrun(int);
int main(int argc, const char *argv[]) {
  cpu_set_t my_set;
  CPU_ZERO(&my_set);
  CPU_SET(0, &my_set);
  sched_setaffinity(0, sizeof(cpu_set_t), &my_set);
  testrun(23);
  return 0;
}


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)
lea    -0x14(%rbp),%rdi
call   1050 <CPU_ZERO@plt>
xor    %edi,%edi
lea    -0x14(%rbp),%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0x14(%rbp),%rdx
call   1040 <sched_setaffinity@plt>
mov    $0x17,%edi
call   1030 <testrun@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <CPU_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1040 <sched_setaffinity@plt>
mov    $0x17,%edi
call   1030 <testrun@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @CPU_ZERO(i32* %6)
%8 = call i32 @CPU_SET(i32 0, i32* %6)
%9 = call i32 @sched_setaffinity(i32 0, i32 4, i32* %6)
%10 = call i32 @testrun(i32 23)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @CPU_ZERO(i32* %3)
%6 = call i32 @CPU_SET(i32 0, i32* %3)
%7 = call i32 @sched_setaffinity(i32 0, i32 4, i32* %3)
%8 = call i32 @testrun(i32 23)
ret i32 0
}
/* Variables and functions */
int zredis_puny_server_main(int, char **);
int main(int argc, char **argv) { return zredis_puny_server_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <zredis_puny_server_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @zredis_puny_server_main(i32 %0, i8** %1)
ret i32 %3
}
int IDK_Flip(int *flip) {
  *flip = !(*flip);
  return *flip;
}


x86 assembly (clang, -O0):
<IDK_Flip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IDK_Flip>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
sete   %al
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @IDK_Flip(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = load i32*, i32** %2
store i32 %7, i32* %8
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @IDK_Flip(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
store i32 %4, i32* %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printHexByte(unsigned char);
void printHexWord(unsigned short wd) {
  printHexByte((unsigned char)((wd & 0xFF00) >> 8));
  printHexByte((unsigned char)(wd & 0xFF));
}


x86 assembly (clang, -O0):
<printHexWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
movzbl %al,%edi
call   1030 <printHexByte@plt>
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
movzbl %al,%edi
call   1030 <printHexByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHexWord>:
push   %rbx
mov    %edi,%ebx
shr    $0x8,%edi
call   1030 <printHexByte@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <printHexByte@plt>

LLVM IR (-O0):
define void @printHexWord(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 65280
%6 = ashr i32 %5, 8
%7 = trunc i32 %6 to i8
%8 = call i32 @printHexByte(i8 zeroext %7)
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i8
%13 = call i32 @printHexByte(i8 zeroext %12)
ret void
}

LLVM IR (-O2):
define void @printHexWord(i16 zeroext %0) {
%2 = lshr i16 %0, 8
%3 = trunc i16 %2 to i8
%4 = tail call i32 @printHexByte(i8 zeroext %3)
%5 = trunc i16 %0 to i8
%6 = tail call i32 @printHexByte(i8 zeroext %5)
ret void
}
/* Variables and functions */
unsigned int __gnu_h2f_internal(unsigned short, int);
unsigned int __hsail_f16_to_f32(unsigned short a) {
  return __gnu_h2f_internal(a, 1);
}


x86 assembly (clang, -O0):
<__hsail_f16_to_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x1,%esi
movzwl -0x2(%rbp),%edi
call   1030 <__gnu_h2f_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_f16_to_f32>:
mov    $0x1,%esi
jmp    1030 <__gnu_h2f_internal@plt>

LLVM IR (-O0):
define i32 @__hsail_f16_to_f32(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @__gnu_h2f_internal(i16 zeroext %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @__hsail_f16_to_f32(i16 zeroext %0) {
%2 = tail call i32 @__gnu_h2f_internal(i16 zeroext %0, i32 1)
ret i32 %2
}