xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printHeader();
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printHeader();
  printf("Upload the SMBusb firmware to a Cypress device with a different "
         "VID:PID than the devboard\n");
  printf("\n");
  printf("usage: ./smbusb_bootstrap -d VID:PID\n");
  printf("eg: ./smbusb_bootstrap -d 04B4:1234\n");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <printHeader@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xf66(%rip),%rdi
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2b(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
xor    %eax,%eax
call   1050 <printHeader@plt>
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf05(%rip),%rdi
call   1040 <puts@plt>
lea    0xf1e(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [91 x i8] c"Upload the SMBusb firmware to a Cypress device with a different VID:PID than the devboard\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [38 x i8] c"usage: ./smbusb_bootstrap -d VID:PID\0A\00"
@.str.3 = [37 x i8] c"eg: ./smbusb_bootstrap -d 04B4:1234\0A\00"
define void @printUsage() {
%1 = call i32 (...) @printHeader()
%2 = call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [90 x i8] c"Upload the SMBusb firmware to a Cypress device with a different VID:PID than the devboard\00"
@str.4 = [37 x i8] c"usage: ./smbusb_bootstrap -d VID:PID\00"
@str.5 = [36 x i8] c"eg: ./smbusb_bootstrap -d 04B4:1234\00"
define void @printUsage() {
%1 = tail call i32 (...) @printHeader()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([90 x i8], [90 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.5, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
scalar_t__ toupper(char);
char *to_upper_a(char *string) {
  for (int i = 0; i < strlen(string); i++) {
    string[i] = (char)toupper(string[i]);
  }
  return string;
}


x86 assembly (clang, -O0):
<to_upper_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <to_upper_a+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <to_upper_a+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_upper_a>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <to_upper_a+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <to_upper_a+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @to_upper_a(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %1
ret i8* %0
5: ; preds = %1, %5
%6 = phi i64 [ %11, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i64 @toupper(i8 signext %8)
%10 = trunc i64 %9 to i8
store i8 %10, i8* %7
%11 = add nuw nsw i64 %6, 1
%12 = tail call i32 @strlen(i8* %0)
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %5, label %4
}
int sprint_symbol_no_offset(char *buffer, unsigned long addr) {
  *buffer = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<sprint_symbol_no_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_symbol_no_offset>:
movb   $0x0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sprint_symbol_no_offset(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
store i8 0, i8* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @sprint_symbol_no_offset(i8* nocapture writeonly %0, i64 %1) {
store i8 0, i8* %0
ret i32 0
}
/* Variables and functions */
int con_put(char *, char);
int con_show_cursor(int yes) { return con_put("\x1b[?25%c", yes ? 'h' : 'l'); }


x86 assembly (clang, -O0):
<con_show_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x6c,%eax
mov    $0x68,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xecb(%rip),%rdi
movsbl %al,%esi
call   1030 <con_put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<con_show_cursor>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    0x68(,%rax,4),%esi
lea    0xedb(%rip),%rdi
jmp    1030 <con_put@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[?25%c\00"
define i32 @con_show_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 104, i32 108
%7 = trunc i32 %6 to i8
%8 = call i32 @con_put(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[?25%c\00"
define i32 @con_show_cursor(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8 108, i8 104
%4 = tail call i32 @con_put(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int inb(int);
uint32_t fw_cfg_readw_le(void) {
  uint32_t val;
  val = inb(0x511);
  val = (inb(0x511) << 8) | val;
  return val;
}


x86 assembly (clang, -O0):
<fw_cfg_readw_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,-0x4(%rbp)
mov    $0x511,%edi
call   1030 <inb@plt>
shl    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fw_cfg_readw_le>:
push   %rbx
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,%ebx
mov    $0x511,%edi
call   1030 <inb@plt>
shl    $0x8,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fw_cfg_readw_le() {
%1 = alloca i32
%2 = call i32 @inb(i32 1297)
store i32 %2, i32* %1
%3 = call i32 @inb(i32 1297)
%4 = shl i32 %3, 8
%5 = load i32, i32* %1
%6 = or i32 %4, %5
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @fw_cfg_readw_le() {
%1 = tail call i32 @inb(i32 1297)
%2 = tail call i32 @inb(i32 1297)
%3 = shl i32 %2, 8
%4 = or i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stdout, "output\n");
  fprintf(stderr, "errout\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"output\0A\00"
@stderr = global i32 0
@.str.1 = [8 x i8] c"errout\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"output\0A\00"
@stderr = global i32 0
@.str.1 = [8 x i8] c"errout\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll39(struct __test_metadata *);
void wrapper_epoll39(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll39(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll39>:
jmp    1030 <epoll39@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll39(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll39(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll39(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll39(%struct.__test_metadata* %0)
ret void
}
void f(int a[10]) {}


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

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

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

LLVM IR (-O2):
define void @f(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char *);
int has_feature(const char *feat) {
  if (!strcmp(feat, "11w"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<has_feature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1141 <has_feature+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <has_feature+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_feature>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"11w\00"
define i32 @has_feature(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ measure_time();
void sig_handler(int signum) {
  if (SIGINT == signum) {
    measure_time();
    exit(0);
  }
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jne    114b <sig_handler+0x2b>
mov    $0x0,%al
call   1030 <measure_time@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
je     112e <sig_handler+0xe>
pop    %rax
ret
xor    %eax,%eax
call   1030 <measure_time@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGINT
%4 = load i32, i32* %2
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 (...) @measure_time()
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @sig_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (...) @measure_time()
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret void
}
void testSwap_16_ptr(void) {}


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

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

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

LLVM IR (-O2):
define void @testSwap_16_ptr() {
ret void
}
int MPIU_is_pof2(int val, int *ceil_pof2) {
  int pof2 = 1;
  while (pof2 < val)
    pof2 *= 2;
  if (ceil_pof2)
    *ceil_pof2 = pof2;
  if (pof2 == val)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<MPIU_is_pof2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    112c <MPIU_is_pof2+0x2c>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <MPIU_is_pof2+0x12>
cmpq   $0x0,-0x10(%rbp)
je     1140 <MPIU_is_pof2+0x40>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1158 <MPIU_is_pof2+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <MPIU_is_pof2+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPIU_is_pof2>:
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%ecx
lea    (%rcx,%rcx,1),%eax
cmp    %edi,%ecx
jl     1110 <MPIU_is_pof2+0x10>
test   %rsi,%rsi
je     1120 <MPIU_is_pof2+0x20>
mov    %ecx,(%rsi)
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @MPIU_is_pof2(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
store i32 1, i32* %6
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %6
%13 = mul nsw i32 %12, 2
store i32 %13, i32* %6
br label %7
14: ; preds = %7
%15 = load i32*, i32** %5
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %6
%19 = load i32*, i32** %5
store i32 %18, i32* %19
br label %20
20: ; preds = %17, %14
%21 = load i32, i32* %6
%22 = load i32, i32* %4
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %3
br label %26
25: ; preds = %20
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @MPIU_is_pof2(i32 %0, i32* writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 1, %2 ], [ %6, %3 ]
%5 = icmp slt i32 %4, %0
%6 = shl nsw i32 %4, 1
br i1 %5, label %3, label %7
7: ; preds = %3
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 %4, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32 %4, %0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void set_type(uint32_t addr[8], uint32_t type) { addr[4] = type; }


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

x86 assembly (clang, -O2):
<set_type>:
mov    %esi,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @set_type(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int size;
typedef int ps;

/* Variables and functions */
int /*<<< orphan*/ _SC_PAGE_SIZE;
int /*<<< orphan*/ munmap(char *, int);
size_t sysconf(int /*<<< orphan*/);
void unmap_file(char *map, size_t size) {
  size_t ps = sysconf(_SC_PAGE_SIZE);
  munmap(map, (((size) + (ps)-1) & ~((ps)-1)));
}


x86 assembly (clang, -O0):
<unmap_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
mov    %eax,%esi
call   1030 <munmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmap_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    (%rbx,%rax,1),%esi
add    $0xffffffff,%esi
neg    %eax
and    %eax,%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <munmap@plt>

LLVM IR (-O0):
@_SC_PAGE_SIZE = global i32 0
define void @unmap_file(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 i32, i32* @_SC_PAGE_SIZE
%7 = call i64 @sysconf(i32 %6)
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = add i64 %9, %10
%12 = sub i64 %11, 1
%13 = load i64, i64* %5
%14 = sub i64 %13, 1
%15 = xor i64 %14, -1
%16 = and i64 %12, %15
%17 = trunc i64 %16 to i32
%18 = call i32 @munmap(i8* %8, i32 %17)
ret void
}

LLVM IR (-O2):
@_SC_PAGE_SIZE = global i32 0
define void @unmap_file(i8* %0, i64 %1) {
%3 = load i32, i32* @_SC_PAGE_SIZE
%4 = tail call i64 @sysconf(i32 %3)
%5 = add i64 %1, 4294967295
%6 = add i64 %5, %4
%7 = sub i64 0, %4
%8 = and i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = tail call i32 @munmap(i8* %0, i32 %9)
ret void
}
void initGPIOs() {}


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

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

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

LLVM IR (-O2):
define void @initGPIOs() {
ret void
}
/* Type definitions */
struct IMSTREAM {
  int dummy;
};

/* Variables and functions */
long ims_read(struct IMSTREAM *, void *, long);
long ims_peek(struct IMSTREAM *stream, void *buf, long size) {
  return ims_read(stream, buf, -size);
}


x86 assembly (clang, -O0):
<ims_peek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
sub    -0x18(%rbp),%rdx
call   1030 <ims_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ims_peek>:
neg    %rdx
jmp    1030 <ims_read@plt>

LLVM IR (-O0):
%struct.IMSTREAM = type { i32 }
define i64 @ims_peek(%struct.IMSTREAM* %0, i8* %1, i64 %2) {
%4 = alloca %struct.IMSTREAM*
%5 = alloca i8*
%6 = alloca i64
store %struct.IMSTREAM* %0, %struct.IMSTREAM** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.IMSTREAM*, %struct.IMSTREAM** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = sub nsw i64 0, %9
%11 = call i64 @ims_read(%struct.IMSTREAM* %7, i8* %8, i64 %10)
ret i64 %11
}

LLVM IR (-O2):
%struct.IMSTREAM = type { i32 }
define i64 @ims_peek(%struct.IMSTREAM* %0, i8* %1, i64 %2) {
%4 = sub nsw i64 0, %2
%5 = tail call i64 @ims_read(%struct.IMSTREAM* %0, i8* %1, i64 %4)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, double *);
double sio_sync_read_double(void) {
  double d;
  scanf("%lf", &d);
  return d;
}


x86 assembly (clang, -O0):
<sio_sync_read_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sio_sync_read_double>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <scanf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define double @sio_sync_read_double() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *);
void hasarg(int i, int argc, char *opt, char *type) {
  if (i + 1 < argc)
    return;
  printf("Option '%s' needs an argument (%s).\n", opt, type);
  exit(1);
}


x86 assembly (clang, -O0):
<hasarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    114b <hasarg+0x2b>
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<hasarg>:
add    $0x1,%edi
cmp    %esi,%edi
jge    1128 <hasarg+0x8>
ret
push   %rax
lea    0xed0(%rip),%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Option '%s' needs an argument (%s).\0A\00"
define void @hasarg(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %4
ret void
14: ; preds = %4
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16)
%18 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [37 x i8] c"Option '%s' needs an argument (%s).\0A\00"
define void @hasarg(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = add nsw i32 %0, 1
%6 = icmp slt i32 %5, %1
br i1 %6, label %7, label %8
7: ; preds = %4
ret void
8: ; preds = %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_label_terminator();
int /*<<< orphan*/ print_label(int);
void generate_label(int nlab) {
  print_label(nlab);
  output_label_terminator();
  newline();
}


x86 assembly (clang, -O0):
<generate_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <print_label@plt>
mov    $0x0,%al
call   1050 <output_label_terminator@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_label>:
push   %rax
call   1040 <print_label@plt>
xor    %eax,%eax
call   1050 <output_label_terminator@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <newline@plt>

LLVM IR (-O0):
define void @generate_label(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @print_label(i32 %3)
%5 = call i32 (...) @output_label_terminator()
%6 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
define void @generate_label(i32 %0) {
%2 = tail call i32 @print_label(i32 %0)
%3 = tail call i32 (...) @output_label_terminator()
%4 = tail call i32 (...) @newline()
ret void
}
void s3c_fimc_setname(int id, char *name) {
  switch (id) {}
}


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

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

LLVM IR (-O0):
define void @s3c_fimc_setname(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
switch i32 %5, label %6 [
]
6: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @s3c_fimc_setname(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int soc_is_qca9533();
int soc_is_qca953x(void) { return soc_is_qca9533(); }


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

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

LLVM IR (-O0):
define i32 @soc_is_qca953x() {
%1 = call i32 (...) @soc_is_qca9533()
ret i32 %1
}

LLVM IR (-O2):
define i32 @soc_is_qca953x() {
%1 = tail call i32 (...) @soc_is_qca9533()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *);
int /*<<< orphan*/ stderr;
void defaultErrFunc(int errnum, const char *errmsg) {
  fprintf(stderr, "Error #%d : '%s'\n", errnum, errmsg);
  exit(errnum);
}


x86 assembly (clang, -O0):
<defaultErrFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<defaultErrFunc>:
push   %rbx
mov    %rsi,%rcx
mov    %edi,%ebx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Error #%d : '%s'\0A\00"
define void @defaultErrFunc(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = load i32, i32* %3
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Error #%d : '%s'\0A\00"
define void @defaultErrFunc(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%5 = tail call i32 @exit(i32 %0)
unreachable
}
void RasterFIFODMADelayConfig(unsigned int baseAddr, unsigned int delay) {
  (*((volatile unsigned int *)(baseAddr + (0x28)))) &= ~(0x000FF000u);
  (*((volatile unsigned int *)(baseAddr + (0x28)))) |= (delay << (0x0000000Cu));
}


x86 assembly (clang, -O0):
<RasterFIFODMADelayConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfff00fff,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
shl    $0xc,%edx
mov    -0x4(%rbp),%eax
add    $0x28,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterFIFODMADelayConfig>:
add    $0x28,%edi
andl   $0xfff00fff,(%rdi)
shl    $0xc,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @RasterFIFODMADelayConfig(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 = add i32 %5, 40
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -1044481
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = shl i32 %11, 12
%13 = load i32, i32* %3
%14 = add i32 %13, 40
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @RasterFIFODMADelayConfig(i32 %0, i32 %1) {
%3 = add i32 %0, 40
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -1044481
store volatile i32 %7, i32* %5
%8 = shl i32 %1, 12
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
/* Variables and functions */
double pow(double, double);
double dB(double n) { return pow(10.0, n / 20.0); }


x86 assembly (clang, -O0):
<dB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xede(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dB>:
movapd %xmm0,%xmm1
divsd  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @dB(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 2.000000e+01
%5 = call double @pow(double 1.000000e+01, double %4)
ret double %5
}

LLVM IR (-O2):
define double @dB(double %0) {
%2 = fdiv double %0, 2.000000e+01
%3 = tail call double @pow(double 1.000000e+01, double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int);
void decsel(int pn1) { do_csi("?%dK", pn1); }


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

x86 assembly (clang, -O2):
<decsel>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <do_csi@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"?%dK\00"
define void @decsel(i32 %0) {
%2 = tail call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int write_int(char *, int const, size_t);
int option_write_int(char *out, const void *in, size_t n) {
  const int *in_int = in;
  return write_int(out, *in_int, n);
}


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

x86 assembly (clang, -O2):
<option_write_int>:
mov    (%rsi),%esi
jmp    1030 <write_int@plt>

LLVM IR (-O0):
define i32 @option_write_int(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i8*, i8** %4
%11 = load i32*, i32** %7
%12 = load i32, i32* %11
%13 = load i64, i64* %6
%14 = call i32 @write_int(i8* %10, i32 %12, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @option_write_int(i8* %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @write_int(i8* %0, i32 %5, i64 %2)
ret i32 %6
}
/* Variables and functions */
int S_IFIFO;
int /*<<< orphan*/ abort_report(char *, ...);
int mknod(char const *, int, int /*<<< orphan*/);
void fifo_creat(const char *path, int perm) {
  if ((mknod(path, S_IFIFO | perm, 0)) == -1) {
    (1 == 1) ? abort_report("Fee! Fie! Foe! Fum! The FIFO failed to open!", "")
             : abort_report("Fee! Fie! Foe! Fum! The FIFO failed to open!");
  }
}


x86 assembly (clang, -O0):
<fifo_creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
or     -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <mknod@plt>
cmp    $0xffffffff,%eax
jne    1164 <fifo_creat+0x44>
lea    0xeaa(%rip),%rdi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <abort_report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifo_creat>:
push   %rax
mov    0x2eb8(%rip),%rax
or     (%rax),%esi
xor    %edx,%edx
call   1040 <mknod@plt>
cmp    $0xffffffff,%eax
je     1138 <fifo_creat+0x18>
pop    %rax
ret
lea    0xec1(%rip),%rdi
lea    0xee6(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <abort_report@plt>

LLVM IR (-O0):
@S_IFIFO = global i32 0
@.str = [45 x i8] c"Fee! Fie! Foe! Fum! The FIFO failed to open!\00"
@.str.1 = [1 x i8] zeroinitializer
define void @fifo_creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @S_IFIFO
%7 = load i32, i32* %4
%8 = or i32 %6, %7
%9 = call i32 @mknod(i8* %5, i32 %8, i32 0)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@S_IFIFO = global i32 0
@.str = [45 x i8] c"Fee! Fie! Foe! Fum! The FIFO failed to open!\00"
@.str.1 = [1 x i8] zeroinitializer
define void @fifo_creat(i8* %0, i32 %1) {
%3 = load i32, i32* @S_IFIFO
%4 = or i32 %3, %1
%5 = tail call i32 @mknod(i8* %0, i32 %4, i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret void
}
/* Variables and functions */
long long GetMsg258(unsigned long);
long long getmsg(unsigned long uM) { return GetMsg258(uM); }


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

x86 assembly (clang, -O2):
<getmsg>:
jmp    1030 <GetMsg258@plt>

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

LLVM IR (-O2):
define i64 @getmsg(i64 %0) {
%2 = tail call i64 @GetMsg258(i64 %0)
ret i64 %2
}
int foo(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 2
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 2
}
/* Variables and functions */
long double log(int);
long double log1pl(long double x) { return log(1 + x); }


x86 assembly (clang, -O0):
<log1pl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld1
faddp  %st,%st(1)
fnstcw -0x16(%rbp)
movzwl -0x16(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x18(%rbp)
fldcw  -0x18(%rbp)
fistpl -0x14(%rbp)
fldcw  -0x16(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <log@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log1pl>:
fldt   0x8(%rsp)
fld1
faddp  %st,%st(1)
fnstcw -0x8(%rsp)
movzwl -0x8(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0x6(%rsp)
fldcw  -0x6(%rsp)
fistpl -0x4(%rsp)
fldcw  -0x8(%rsp)
mov    -0x4(%rsp),%edi
jmp    1030 <log@plt>

LLVM IR (-O0):
define x86_fp80 @log1pl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fadd x86_fp80 0xK3FFF8000000000000000, %3
%5 = fptosi x86_fp80 %4 to i32
%6 = call x86_fp80 @log(i32 %5)
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @log1pl(x86_fp80 %0) {
%2 = fadd x86_fp80 %0, 0xK3FFF8000000000000000
%3 = fptosi x86_fp80 %2 to i32
%4 = tail call x86_fp80 @log(i32 %3)
ret x86_fp80 %4
}
/* Variables and functions */
char const *strpbrk(char *, char *);
const char *check_bad_chars(char *invalid_chars, char *string_to_check) {
  return strpbrk(string_to_check, invalid_chars);
}


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

x86 assembly (clang, -O2):
<check_bad_chars>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <strpbrk@plt>

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

LLVM IR (-O2):
define i8* @check_bad_chars(i8* nocapture %0, i8* %1) {
%3 = tail call i8* @strpbrk(i8* %1, i8* %0)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int __infer_nondet_int();
int iswalnum(wint_t wc) { return __infer_nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @iswalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @iswalnum(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
int a_twist_r_on_corner(corner)
int corner;
{
  int temp_arr[8];
  a_corner_unpack(corner, temp_arr);
  four_cycle(temp_arr, 4, 7, 1, 0);
  adjust_corner(temp_arr, 4, 7, 1, 0);
  return a_corner_pack(temp_arr);
}


x86 assembly (clang, -O0):
<a_twist_r_on_corner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1030 <a_corner_unpack@plt>
lea    -0x30(%rbp),%rdi
mov    $0x4,%esi
mov    $0x7,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    $0x0,%al
call   1050 <four_cycle@plt>
lea    -0x30(%rbp),%rdi
mov    $0x4,%esi
mov    $0x7,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    $0x0,%al
call   1040 <adjust_corner@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1060 <a_corner_pack@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_twist_r_on_corner>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <a_corner_unpack@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x7,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1050 <four_cycle@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x7,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1040 <adjust_corner@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <a_corner_pack@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @a_twist_r_on_corner(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_corner_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 4, i32 7, i32 1, i32 0)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @adjust_corner to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %9, i32 4, i32 7, i32 1, i32 0)
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%12 = call i32 (i32*, ...) bitcast (i32 (...)* @a_corner_pack to i32 (i32*, ...)*)(i32* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @a_twist_r_on_corner(i32 %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_corner_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 4, i32 7, i32 1, i32 0)
%7 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @adjust_corner to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 4, i32 7, i32 1, i32 0)
%8 = call i32 (i32*, ...) bitcast (i32 (...)* @a_corner_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_outl(unsigned int, int);
void main(void) {
  unsigned csbase, csmask;
  csbase = 0x40;
  csmask = 0xfe00;
  __builtin_outl(csbase, 0x40);
  __builtin_outl(csmask, 0x60);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x40,%edi
mov    $0x40,%esi
call   1030 <__builtin_outl@plt>
mov    $0xfe00,%edi
mov    $0x60,%esi
pop    %rax
jmp    1030 <__builtin_outl@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 64, i32* %1
store i32 65024, i32* %2
%3 = load i32, i32* %1
%4 = call i32 @__builtin_outl(i32 %3, i32 64)
%5 = load i32, i32* %2
%6 = call i32 @__builtin_outl(i32 %5, i32 96)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @__builtin_outl(i32 64, i32 64)
%2 = tail call i32 @__builtin_outl(i32 65024, i32 96)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TestChecksum();
int main(int argc, char *argv[]) {
  TestChecksum();
  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   1030 <TestChecksum@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <TestChecksum@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 = call i32 (...) @TestChecksum()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @TestChecksum()
ret i32 0
}
long read_long(const unsigned char *p) {
  return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}


x86 assembly (clang, -O0):
<read_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_long>:
movzbl (%rdi),%eax
shl    $0x18,%eax
movzbl 0x1(%rdi),%ecx
shl    $0x10,%rcx
cltq
or     %rcx,%rax
movzbl 0x2(%rdi),%ecx
shl    $0x8,%rcx
or     %rax,%rcx
movzbl 0x3(%rdi),%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @read_long(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
%25 = sext i32 %24 to i64
ret i64 %25
}

LLVM IR (-O2):
define i64 @read_long(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
%19 = sext i32 %18 to i64
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ moveCursorLeft();
int /*<<< orphan*/ terminal_putchar(char);
void backspace() {
  moveCursorLeft();
  terminal_putchar(' ');
  moveCursorLeft();
}


x86 assembly (clang, -O0):
<backspace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <moveCursorLeft@plt>
mov    $0x20,%edi
call   1030 <terminal_putchar@plt>
mov    $0x0,%al
call   1040 <moveCursorLeft@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<backspace>:
push   %rax
xor    %eax,%eax
call   1040 <moveCursorLeft@plt>
mov    $0x20,%edi
call   1030 <terminal_putchar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <moveCursorLeft@plt>

LLVM IR (-O0):
define void @backspace() {
%1 = call i32 (...) @moveCursorLeft()
%2 = call i32 @terminal_putchar(i8 signext 32)
%3 = call i32 (...) @moveCursorLeft()
ret void
}

LLVM IR (-O2):
define void @backspace() {
%1 = tail call i32 (...) @moveCursorLeft()
%2 = tail call i32 @terminal_putchar(i8 signext 32)
%3 = tail call i32 (...) @moveCursorLeft()
ret void
}
/* Variables and functions */
float atan2(float, float);
float Float_atan2(float y, float x) { return atan2(y, x); }


x86 assembly (clang, -O0):
<Float_atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Float_atan2>:
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define float @Float_atan2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @atan2(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @Float_atan2(float %0, float %1) {
%3 = tail call float @atan2(float %0, float %1)
ret float %3
}