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

/* Variables and functions */
int /*<<< orphan*/ svcClose(int);
int /*<<< orphan*/ svcIoctl(int, int, int *, int, int *, int);
int svcOpen(char *, int /*<<< orphan*/);
void ipc_deinit(void) {
  int fd = svcOpen("/dev/iosuhax", 0);
  if (fd >= 0) {
    int dummy = 0;
    svcIoctl(fd, 0x03, &dummy, sizeof(dummy), &dummy, sizeof(dummy));
    svcClose(fd);
  }
}


x86 assembly (clang, -O0):
<ipc_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
xor    %esi,%esi
call   1030 <svcOpen@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     117f <ipc_deinit+0x4f>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
lea    -0x8(%rbp),%r8
mov    $0x4,%r9d
mov    %r8,%rdx
mov    %r9d,%ecx
call   1040 <svcIoctl@plt>
mov    -0x4(%rbp),%edi
call   1050 <svcClose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipc_deinit>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %esi,%esi
call   1030 <svcOpen@plt>
test   %eax,%eax
js     1177 <ipc_deinit+0x47>
mov    %eax,%ebx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdx
mov    %eax,%edi
mov    $0x3,%esi
mov    $0x4,%ecx
mov    %rdx,%r8
mov    $0x4,%r9d
call   1040 <svcIoctl@plt>
mov    %ebx,%edi
call   1050 <svcClose@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/iosuhax\00"
define void @ipc_deinit() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @svcOpen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0
store i32 0, i32* %2
%7 = load i32, i32* %1
%8 = call i32 @svcIoctl(i32 %7, i32 3, i32* %2, i32 4, i32* %2, i32 4)
%9 = load i32, i32* %1
%10 = call i32 @svcClose(i32 %9)
br label %11
11: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/iosuhax\00"
define void @ipc_deinit() {
%1 = alloca i32
%2 = tail call i32 @svcOpen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%6 = call i32 @svcIoctl(i32 %2, i32 3, i32* %1, i32 4, i32* %1, i32 4)
%7 = call i32 @svcClose(i32 %2)
br label %8
8: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_text(char *);
void BusFault_Handler(void) {
  send_text("Bus Fault.\n");
  while (1) {
  }
}


x86 assembly (clang, -O0):
<BusFault_Handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <send_text@plt>
jmp    1120 <BusFault_Handler+0x10>

x86 assembly (clang, -O2):
<BusFault_Handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <send_text@plt>
nopl   (%rax)
jmp    1120 <BusFault_Handler+0x10>

LLVM IR (-O0):
@.str = [12 x i8] c"Bus Fault.\0A\00"
define void @BusFault_Handler() {
%1 = call i32 @send_text(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [12 x i8] c"Bus Fault.\0A\00"
define void @BusFault_Handler() {
%1 = tail call i32 @send_text(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ helper_double_12_recursive(double *, int);
void helper_double_12(double *buf) { helper_double_12_recursive(buf, 12); }


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

x86 assembly (clang, -O2):
<helper_double_12>:
mov    $0xc,%esi
jmp    1030 <helper_double_12_recursive@plt>

LLVM IR (-O0):
define void @helper_double_12(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @helper_double_12_recursive(double* %3, i32 12)
ret void
}

LLVM IR (-O2):
define void @helper_double_12(double* %0) {
%2 = tail call i32 @helper_double_12_recursive(double* %0, i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ configurarTecladoMatricial();
void InicializarMEFIngresoPiso(void) { configurarTecladoMatricial(); }


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

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

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

LLVM IR (-O2):
define void @InicializarMEFIngresoPiso() {
%1 = tail call i32 (...) @configurarTecladoMatricial()
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t size;
  for (; *str != '\0'; str++, size++)
    ;
  return size;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113a <strlen+0x3a>
jmp    111d <strlen+0x1d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <strlen+0x8>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111e <strlen+0x1e>
add    $0x1,%rdi
nopl   0x0(%rax)
add    $0x1,%rax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ undef, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ undef, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int partition(char **, int, int);
void quicksort(char **arr, int lo, int hi) {
  if (lo < hi) {
    int pi = partition(arr, lo, hi);
    quicksort(arr, pi + 1, hi);
    quicksort(arr, lo, pi - 1);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quicksort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%ebp
mov    %esi,%r15d
mov    %rdi,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%esi
mov    %r14,%rdi
mov    %ebp,%edx
call   1040 <quicksort@plt>
add    $0xffffffff,%ebx
mov    %ebx,%ebp
cmp    %r15d,%ebx
jg     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quicksort(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i8**, i8*** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition(i8** %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i8**, i8*** %4
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
%19 = load i32, i32* %6
%20 = load i8**, i8*** %4
%21 = load i32, i32* %5
%22 = load i32, i32* %7
%23 = sub nsw i32 %22, 1
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @quicksort(i8** %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %2, %3 ]
%7 = tail call i32 @partition(i8** %0, i32 %1, i32 %6)
%8 = add nsw i32 %7, 1
tail call void @quicksort(i8** %0, i32 %8, i32 %6)
%9 = add nsw i32 %7, -1
%10 = icmp sgt i32 %9, %1
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void o2net_set_nst_send_time(struct o2net_send_tracking *nst) {}


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

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

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

LLVM IR (-O2):
%struct.o2net_send_tracking = type opaque
define void @o2net_set_nst_send_time(%struct.o2net_send_tracking* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PIN_IRQ_Handler(int);
void PIN_INT3_IRQHandler(void) { PIN_IRQ_Handler(3); }


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

x86 assembly (clang, -O2):
<PIN_INT3_IRQHandler>:
mov    $0x3,%edi
jmp    1030 <PIN_IRQ_Handler@plt>

LLVM IR (-O0):
define void @PIN_INT3_IRQHandler() {
%1 = call i32 @PIN_IRQ_Handler(i32 3)
ret void
}

LLVM IR (-O2):
define void @PIN_INT3_IRQHandler() {
%1 = tail call i32 @PIN_IRQ_Handler(i32 3)
ret void
}
void baz() {
  for (;;)
    switch (0)
    default:
      return;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <baz+0x9>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @baz() {
br label %1
1: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @baz() {
ret void
}
int main() {
  int i, j, k;
  i = 0;
  j = 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
char *skip_blanks(char *p) {
  while (((*p) == ' ' || (*p) == '\t'))
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skip_blanks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip_blanks+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip_blanks+0x3d>
jmp    114e <skip_blanks+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_blanks+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_blanks>:
mov    %rdi,%rax
jmp    1114 <skip_blanks+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_blanks+0x10>
cmp    $0x9,%cl
je     1110 <skip_blanks+0x10>
ret

LLVM IR (-O0):
define i8* @skip_blanks(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ true, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @skip_blanks(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
unsigned long __get_free_page(int flags) {
  unsigned long addr = get_free_page(flags);
  __asm__("rep stosb" ::"a"(0), "D"(addr), "c"(4096));
  ;
  return addr;
}


x86 assembly (clang, -O0):
<__get_free_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <get_free_page@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    $0x1000,%ecx
rep stos %al,%es:(%rdi)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_free_page>:
push   %rax
xor    %eax,%eax
call   1030 <get_free_page@plt>
movslq %eax,%rdi
xor    %eax,%eax
mov    $0x1000,%ecx
rep stos %al,%es:(%rdi)
mov    %rdi,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @__get_free_page(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @get_free_page to i32 (i32, ...)*)(i32 %4)
%6 = sext i32 %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @__get_free_page(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @get_free_page to i32 (i32, ...)*)(i32 %0)
%3 = sext i32 %2 to i64
tail call void asm sideeffect "rep stosb", "{ax},{di},{cx},~{dirflag},~{fpsr},~{flags}"(i32 0, i64 %3, i32 4096)
ret i64 %3
}
__attribute__((no, noclone)) signed __int128 t104_3sub(signed __int128 y) {
  signed __int128 r;
  if (__builtin_sub_overflow((signed __int128)(0), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t104_3sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rax
xor    %ecx,%ecx
neg    %rdx
sbb    %rax,%rcx
seto   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1158 <t104_3sub+0x48>
jmp    115f <t104_3sub+0x4f>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t104_3sub>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %r14d,%r14d
neg    %rbx
sbb    %rsi,%r14
jno    1129 <t104_3sub+0x19>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t104_3sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 0, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t104_3sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 0, i128 %6)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ LONG_MIN;
long wcstox(int /*<<< orphan*/ const *, int /*<<< orphan*/ **, int, scalar_t__);
long wcstol(const wchar_t *restrict s, wchar_t **restrict p, int base) {
  return wcstox(s, p, base, 0UL + LONG_MIN);
}


x86 assembly (clang, -O0):
<wcstol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    0x2eb3(%rip),%rax
mov    (%rax),%rcx
add    $0x0,%rcx
call   1030 <wcstox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstol>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rcx
jmp    1030 <wcstox@plt>

LLVM IR (-O0):
@LONG_MIN = global i64 0
define i64 @wcstol(i32* noalias %0, i32** noalias %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32**
%6 = alloca i32
store i32* %0, i32** %4
store i32** %1, i32*** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32**, i32*** %5
%9 = load i32, i32* %6
%10 = load i64, i64* @LONG_MIN
%11 = add i64 0, %10
%12 = call i64 @wcstox(i32* %7, i32** %8, i32 %9, i64 %11)
ret i64 %12
}

LLVM IR (-O2):
@LONG_MIN = global i64 0
define i64 @wcstol(i32* noalias %0, i32** noalias %1, i32 %2) {
%4 = load i64, i64* @LONG_MIN
%5 = tail call i64 @wcstox(i32* %0, i32** %1, i32 %2, i64 %4)
ret i64 %5
}
/* Variables and functions */
unsigned long BIT_MASK(int);
int BIT_WORD(int);
int /*<<< orphan*/ local_irq_restore(unsigned long);
int /*<<< orphan*/ local_irq_save(unsigned long);
void set_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = BIT_MASK(nr);
  unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
  unsigned long flags;
  do {
    local_irq_save(flags);
  } while (0);
  *p |= mask;
  do {
    local_irq_restore(flags);
  } while (0);
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <BIT_MASK@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <BIT_WORD@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <local_irq_save@plt>
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rdi
call   1050 <local_irq_restore@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1030 <BIT_MASK@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1060 <BIT_WORD@plt>
movslq %eax,%rbp
call   1040 <local_irq_save@plt>
or     %rbx,(%r14,%rbp,8)
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <local_irq_restore@plt>

LLVM IR (-O0):
define void @set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%8 = load i32, i32* %3
%9 = call i64 @BIT_MASK(i32 %8)
store i64 %9, i64* %5
%10 = load i64*, i64** %4
%11 = load i32, i32* %3
%12 = call i32 @BIT_WORD(i32 %11)
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i64, i64* %10, i64 %13
store i64* %14, i64** %6
br label %15
15: ; preds = %2
%16 = load i64, i64* %7
%17 = call i32 @local_irq_save(i64 %16)
br label %18
18: ; preds = %15
%19 = load i64, i64* %5
%20 = load i64*, i64** %6
%21 = load i64, i64* %20
%22 = or i64 %21, %19
store i64 %22, i64* %20
br label %23
23: ; preds = %18
%24 = load i64, i64* %7
%25 = call i32 @local_irq_restore(i64 %24)
br label %26
26: ; preds = %23
ret void
}

LLVM IR (-O2):
define void @set_bit(i32 %0, i64* nocapture %1) {
%3 = tail call i64 @BIT_MASK(i32 %0)
%4 = tail call i32 @BIT_WORD(i32 %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %1, i64 %5
%7 = tail call i32 @local_irq_save(i64 undef)
%8 = load i64, i64* %6
%9 = or i64 %8, %3
store i64 %9, i64* %6
%10 = tail call i32 @local_irq_restore(i64 undef)
ret void
}
int f(int n_invo) {
  if (n_invo == 1)
    return n_invo;
  else
    return f(n_invo - 1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1130 <f+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <f+0x2e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 1
}
/* Variables and functions */
scalar_t__ likely(int);
int buf_size_valid_signed(const int size) {
  return likely(size >= -1000000) && likely(size < 1000000);
}


x86 assembly (clang, -O0):
<buf_size_valid_signed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xfff0bdc0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <likely@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     115f <buf_size_valid_signed+0x4f>
cmpl   $0xf4240,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <likely@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_size_valid_signed>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0xfff0bdc0,%ebx
setge  %dil
call   1030 <likely@plt>
test   %rax,%rax
je     1147 <buf_size_valid_signed+0x37>
xor    %edi,%edi
cmp    $0xf4240,%ebx
setl   %dil
call   1030 <likely@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @buf_size_valid_signed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, -1000000
%5 = zext i1 %4 to i32
%6 = call i64 @likely(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 1000000
%11 = zext i1 %10 to i32
%12 = call i64 @likely(i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @buf_size_valid_signed(i32 %0) {
%2 = icmp sgt i32 %0, -1000001
%3 = zext i1 %2 to i32
%4 = tail call i64 @likely(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = icmp slt i32 %0, 1000000
%8 = zext i1 %7 to i32
%9 = tail call i64 @likely(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
char getchar();
int read_int(int *first) {
  char get;
  *first = 0;
  while (1) {
    get = getchar();
    if ((get >= '0') && (get <= '9')) {
      *first = (*first) * 10 + get - '0';
    } else {
      break;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x30,%eax
jl     1165 <read_int+0x55>
movsbl -0x9(%rbp),%eax
cmp    $0x39,%eax
jg     1165 <read_int+0x55>
mov    -0x8(%rbp),%rax
imul   $0xa,(%rax),%ecx
movsbl -0x9(%rbp),%eax
add    %eax,%ecx
sub    $0x30,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    116a <read_int+0x5a>
jmp    116f <read_int+0x5f>
jmp    1126 <read_int+0x16>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %rbx
mov    %rdi,%rbx
movl   $0x0,(%rdi)
xor    %eax,%eax
call   1030 <getchar@plt>
lea    -0x30(%rax),%ecx
cmp    $0x9,%cl
ja     1151 <read_int+0x41>
nopl   0x0(%rax)
movzbl %al,%eax
mov    (%rbx),%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rax,%rcx,2),%eax
add    $0xffffffd0,%eax
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ecx
add    $0xd0,%cl
cmp    $0xa,%cl
jb     1130 <read_int+0x20>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_int(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %1, %24
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %23
10: ; preds = %5
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i32*, i32** %2
%16 = load i32, i32* %15
%17 = mul nsw i32 %16, 10
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = add nsw i32 %17, %19
%21 = sub nsw i32 %20, 48
%22 = load i32*, i32** %2
store i32 %21, i32* %22
br label %24
23: ; preds = %10, %5
br label %25
24: ; preds = %14
br label %5
25: ; preds = %23
ret i32 1
}

LLVM IR (-O2):
define i32 @read_int(i32* nocapture %0) {
store i32 0, i32* %0
%2 = tail call signext i8 (...) @getchar()
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %15
5: ; preds = %1, %5
%6 = phi i8 [ %12, %5 ], [ %2, %1 ]
%7 = zext i8 %6 to i32
%8 = load i32, i32* %0
%9 = mul nsw i32 %8, 10
%10 = add nsw i32 %7, -48
%11 = add i32 %10, %9
store i32 %11, i32* %0
%12 = tail call signext i8 (...) @getchar()
%13 = add i8 %12, -48
%14 = icmp ult i8 %13, 10
br i1 %14, label %5, label %15
15: ; preds = %5, %1
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int printf(char *, char *, int);
int /*<<< orphan*/ stdout;
int print_msg(char *text, int number) {
  int count = printf("Text: %s (%d)\n", text, number);
  fflush(stdout);
  return count;
}


x86 assembly (clang, -O0):
<print_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    %eax,-0x10(%rbp)
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_msg>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    %eax,%ebx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Text: %s (%d)\0A\00"
@stdout = global i32 0
define i32 @print_msg(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret i32 %3
}
int main(void) { return 21 + 21; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Variables and functions */
double sin(double);
double cosine(int n, int N) {
  return (sin(3.14 * (double)n / (double)(N - 1)));
}


x86 assembly (clang, -O0):
<cosine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed5(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosine>:
cvtsi2sd %edi,%xmm0
mulsd  0xee4(%rip),%xmm0
add    $0xffffffff,%esi
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @cosine(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 = sitofp i32 %5 to double
%7 = fmul double 3.140000e+00, %6
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = sitofp i32 %9 to double
%11 = fdiv double %7, %10
%12 = call double @sin(double %11)
ret double %12
}

LLVM IR (-O2):
define double @cosine(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 3.140000e+00
%5 = add nsw i32 %1, -1
%6 = sitofp i32 %5 to double
%7 = fdiv double %4, %6
%8 = tail call double @sin(double %7)
ret double %8
}
const char *GSASL_VALID_MECHANISM_CHARACTERS_RTN(void) {
  return "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_\00"
define i8* @GSASL_VALID_MECHANISM_CHARACTERS_RTN() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [39 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_\00"
define i8* @GSASL_VALID_MECHANISM_CHARACTERS_RTN() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int write(int, char *, size_t);
int serial_send(int fd, char *buf, size_t buflen) {
  return write(fd, buf, buflen);
}


x86 assembly (clang, -O0):
<serial_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_send>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @serial_send(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @write(i32 %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @serial_send(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int nice(int);
int /*<<< orphan*/ perror(char *);
int main(int argc, char **argv) {
  int rc;
  rc = nice(-10);
  if (rc == -1) {
    perror("test_nice:nice");
    exit(1);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xfffffff6,%edi
call   1030 <nice@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1173 <main+0x43>
lea    0xe9c(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffff6,%edi
call   1030 <nice@plt>
cmp    $0xffffffff,%eax
jne    1156 <main+0x26>
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"test_nice:nice\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @nice(i32 -10)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"test_nice:nice\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @nice(i32 -10)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(void *);
void *tfn2(void *arg) {
  printf("the second\n");
  pthread_exit((void *)3);
  printf("should not be here\n");
}


x86 assembly (clang, -O0):
<tfn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <pthread_exit@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfn2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1040 <pthread_exit@plt>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"the second\0A\00"
@.str.1 = [20 x i8] c"should not be here\0A\00"
define i8* @tfn2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i8* inttoptr (i64 3 to i8*))
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@str = [11 x i8] c"the second\00"
@str.2 = [19 x i8] c"should not be here\00"
define noalias i8* @tfn2(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i8* inttoptr (i64 3 to i8*))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
ret i8* undef
}
int HelpItem141(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem141() {
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
long long eti_get_millisec(void) {
  struct timeval tm;
  gettimeofday(&tm, 0);
  return ((long long)tm.tv_sec) * 1000 + tm.tv_usec / 1000;
}


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

x86 assembly (clang, -O2):
<eti_get_millisec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%rcx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @eti_get_millisec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @eti_get_millisec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int count = 20;
  int check = 20;
  while (check > 1) {
    if (count % check == 0)
      check--;
    else {
      count = count + 20;
      check = 20;
    }
  }
  printf("count: %d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    116a <main+0x5a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1155 <main+0x45>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <main+0x55>
mov    -0x8(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x14,%r8d
mov    $0x14,%edi
mov    $0x14,%esi
mov    %esi,%ecx
mov    %esi,%eax
cltd
idiv   %edi
add    $0xffffffff,%edi
lea    0x14(%rcx),%esi
test   %edx,%edx
cmove  %ecx,%esi
cmovne %r8d,%edi
cmp    $0x1,%edi
ja     1120 <main+0x10>
push   %rax
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"count: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 20, %0 ], [ %9, %1 ]
%3 = phi i32 [ 20, %0 ], [ %8, %1 ]
%4 = srem i32 %3, %2
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %2, -1
%7 = add nsw i32 %3, 20
%8 = select i1 %5, i32 %3, i32 %7
%9 = select i1 %5, i32 %6, i32 20
%10 = icmp ugt i32 %9, 1
br i1 %10, label %1, label %11
11: ; preds = %1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
extern int strncmp(const char *cs, const char *ct, int count) {
  register int __res __asm__("ax");
  __asm__("cld\n"
          "1:\tdecl %3\n\t"
          "js 2f\n\t"
          "lodsb\n\t"
          "scasb\n\t"
          "jne 3f\n\t"
          "testb %%al,%%al\n\t"
          "jne 1b\n"
          "2:\txorl %%eax,%%eax\n\t"
          "jmp 4f\n"
          "3:\tmovl $1,%%eax\n\t"
          "jl 4f\n\t"
          "negl %%eax\n"
          "4:"
          : "=a"(__res)
          : "D"(cs), "S"(ct), "c"(count));
  return __res;
}


x86 assembly (clang, -O0):
<strncmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
cld
dec    %ecx
js     1133 <strncmp+0x33>
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    113a <strncmp+0x3a>
test   %al,%al
jne    111b <strncmp+0x1b>
xor    %eax,%eax
jmp    1147 <strncmp+0x47>
mov    $0x1,%eax
jl     1147 <strncmp+0x47>
neg    %eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp>:
mov    %edx,%ecx
cld
dec    %ecx
js     110f <strncmp+0xf>
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    1113 <strncmp+0x13>
test   %al,%al
jne    1103 <strncmp+0x3>
xor    %eax,%eax
jmp    111c <strncmp+0x1c>
mov    $0x1,%eax
jl     111c <strncmp+0x1c>
neg    %eax
ret

LLVM IR (-O0):
define i32 @strncmp(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 asm "cld\0A1:\09decl $3\0A\09js 2f\0A\09lodsb\0A\09scasb\0A\09jne 3f\0A\09testb %al,%al\0A\09jne 1b\0A2:\09xorl %eax,%eax\0A\09jmp 4f\0A3:\09movl $$1,%eax\0A\09jl 4f\0A\09negl %eax\0A4:", "={ax},{di},{si},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @strncmp(i8* readnone %0, i8* readnone %1, i32 %2) {
%4 = tail call i32 asm "cld\0A1:\09decl $3\0A\09js 2f\0A\09lodsb\0A\09scasb\0A\09jne 3f\0A\09testb %al,%al\0A\09jne 1b\0A2:\09xorl %eax,%eax\0A\09jmp 4f\0A3:\09movl $$1,%eax\0A\09jl 4f\0A\09negl %eax\0A4:", "={ax},{di},{si},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
struct node *insertAtPosition(struct node *start, int data, int x) {}


x86 assembly (clang, -O0):
<insertAtPosition>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.node = type opaque
define noalias %struct.node* @insertAtPosition(%struct.node* nocapture readnone %0, i32 %1, i32 %2) {
ret %struct.node* undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int towupper(int const);
int utf8toupper(const int c) {
  assert(c >= 0);
  return towupper(c);
}


x86 assembly (clang, -O0):
<utf8toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
call   1040 <towupper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8toupper>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <towupper@plt>

LLVM IR (-O0):
define i32 @utf8toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @towupper(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @utf8toupper(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @towupper(i32 %0)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int sched_getaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
void get_cpu_mask(pid_t pid, cpu_set_t *mask) {
  if (sched_getaffinity(pid, sizeof(cpu_set_t), mask) == -1) {
  }
}


x86 assembly (clang, -O0):
<get_cpu_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x4,%esi
call   1030 <sched_getaffinity@plt>
cmp    $0xffffffff,%eax
jne    113e <get_cpu_mask+0x2e>
jmp    113e <get_cpu_mask+0x2e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpu_mask>:
mov    %rsi,%rdx
mov    $0x4,%esi
jmp    1030 <sched_getaffinity@plt>

LLVM IR (-O0):
define void @get_cpu_mask(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 = call i32 @sched_getaffinity(i32 %5, i32 4, i32* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @get_cpu_mask(i32 %0, i32* %1) {
%3 = tail call i32 @sched_getaffinity(i32 %0, i32 4, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *Print(void *arg) {
  printf("Hello world\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<Print>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define i8* @Print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define noalias i8* @Print(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i8* null
}
int test_imm_A1uint32_reg(unsigned int val) {
  return ((val) & (0xA1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A1uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xa1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A1uint32_reg>:
test   $0xa1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A1uint32_reg(i32 %0) {
%2 = and i32 %0, 161
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void sws_getDefaultFilter() {}


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

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

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

LLVM IR (-O2):
define void @sws_getDefaultFilter() {
ret void
}