xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ VirtualizeTimerC__0__Timer__stop(unsigned int);
void Msp430RefVoltGeneratorP__SwitchOffSettleTimer__stop(void) {
  VirtualizeTimerC__0__Timer__stop(8U);
}


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

x86 assembly (clang, -O2):
<Msp430RefVoltGeneratorP__SwitchOffSettleTimer__stop>:
mov    $0x8,%edi
jmp    1030 <VirtualizeTimerC__0__Timer__stop@plt>

LLVM IR (-O0):
define void @Msp430RefVoltGeneratorP__SwitchOffSettleTimer__stop() {
%1 = call i32 @VirtualizeTimerC__0__Timer__stop(i32 8)
ret void
}

LLVM IR (-O2):
define void @Msp430RefVoltGeneratorP__SwitchOffSettleTimer__stop() {
%1 = tail call i32 @VirtualizeTimerC__0__Timer__stop(i32 8)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t dv_int64_t(int64_t a, int64_t b) { return a / b; }


x86 assembly (clang, -O0):
<dv_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv_int64_t>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @dv_int64_t(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
void _clr_msg(unsigned char *u) { u[0] = u[1] = u[2] = u[3] = 0; }


x86 assembly (clang, -O0):
<_clr_msg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_clr_msg>:
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @_clr_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
store i8 0, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 2
store i8 0, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 0, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 0, i8* %10
ret void
}

LLVM IR (-O2):
define void @_clr_msg(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 0, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void _print_charptr(void *d) { printf("%s", (char *)d); }


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

x86 assembly (clang, -O2):
<_print_charptr>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @_print_charptr(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int nat64_is_stateful(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nat64_is_stateful() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usb_hub_exit();
int /*<<< orphan*/ usb_mouse_exit();
int /*<<< orphan*/ usb_okijob_exit();
void usbhdriver_exit(void) {
  usb_okijob_exit();
  usb_mouse_exit();
  usb_hub_exit();
}


x86 assembly (clang, -O0):
<usbhdriver_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <usb_okijob_exit@plt>
mov    $0x0,%al
call   1040 <usb_mouse_exit@plt>
mov    $0x0,%al
call   1050 <usb_hub_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usbhdriver_exit>:
push   %rax
xor    %eax,%eax
call   1030 <usb_okijob_exit@plt>
xor    %eax,%eax
call   1040 <usb_mouse_exit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <usb_hub_exit@plt>

LLVM IR (-O0):
define void @usbhdriver_exit() {
%1 = call i32 (...) @usb_okijob_exit()
%2 = call i32 (...) @usb_mouse_exit()
%3 = call i32 (...) @usb_hub_exit()
ret void
}

LLVM IR (-O2):
define void @usbhdriver_exit() {
%1 = tail call i32 (...) @usb_okijob_exit()
%2 = tail call i32 (...) @usb_mouse_exit()
%3 = tail call i32 (...) @usb_hub_exit()
ret void
}
int main(void) {
  int counter = 0;
  for (;; counter++) {
    int a;
    if (counter > 5) {
      break;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    1121 <main+0x21>
jmp    1134 <main+0x34>
jmp    1126 <main+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void do_return() { puts("\tret"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\09ret\00"
define void @do_return() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int expect(char *, char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
bool expect_error(char *expr, char *opts, char *message) {
  char str[512];
  snprintf(str, 512, "Error: %s", message);
  return expect(expr, opts, str);
}


x86 assembly (clang, -O0):
<expect_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x200,%esi
lea    0xeb2(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x220(%rbp),%rdx
call   1030 <expect@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_error>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rdx,%rcx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec4(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x200,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <expect@plt>
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Error: %s\00"
define i32 @expect_error(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [512 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %6
%10 = call i32 @snprintf(i8* %8, i32 512, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%14 = call i32 @expect(i8* %11, i8* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [10 x i8] c"Error: %s\00"
define i32 @expect_error(i8* %0, i8* %1, i8* %2) {
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 512, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = call i32 @expect(i8* %0, i8* %1, i8* %5)
ret i32 %7
}
__attribute__((always_)) int func6b(int x) { return x < 14 ? 3 : 2; }


x86 assembly (clang, -O0):
<func6b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x2,%eax
mov    $0x3,%ecx
cmp    $0xe,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func6b>:
xor    %eax,%eax
cmp    $0xe,%edi
setl   %al
or     $0x2,%eax
ret

LLVM IR (-O0):
define i32 @func6b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 14
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 3, i32 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @func6b(i32 %0) {
%2 = icmp slt i32 %0, 14
%3 = select i1 %2, i32 3, i32 2
ret i32 %3
}
void gtk_widget_get_colormap() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_colormap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void delay(unsigned long ms) { usleep(ms * 1000); }


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

x86 assembly (clang, -O2):
<delay>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000
%5 = call i32 @usleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @delay(i64 %0) {
%2 = mul i64 %0, 1000
%3 = tail call i32 @usleep(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearError();
scalar_t__ dlclose(void *);
int /*<<< orphan*/ logError();
void unloadSharedObject(void *object) {
  clearError();
  if (dlclose(object))
    logError();
}


x86 assembly (clang, -O0):
<unloadSharedObject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clearError@plt>
mov    -0x8(%rbp),%rdi
call   1050 <dlclose@plt>
cmp    $0x0,%rax
je     115d <unloadSharedObject+0x2d>
mov    $0x0,%al
call   1040 <logError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unloadSharedObject>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clearError@plt>
mov    %rbx,%rdi
call   1050 <dlclose@plt>
test   %rax,%rax
je     1150 <unloadSharedObject+0x20>
xor    %eax,%eax
pop    %rbx
jmp    1040 <logError@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @unloadSharedObject(i8* %0) {
%2 = tail call i32 (...) @clearError()
%3 = tail call i64 @dlclose(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @logError()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int ch) {
  if (islower(ch))
    return ch ^ 0x20;
  return ch;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x8(%rbp),%eax
xor    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
mov    %ebx,%ecx
xor    $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @islower(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = xor i32 %8, 32
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = xor i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cbhelp(void) {
  printf("Controls:\n\n    date    -echo string, expanding date (strftime "
         "compatible)\n    echo    -echo string.\n    _echo   -echo string "
         "without training new line.\n    store   -store variable to file.\n   "
         " restore -restore variable from file.\n\nBuilt in variables:\n\n    "
         "DEBUG           for debug\n    DECIMAL         controlling number "
         "display\n                    0 = normal, 1 = DEC 2 = HEX, 3 = BIN, 4 "
         "= OCT\n\n");
}


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

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

LLVM IR (-O0):
@.str = [397 x i8] c"Controls:\0A\0A date -echo string, expanding date (strftime compatible)\0A echo -echo string.\0A _echo -echo string without training new line.\0A store -store variable to file.\0A restore -restore variable from file.\0A\0ABuilt in variables:\0A\0A DEBUG for debug\0A DECIMAL controlling number display\0A 0 = normal, 1 = DEC 2 = HEX, 3 = BIN, 4 = OCT\0A\0A\00"
define void @cbhelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([397 x i8], [397 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [396 x i8] c"Controls:\0A\0A date -echo string, expanding date (strftime compatible)\0A echo -echo string.\0A _echo -echo string without training new line.\0A store -store variable to file.\0A restore -restore variable from file.\0A\0ABuilt in variables:\0A\0A DEBUG for debug\0A DECIMAL controlling number display\0A 0 = normal, 1 = DEC 2 = HEX, 3 = BIN, 4 = OCT\0A\00"
define void @cbhelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([396 x i8], [396 x i8]* @str, i64 0, i64 0))
ret void
}
int f0(unsigned x) {
  switch (x) {
  case 2:
  case 10 ... 9:
    return 10;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
jne    1129 <f0+0x29>
jmp    1118 <f0+0x18>
jmp    111d <f0+0x1d>
movl   $0xa,-0x4(%rbp)
jmp    1130 <f0+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
xor    %ecx,%ecx
cmp    $0x2,%edi
mov    $0xa,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f0(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 2, label %5
]
5: ; preds = %1
br label %6
6: ; preds = %5
store i32 10, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @f0(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i32 10, i32 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_authkey_save() {
  printf("NOT IMPLEMENTED:"
         "pa_authkey_save"
         "\n");
}


x86 assembly (clang, -O0):
<pa_authkey_save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_authkey_save\0A\00"
define i32 @pa_authkey_save() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_authkey_save\00"
define i32 @pa_authkey_save() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int err(const void *res) {
  return (((int)res) < 0) && (((int)res) > -4096) ? ((int)res) : 0;
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x0,%eax
jge    1130 <err+0x30>
mov    -0x8(%rbp),%rax
cmp    $0xfffff000,%eax
jle    1130 <err+0x30>
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
jmp    113a <err+0x3a>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <err+0x3a>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<err>:
xor    %eax,%eax
cmp    $0xfffff001,%edi
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %7 to i32
%9 = icmp sgt i32 %8, -4096
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = ptrtoint i8* %11 to i32
br label %14
13: ; preds = %6, %1
br label %14
14: ; preds = %13, %10
%15 = phi i32 [ %12, %10 ], [ 0, %13 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @err(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = icmp ugt i32 %3, -4096
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t lba_to_msf_alt(int lba) {
  uint32_t ret = 0;
  ret |= ((lba / (60 * 75)) & 0xff) << 16;
  ret |= (((lba / 75) % 60) & 0xff) << 8;
  ret |= ((lba % 75) & 0xff) << 0;
  return ret;
}


x86 assembly (clang, -O0):
<lba_to_msf_alt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1194,%ecx
cltd
idiv   %ecx
and    $0xff,%eax
shl    $0x10,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4b,%ecx
cltd
idiv   %ecx
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
and    $0xff,%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4b,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
and    $0xff,%eax
shl    $0x0,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lba_to_msf_alt>:
movslq %edi,%rax
imul   $0x7482296b,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x2b,%rcx
add    %edx,%ecx
movzbl %cl,%ecx
shl    $0x10,%ecx
imul   $0x1b4e81b5,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x23,%rdx
add    %esi,%edx
movslq %edx,%rdx
imul   $0xffffffff88888889,%rdx,%rsi
shr    $0x20,%rsi
add    %edx,%esi
mov    %esi,%edi
shr    $0x1f,%edi
shr    $0x5,%esi
add    %edi,%esi
imul   $0x3c,%esi,%esi
imul   $0x4b,%edx,%edi
sub    %esi,%edx
shl    $0x8,%edx
movzwl %dx,%edx
sub    %edi,%eax
movzbl %al,%eax
or     %ecx,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @lba_to_msf_alt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 4500
%6 = and i32 %5, 255
%7 = shl i32 %6, 16
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 75
%12 = srem i32 %11, 60
%13 = and i32 %12, 255
%14 = shl i32 %13, 8
%15 = load i32, i32* %3
%16 = or i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %2
%18 = srem i32 %17, 75
%19 = and i32 %18, 255
%20 = shl i32 %19, 0
%21 = load i32, i32* %3
%22 = or i32 %21, %20
store i32 %22, i32* %3
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @lba_to_msf_alt(i32 %0) {
%2 = sdiv i32 %0, 4500
%3 = shl i32 %2, 16
%4 = and i32 %3, 16711680
%5 = sdiv i32 %0, 75
%6 = srem i32 %5, 60
%7 = shl nsw i32 %6, 8
%8 = and i32 %7, 65280
%9 = srem i32 %0, 75
%10 = and i32 %9, 255
%11 = or i32 %4, %10
%12 = or i32 %11, %8
ret i32 %12
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ os_freakout();
int os_sched_yield(int *);
int sched_yield(void) {
  int rc;
  if (os_sched_yield(&rc) == -1)
    os_freakout();
  if (rc != 0) {
    errno = rc;
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sched_yield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <os_sched_yield@plt>
cmp    $0xffffffff,%eax
jne    1141 <sched_yield+0x21>
mov    $0x0,%al
call   1040 <os_freakout@plt>
cmpl   $0x0,-0x8(%rbp)
je     1163 <sched_yield+0x43>
mov    -0x8(%rbp),%ecx
mov    0x2e8b(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <sched_yield+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_yield>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <os_sched_yield@plt>
cmp    $0xffffffff,%eax
jne    1137 <sched_yield+0x17>
xor    %eax,%eax
call   1040 <os_freakout@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     114f <sched_yield+0x2f>
mov    0x2e9a(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @sched_yield() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @os_sched_yield(i32* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @os_freakout()
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = load i32, i32* %2
store i32 %11, i32* @errno
store i32 -1, i32* %1
br label %13
12: ; preds = %7
store i32 0, i32* %1
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @sched_yield() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @os_sched_yield(i32* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @os_freakout()
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7
store i32 %8, i32* @errno
br label %11
11: ; preds = %7, %10
%12 = phi i32 [ -1, %10 ], [ 0, %7 ]
ret i32 %12
}
long double deg(long double radi) {
  return (180. * radi) /
         3.14159265358979323846264338327950288419716939937510582097;
}


x86 assembly (clang, -O0):
<deg>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fmulp  %st,%st(1)
fldl   0xeed(%rip)
fdivrp %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg>:
fldt   0x8(%rsp)
fmuls  0xef6(%rip)
fdivl  0xef8(%rip)
ret

LLVM IR (-O0):
define x86_fp80 @deg(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fmul x86_fp80 0xK4006B400000000000000, %3
%5 = fdiv x86_fp80 %4, 0xK4000C90FDAA22168C000
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @deg(x86_fp80 %0) {
%2 = fmul x86_fp80 %0, 0xK4006B400000000000000
%3 = fdiv x86_fp80 %2, 0xK4000C90FDAA22168C000
ret x86_fp80 %3
}
/* Variables and functions */
int bio_getbit();
int bio_read(int n) {
  int i, v;
  v = 0;
  for (i = n - 1; i >= 0; i--) {
    v += bio_getbit() << i;
  }
  return v;
}


x86 assembly (clang, -O0):
<bio_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1155 <bio_read+0x45>
mov    $0x0,%al
call   1030 <bio_getbit@plt>
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <bio_read+0x1b>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bio_read>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1138 <bio_read+0x28>
mov    %edi,%ebx
add    $0x1,%ebx
xor    %ebp,%ebp
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <bio_getbit@plt>
lea    -0x2(%rbx),%ecx
shl    %cl,%eax
add    %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <bio_read+0x10>
jmp    113a <bio_read+0x2a>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bio_read(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %3
br label %7
7: ; preds = %16, %1
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = call i32 (...) @bio_getbit()
%12 = load i32, i32* %3
%13 = shl i32 %11, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %14, %13
store i32 %15, i32* %4
br label %16
16: ; preds = %10
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
br label %7
19: ; preds = %7
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @bio_read(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 (...) @bio_getbit()
%8 = shl i32 %7, %6
%9 = add nsw i32 %8, %5
%10 = icmp ugt i32 %4, 1
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ const *);
struct tm *Parrot_gmtime_r(const time_t *t, struct tm *tm) {
  *tm = *gmtime(t);
  return tm;
}


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

x86 assembly (clang, -O2):
<Parrot_gmtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <gmtime@plt>
mov    (%rax),%eax
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @Parrot_gmtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca i32*
%4 = alloca %struct.tm*
store i32* %0, i32** %3
store %struct.tm* %1, %struct.tm** %4
%5 = load %struct.tm*, %struct.tm** %4
%6 = load i32*, i32** %3
%7 = call %struct.tm* @gmtime(i32* %6)
%8 = bitcast %struct.tm* %5 to i8*
%9 = bitcast %struct.tm* %7 to i8*
%10 = load %struct.tm*, %struct.tm** %4
ret %struct.tm* %10
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @Parrot_gmtime_r(i32* %0, %struct.tm* returned writeonly %1) {
%3 = tail call %struct.tm* @gmtime(i32* %0)
%4 = getelementptr %struct.tm, %struct.tm* %3, i64 0, i32 0
%5 = getelementptr %struct.tm, %struct.tm* %1, i64 0, i32 0
%6 = load i32, i32* %4
store i32 %6, i32* %5
ret %struct.tm* %1
}
/* Variables and functions */
int /*<<< orphan*/ EDOM;
scalar_t__ isnan(double);
double with_errno(double, int /*<<< orphan*/);
__attribute__((__visibility__("hidden"))) double __math_invalid(double x) {
  double y = (x - x) / (x - x);
  return isnan(x) ? y : with_errno(y, EDOM);
}


x86 assembly (clang, -O0):
<__math_invalid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     116d <__math_invalid+0x4d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1185 <__math_invalid+0x65>
movsd  -0x10(%rbp),%xmm0
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1030 <with_errno@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__math_invalid>:
push   %rax
movapd %xmm0,%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm1
movsd  %xmm1,(%rsp)
call   1040 <isnan@plt>
test   %rax,%rax
je     1143 <__math_invalid+0x23>
movsd  (%rsp),%xmm0
pop    %rax
ret
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <with_errno@plt>

LLVM IR (-O0):
@EDOM = global i32 0
define hidden double @__math_invalid(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fsub double %4, %5
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fsub double %7, %8
%10 = fdiv double %6, %9
store double %10, double* %3
%11 = load double, double* %2
%12 = call i64 @isnan(double %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = load double, double* %3
br label %20
16: ; preds = %1
%17 = load double, double* %3
%18 = load i32, i32* @EDOM
%19 = call double @with_errno(double %17, i32 %18)
br label %20
20: ; preds = %16, %14
%21 = phi double [ %15, %14 ], [ %19, %16 ]
ret double %21
}

LLVM IR (-O2):
@EDOM = global i32 0
define hidden double @__math_invalid(double %0) {
%2 = fsub double %0, %0
%3 = fdiv double %2, %2
%4 = tail call i64 @isnan(double %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EDOM
%8 = tail call double @with_errno(double %3, i32 %7)
br label %9
9: ; preds = %1, %6
%10 = phi double [ %8, %6 ], [ %3, %1 ]
ret double %10
}
int quantum_char2int(unsigned char *buf) {
  int i, size;
  int j = 0;
  size = sizeof(int);
  for (i = size - 1; i >= 0; i--)
    j += buf[i] * (1 << (8 * (size - i - 1)));
  return j;
}


x86 assembly (clang, -O0):
<quantum_char2int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1161 <quantum_char2int+0x61>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x3,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
imul   %ecx,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <quantum_char2int+0x1f>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantum_char2int>:
mov    (%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @quantum_char2int(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %13, %9
%15 = load i8, i8* %0
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %17, %14
ret i32 %18
}
int pwm_config2(struct pwm_device *pwm, unsigned duty_numerator,
                unsigned duty_denominator, unsigned period_us) {
  return 0;
}


x86 assembly (clang, -O0):
<pwm_config2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pwm_device = type opaque
define i32 @pwm_config2(%struct.pwm_device* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.pwm_device*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.pwm_device* %0, %struct.pwm_device** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.pwm_device = type opaque
define i32 @pwm_config2(%struct.pwm_device* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
void GPIOPinSet(unsigned long ulPort, unsigned long ulPins) {
  ;
  (*((volatile unsigned long *)(ulPort + 0x00000010))) = ulPins;
}


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

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

LLVM IR (-O0):
define void @GPIOPinSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 16
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @GPIOPinSet(i64 %0, i64 %1) {
%3 = add i64 %0, 16
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
scalar_t__ vdb_init();
int vdb_intern(char const *);
int /*<<< orphan*/ vdb_printf(char *, int);
__attribute__((weak)) int vdb_label(const char *lbl) {
  int key;
  do {
    if (vdb_init())
      return 1;
  } while (0);
  key = vdb_intern(lbl);
  vdb_printf("g %d\n", key);
  return 0;
}


x86 assembly (clang, -O0):
<vdb_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <vdb_init@plt>
cmp    $0x0,%rax
je     1159 <vdb_label+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1180 <vdb_label+0x50>
jmp    115e <vdb_label+0x2e>
mov    -0x10(%rbp),%rdi
call   1040 <vdb_intern@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <vdb_printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdb_label>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <vdb_init@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     114a <vdb_label+0x1a>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <vdb_intern@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
call   1030 <vdb_printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"g %d\0A\00"
define weak i32 @vdb_label(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
br label %5
5: ; preds = %1
%6 = call i64 (...) @vdb_init()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 1, i32* %2
br label %15
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i8*, i8** %3
%12 = call i32 @vdb_intern(i8* %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @vdb_printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 0, i32* %2
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [6 x i8] c"g %d\0A\00"
define weak i32 @vdb_label(i8* %0) {
%2 = tail call i64 (...) @vdb_init()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @vdb_intern(i8* %0)
%6 = tail call i32 @vdb_printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %8
}
unsigned libretro_dummy_retro_get_region(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @libretro_dummy_retro_get_region() {
ret i32 0
}
/* Variables and functions */
int AF_INET;
int AF_INET6;
int max_netmask(int family) {
  if (family == AF_INET)
    return 32;
  else if (family == AF_INET6)
    return 128;
  else
    return -1;
}


x86 assembly (clang, -O0):
<max_netmask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed7(%rip),%rcx
cmp    (%rcx),%eax
jne    1125 <max_netmask+0x25>
movl   $0x20,-0x4(%rbp)
jmp    114a <max_netmask+0x4a>
mov    -0x8(%rbp),%eax
mov    0x2eb1(%rip),%rcx
cmp    (%rcx),%eax
jne    1143 <max_netmask+0x43>
movl   $0x80,-0x4(%rbp)
jmp    114a <max_netmask+0x4a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_netmask>:
mov    0x2ee1(%rip),%rax
mov    0x2ed2(%rip),%rcx
cmp    %edi,(%rcx)
mov    $0x80,%ecx
mov    $0xffffffff,%edx
cmove  %ecx,%edx
cmp    %edi,(%rax)
mov    $0x20,%eax
cmovne %edx,%eax
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@AF_INET6 = global i32 0
define i32 @max_netmask(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @AF_INET
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 32, i32* %2
br label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = load i32, i32* @AF_INET6
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 128, i32* %2
br label %14
13: ; preds = %8
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@AF_INET = global i32 0
@AF_INET6 = global i32 0
define i32 @max_netmask(i32 %0) {
%2 = load i32, i32* @AF_INET
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @AF_INET6
%5 = icmp eq i32 %4, %0
%6 = select i1 %5, i32 128, i32 -1
%7 = select i1 %3, i32 32, i32 %6
ret i32 %7
}
/* Variables and functions */
int istrsenvisx(char *, size_t *, char const *, size_t, int, char *, int *);
int strenvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len,
              int flags, int *cerr_ptr) {
  return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, "", cerr_ptr);
}


x86 assembly (clang, -O0):
<strenvisx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x30(%rbp),%rax
lea    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%r9
mov    %rax,(%rsp)
call   1030 <istrsenvisx@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strenvisx>:
sub    $0x18,%rsp
mov    %rsi,0x10(%rsp)
mov    %r9,(%rsp)
lea    0xedc(%rip),%r9
lea    0x10(%rsp),%rsi
call   1030 <istrsenvisx@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @strenvisx(i8* %0, i64 %1, i8* %2, i64 %3, i32 %4, i32* %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32*
store i8* %0, i8** %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i32 %4, i32* %11
store i32* %5, i32** %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = load i32, i32* %11
%17 = load i32*, i32** %12
%18 = call i32 @istrsenvisx(i8* %13, i64* %8, i8* %14, i64 %15, i32 %16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* %17)
ret i32 %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @strenvisx(i8* %0, i64 %1, i8* %2, i64 %3, i32 %4, i32* %5) {
%7 = alloca i64
store i64 %1, i64* %7
%8 = call i32 @istrsenvisx(i8* %0, i64* %7, i8* %2, i64 %3, i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* %5)
ret i32 %8
}
trapv(int i) { return i + 1; }


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

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

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

LLVM IR (-O2):
define i32 @trapv(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int _irc_client_message(char *, char *, char *, char *);
int irc_privmsg(char *target, char *text) {
  return _irc_client_message(target, "PRIVMSG", "%s", text);
}


x86 assembly (clang, -O0):
<irc_privmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rsi
lea    0xed2(%rip),%rdx
call   1030 <_irc_client_message@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_privmsg>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rsi
lea    0xee7(%rip),%rdx
jmp    1030 <_irc_client_message@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"PRIVMSG\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @irc_privmsg(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 = call i32 @_irc_client_message(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"PRIVMSG\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @irc_privmsg(i8* %0, i8* %1) {
%3 = tail call i32 @_irc_client_message(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int arr[], int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf("%d ", arr[i]);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

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


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

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

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

LLVM IR (-O2):
define void @type_util_placeholder() {
ret void
}
const char *cdfLibraryVersion(void) { return ("library undefined"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"library undefined\00"
define i8* @cdfLibraryVersion() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"library undefined\00"
define i8* @cdfLibraryVersion() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}