xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ logToFile();
int /*<<< orphan*/ recordToFile();
void catch_sighup(int sig) {
  if (!logToFile())
    ;
  else
    ;
  if (!recordToFile())
    ;
  else
    ;
}


x86 assembly (clang, -O0):
<catch_sighup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <logToFile@plt>
cmp    $0x0,%eax
jne    1140 <catch_sighup+0x20>
jmp    1145 <catch_sighup+0x25>
jmp    1145 <catch_sighup+0x25>
mov    $0x0,%al
call   1040 <recordToFile@plt>
cmp    $0x0,%eax
jne    115a <catch_sighup+0x3a>
jmp    115f <catch_sighup+0x3f>
jmp    115f <catch_sighup+0x3f>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @catch_sighup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @logToFile()
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
%8 = call i32 (...) @recordToFile()
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7
br label %12
11: ; preds = %7
br label %12
12: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @catch_sighup(i32 %0) {
%2 = tail call i32 (...) @logToFile()
%3 = tail call i32 (...) @recordToFile()
ret void
}
void sudoku_get_next_current_x_y(int *x, int *y) {
  (*x)++;
  if (*x == 9) {
    *x = 0;
    (*y)++;
  }
}


x86 assembly (clang, -O0):
<sudoku_get_next_current_x_y>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x9,(%rax)
jne    1139 <sudoku_get_next_current_x_y+0x39>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudoku_get_next_current_x_y>:
mov    (%rdi),%eax
add    $0x1,%eax
mov    %eax,(%rdi)
cmp    $0x9,%eax
jne    1115 <sudoku_get_next_current_x_y+0x15>
movl   $0x0,(%rdi)
addl   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @sudoku_get_next_current_x_y(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* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 9
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32*, i32** %3
store i32 0, i32* %12
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %13
br label %16
16: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @sudoku_get_next_current_x_y(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, 1
store i32 %4, i32* %0
%5 = icmp eq i32 %4, 9
br i1 %5, label %6, label %9
6: ; preds = %2
store i32 0, i32* %0
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %2
ret void
}
struct pthread *__pthread_self() {
  struct pthread *self;
  __asm__ __volatile__("mov %%fs:0,%0" : "=r"(self));
  return self;
}


x86 assembly (clang, -O0):
<__pthread_self>:
push   %rbp
mov    %rsp,%rbp
mov    %fs:0x0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pthread_self>:
mov    %fs:0x0,%rax
ret

LLVM IR (-O0):
%struct.pthread = type opaque
define %struct.pthread* @__pthread_self() {
%1 = alloca %struct.pthread*
%2 = call %struct.pthread* asm sideeffect "mov %fs:0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store %struct.pthread* %2, %struct.pthread** %1
%3 = load %struct.pthread*, %struct.pthread** %1
ret %struct.pthread* %3
}

LLVM IR (-O2):
%struct.pthread = type opaque
define %struct.pthread* @__pthread_self() {
%1 = tail call %struct.pthread* asm sideeffect "mov %fs:0,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret %struct.pthread* %1
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
unsigned long ADCReferenceGet(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x40038000) || (ulBase == 0x40039000));
  return ((*((volatile unsigned long *)(ulBase + 0x00000038))) & 0x00000003);
}


x86 assembly (clang, -O0):
<ADCReferenceGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x40038000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     113d <ADCReferenceGet+0x2d>
cmpq   $0x40039000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%rax
and    $0x3,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCReferenceGet>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40038000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0x38(%rbx),%rax
and    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ADCReferenceGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073971200
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073975296
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
%13 = add i64 %12, 56
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = and i64 %15, 3
ret i64 %16
}

LLVM IR (-O2):
define i64 @ADCReferenceGet(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073971200
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 56
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, 3
ret i64 %9
}
/* Variables and functions */
int argsparse_request(const int argc, const char **argv, int *arg_idx,
                      char **p) {
  if (*arg_idx >= argc) {
    return -1;
  } else {
    *p = (char *)argv[(size_t)*arg_idx];
    (*arg_idx)++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<argsparse_request>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jl     112e <argsparse_request+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <argsparse_request+0x56>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<argsparse_request>:
movslq (%rdx),%r8
mov    $0xffffffff,%eax
cmp    %edi,%r8d
jge    111c <argsparse_request+0x1c>
mov    (%rsi,%r8,8),%rax
mov    %rax,(%rcx)
lea    0x1(%r8),%eax
mov    %eax,(%rdx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @argsparse_request(i32 %0, i8** nocapture %1, i32* nocapture %2, i8** nocapture writeonly %3) {
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, %0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
store i8* %10, i8** %3
%11 = add nsw i32 %5, 1
store i32 %11, i32* %2
br label %12
12: ; preds = %4, %7
%13 = phi i32 [ 0, %7 ], [ -1, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(unsigned arr[], size_t arr_sz) {
  size_t i;
  for (i = 0; i < arr_sz; i++) {
    printf("%u ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1160 <print_array+0x50>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <print_array+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1157 <print_array+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+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"%u \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_array(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = 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"%u \00"
define void @print_array(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
void db120_pci_init(void) {}


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

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

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

LLVM IR (-O2):
define void @db120_pci_init() {
ret void
}
char *getName() { return "sample"; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"sample\00"
define i8* @getName() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int);
int main() {
  char array[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
  char *cp = array;
  int *ip = (int *)array;
  printf("%d %d\n", sizeof(char), sizeof(int));
  printf("%c %d\n", *(cp + 2), *(ip + 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    0xec4(%rip),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    0x2(%rax),%al
mov    -0x30(%rbp),%rcx
mov    0x8(%rcx),%edx
lea    0xea7(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x2,%esi
mov    $0xb0a0908,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.array = [16 x i8] c"\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F"
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [7 x i8] c"%c %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca i8*
%4 = alloca i32*
store i32 0, i32* %1
%5 = bitcast [16 x i8]* %2 to i8*
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
store i8* %6, i8** %3
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 1, i32 4)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = load i8, i8* %11
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %12, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [7 x i8] c"%c %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 1, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext 2, i32 185207048)
ret i32 0
}
/* Variables and functions */
int KIONIX_ACCEL_read_bytes(int, char *, int);
int KIONIX_ACCEL_read_current_position(char *current_position) {
  int status;
  status = KIONIX_ACCEL_read_bytes(0x10, current_position, 1);
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_read_current_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x10,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_read_current_position>:
mov    %rdi,%rsi
mov    $0x10,%edi
mov    $0x1,%edx
jmp    1030 <KIONIX_ACCEL_read_bytes@plt>

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_read_current_position(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @KIONIX_ACCEL_read_bytes(i32 16, i8* %4, i32 1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_read_current_position(i8* %0) {
%2 = tail call i32 @KIONIX_ACCEL_read_bytes(i32 16, i8* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gmove_bca_1a2t_b3();
int /*<<< orphan*/ gmove_bca_1a2t_b4();
int /*<<< orphan*/ gmove_bca_1a2t_b5();
int /*<<< orphan*/ gmove_bca_1a2t_b6();
int main() {
  gmove_bca_1a2t_b3();
  gmove_bca_1a2t_b4();
  gmove_bca_1a2t_b5();
  gmove_bca_1a2t_b6();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <gmove_bca_1a2t_b3@plt>
xor    %eax,%eax
call   1050 <gmove_bca_1a2t_b4@plt>
xor    %eax,%eax
call   1040 <gmove_bca_1a2t_b5@plt>
xor    %eax,%eax
call   1060 <gmove_bca_1a2t_b6@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gmove_bca_1a2t_b3()
%3 = call i32 (...) @gmove_bca_1a2t_b4()
%4 = call i32 (...) @gmove_bca_1a2t_b5()
%5 = call i32 (...) @gmove_bca_1a2t_b6()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gmove_bca_1a2t_b3()
%2 = tail call i32 (...) @gmove_bca_1a2t_b4()
%3 = tail call i32 (...) @gmove_bca_1a2t_b5()
%4 = tail call i32 (...) @gmove_bca_1a2t_b6()
ret i32 0
}
int all_lower(str)
register unsigned char *str;
{
  while (*str) {
    if (!((*str) <= 0177) || !islower(*str))
      return (0);
    ++str;
  }
  return (1);
}


x86 assembly (clang, -O0):
<all_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <all_lower+0x5b>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x7f,%eax
jg     114e <all_lower+0x3e>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
jne    115a <all_lower+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1172 <all_lower+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <all_lower+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_lower>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114b <all_lower+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %al,%al
js     1150 <all_lower+0x40>
movzbl %al,%edi
call   1030 <islower@plt>
test   %eax,%eax
je     1150 <all_lower+0x40>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <all_lower+0x20>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @all_lower(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %20, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = icmp sle i32 %11, 127
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = call i32 @islower(i32 %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %13, %8
store i32 0, i32* %2
br label %24
20: ; preds = %13
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
br label %4
23: ; preds = %4
store i32 1, i32* %2
br label %24
24: ; preds = %23, %19
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @all_lower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %7
4: ; preds = %11
%5 = load i8, i8* %15
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %15, %4 ], [ %0, %1 ]
%10 = icmp sgt i8 %8, -1
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = zext i8 %8 to i32
%13 = tail call i32 @islower(i32 %12)
%14 = icmp eq i32 %13, 0
%15 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %14, label %16, label %4
16: ; preds = %11, %7, %4, %1
%17 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ], [ 0, %11 ]
ret i32 %17
}
int vqes_setlogmask(int pmask) { return (pmask); }


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

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

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

LLVM IR (-O2):
define i32 @vqes_setlogmask(i32 returned %0) {
ret i32 %0
}
int funcao() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @funcao() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t flow_hash(const void *key) { return *(uint32_t *)key; }


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

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

LLVM IR (-O0):
define i32 @flow_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @flow_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void RTSemEventMultiCreateEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemEventMultiCreateEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
void readCoefficients(float *a, float *b, float *c) {
  printf("Insert the coefficients a, b, c separated by commas\n");
  scanf("%f,%f,%f", &*a, &*b, &*c);
}


x86 assembly (clang, -O0):
<readCoefficients>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xee2(%rip),%rdi
call   1040 <scanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readCoefficients>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Insert the coefficients a, b, c separated by commas\0A\00"
@.str.1 = [9 x i8] c"%f,%f,%f\00"
define void @readCoefficients(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%8 = load float*, float** %4
%9 = load float*, float** %5
%10 = load float*, float** %6
%11 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %8, float* %9, float* %10)
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%f,%f,%f\00"
@str = [52 x i8] c"Insert the coefficients a, b, c separated by commas\00"
define void @readCoefficients(float* %0, float* %1, float* %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %0, float* %1, float* %2)
ret void
}
void lsi_b_closelog(void) {}


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

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

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

LLVM IR (-O2):
define void @lsi_b_closelog() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_timer(int /*<<< orphan*/);
void report_connect(void *p) {
  printf("Connected\n");
  set_timer(0);
}


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

x86 assembly (clang, -O2):
<report_connect>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <set_timer@plt>

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

LLVM IR (-O2):
@str = [10 x i8] c"Connected\00"
define void @report_connect(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @set_timer(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int my_strlen(char *);
int my_puts(char *str) {
  for (int i = 0; i < my_strlen(str); i++) {
    my_putchar(str[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<my_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    116e <my_puts+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <my_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <my_puts+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @my_puts(i8* %0) {
%2 = tail call i32 @my_strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %1
ret i32 0
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @my_putchar(i8 signext %8)
%10 = add nuw nsw i64 %6, 1
%11 = tail call i32 @my_strlen(i8* %0)
%12 = sext i32 %11 to i64
%13 = icmp slt i64 %10, %12
br i1 %13, label %5, label %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void ft_is_negative(int n) {
  if (n < 0) {
    putchar('N');
  } else {
    putchar('P');
  }
  return;
}


x86 assembly (clang, -O0):
<ft_is_negative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1134 <ft_is_negative+0x24>
mov    $0x4e,%edi
call   1030 <putchar@plt>
jmp    113e <ft_is_negative+0x2e>
mov    $0x50,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_is_negative>:
not    %edi
shr    $0x1f,%edi
add    %edi,%edi
add    $0x4e,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @ft_is_negative(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @putchar(i8 signext 78)
br label %9
7: ; preds = %1
%8 = call i32 @putchar(i8 signext 80)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @ft_is_negative(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i8 78, i8 80
%4 = tail call i32 @putchar(i8 signext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_get_prop_int() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_get_prop_int"
         "\n");
}


x86 assembly (clang, -O0):
<pa_format_info_get_prop_int>:
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_format_info_get_prop_int>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [44 x i8] c"NOT IMPLEMENTED:pa_format_info_get_prop_int\00"
define i32 @pa_format_info_get_prop_int() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
float truncf(float);
float TH_fracf(float x) { return x - truncf(x); }


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

x86 assembly (clang, -O2):
<TH_fracf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <truncf@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @TH_fracf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call float @llvm.trunc.f32(float %4)
%6 = fsub float %3, %5
ret float %6
}

LLVM IR (-O2):
define float @TH_fracf(float %0) {
%2 = tail call float @llvm.trunc.f32(float %0)
%3 = fsub float %0, %2
ret float %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int murmur_rotl32(int, int);
uint32_t murmur_round(uint32_t state, uint32_t data) {
  data *= 0xcc9e2d51;
  data = murmur_rotl32(data, 15);
  data *= 0x1b873593;
  state ^= data;
  state = murmur_rotl32(state, 13);
  state = state * 5 + 0xe6546b64;
  return state;
}


x86 assembly (clang, -O0):
<murmur_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0xcc9e2d51,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xf,%esi
call   1030 <murmur_rotl32@plt>
mov    %eax,-0x8(%rbp)
imul   $0x1b873593,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xd,%esi
call   1030 <murmur_rotl32@plt>
mov    %eax,-0x4(%rbp)
imul   $0x5,-0x4(%rbp),%eax
add    $0xe6546b64,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<murmur_round>:
push   %rbx
mov    %edi,%ebx
imul   $0xcc9e2d51,%esi,%edi
mov    $0xf,%esi
call   1030 <murmur_rotl32@plt>
imul   $0x1b873593,%eax,%edi
xor    %ebx,%edi
mov    $0xd,%esi
call   1030 <murmur_rotl32@plt>
lea    (%rax,%rax,4),%eax
add    $0xe6546b64,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @murmur_round(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = mul i32 %5, -862048943
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @murmur_rotl32(i32 %7, i32 15)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %9, 461845907
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = xor i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 @murmur_rotl32(i32 %14, i32 13)
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = mul nsw i32 %16, 5
%18 = add i32 %17, -430675100
store i32 %18, i32* %3
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @murmur_round(i32 %0, i32 %1) {
%3 = mul i32 %1, -862048943
%4 = tail call i32 @murmur_rotl32(i32 %3, i32 15)
%5 = mul nsw i32 %4, 461845907
%6 = xor i32 %5, %0
%7 = tail call i32 @murmur_rotl32(i32 %6, i32 13)
%8 = mul nsw i32 %7, 5
%9 = add i32 %8, -430675100
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_unlock(int /*<<< orphan*/ *);
int Thread_unlock_mutex(pthread_mutex_t *mutex) {
  int rc = -1;
  rc = pthread_mutex_unlock(mutex);
  return rc;
}


x86 assembly (clang, -O0):
<Thread_unlock_mutex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thread_unlock_mutex>:
jmp    1030 <pthread_mutex_unlock@plt>

LLVM IR (-O0):
define i32 @Thread_unlock_mutex(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 -1, i32* %3
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_unlock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @Thread_unlock_mutex(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  if (argc < 2)
    return -1;
  printf("%s\n", argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    113c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <main+0x47>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jl     1131 <main+0x21>
push   %rax
mov    0x8(%rsi),%rsi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ 0, %4 ], [ -1, %2 ]
ret i32 %9
}
int test_imm_E0uint8_mem(unsigned char *val) {
  return ((*val) & (0xE0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E0uint8_mem>:
cmpb   $0x20,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E0uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 32
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void setLeds(unsigned char ledMask) {
  unsigned int *data = ((unsigned int *)0x50023FFC);
  *data |= 0x01FE;
  *data &= ~(ledMask << 1) & ~1;
}


x86 assembly (clang, -O0):
<setLeds>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x50023ffc,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
or     $0x1fe,%ecx
mov    %ecx,(%rax)
movzbl -0x1(%rbp),%ecx
shl    $0x1,%ecx
xor    $0xffffffff,%ecx
and    $0xfffffffe,%ecx
mov    -0x10(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setLeds>:
mov    $0x1fe,%eax
or     0x50023ffc,%eax
not    %edi
add    %edi,%edi
and    %eax,%edi
mov    %edi,0x50023ffc
ret

LLVM IR (-O0):
define void @setLeds(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32*
store i8 %0, i8* %2
store i32* inttoptr (i64 1342324732 to i32*), i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = or i32 %5, 510
store i32 %6, i32* %4
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 1
%10 = xor i32 %9, -1
%11 = and i32 %10, -2
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = and i32 %13, %11
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @setLeds(i8 zeroext %0) {
%2 = load i32, i32* inttoptr (i64 1342324732 to i32*)
%3 = or i32 %2, 510
%4 = zext i8 %0 to i32
%5 = xor i32 %4, -1
%6 = shl nsw i32 %5, 1
%7 = and i32 %3, %6
store i32 %7, i32* inttoptr (i64 1342324732 to i32*)
ret void
}
void fa163(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    a:
      ({
        P025A:
          goto P025A;
          0;
      });
    p02C:
      goto p02C;
      goto a;
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa163>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa163+0x4>

x86 assembly (clang, -O2):
<fa163>:
jmp    1100 <fa163>

LLVM IR (-O0):
define void @fa163() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; No predecessors!
br label %22
22: ; preds = %22, %21
br label %22
23: ; preds = %23
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa163() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
void strncpy(char *dst, char *src, unsigned int len) {
  for (int i = 0; i < len; i++) {
    if (src[i] == '\0') {
      return;
    }
    dst[i] = src[i];
  }
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1160 <strncpy+0x60>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    113c <strncpy+0x3c>
jmp    1160 <strncpy+0x60>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <strncpy+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
test   %edx,%edx
je     1124 <strncpy+0x24>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rcx,1),%edx
test   %dl,%dl
je     1124 <strncpy+0x24>
mov    %dl,(%rdi,%rcx,1)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <strncpy+0x10>
ret

LLVM IR (-O0):
define void @strncpy(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
store i32 0, i32* %7
br label %8
8: ; preds = %31, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %34
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %12
br label %34
21: ; preds = %12
%22 = load i8*, i8** %5
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = load i8*, i8** %4
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
store i8 %26, i8* %30
br label %31
31: ; preds = %21
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
br label %8
34: ; preds = %20, %8
ret void
}

LLVM IR (-O2):
define void @strncpy(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %14, %12 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %10, i8* %13
%14 = add nuw nsw i64 %8, 1
%15 = icmp eq i64 %14, %6
br i1 %15, label %16, label %7
16: ; preds = %12, %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ report(int /*<<< orphan*/, char *, char const *,
                          int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void log_kevent_entry(const char *path) {
  report(LOG_ERR, "Unable to queue filter for file \"%s\": %s", path,
         strerror(errno));
}


x86 assembly (clang, -O0):
<log_kevent_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %eax,%ecx
lea    0xea2(%rip),%rsi
call   1030 <report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_kevent_entry>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <report@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [41 x i8] c"Unable to queue filter for file \22%s\22: %s\00"
@errno = global i32 0
define void @log_kevent_entry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_ERR
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i32 @strerror(i32 %5)
%7 = call i32 @report(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [41 x i8] c"Unable to queue filter for file \22%s\22: %s\00"
@errno = global i32 0
define void @log_kevent_entry(i8* %0) {
%2 = load i32, i32* @LOG_ERR
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @report(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _x86_choose_blitter();
int /*<<< orphan*/ init_allocator();
int iscreen_init_main(int, int, int);
int /*<<< orphan*/ pixellib_mmx_init();
int iscreen_init(int w, int h, int bpp) {
  init_allocator();
  _x86_choose_blitter();
  pixellib_mmx_init();
  return iscreen_init_main(w, h, bpp);
}


x86 assembly (clang, -O0):
<iscreen_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1060 <init_allocator@plt>
mov    $0x0,%al
call   1040 <_x86_choose_blitter@plt>
mov    $0x0,%al
call   1050 <pixellib_mmx_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <iscreen_init_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscreen_init>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <init_allocator@plt>
xor    %eax,%eax
call   1040 <_x86_choose_blitter@plt>
xor    %eax,%eax
call   1050 <pixellib_mmx_init@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <iscreen_init_main@plt>

LLVM IR (-O0):
define i32 @iscreen_init(i32 %0, i32 %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 = call i32 (...) @init_allocator()
%8 = call i32 (...) @_x86_choose_blitter()
%9 = call i32 (...) @pixellib_mmx_init()
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @iscreen_init_main(i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @iscreen_init(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @init_allocator()
%5 = tail call i32 (...) @_x86_choose_blitter()
%6 = tail call i32 (...) @pixellib_mmx_init()
%7 = tail call i32 @iscreen_init_main(i32 %0, i32 %1, i32 %2)
ret i32 %7
}
void txt_parameter(chan, control, value) {
  prtime();
  printf("Parameter, chan=%d c1=%d c2=%d\n", chan + 1, control, value);
}


x86 assembly (clang, -O0):
<txt_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_parameter>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <prtime@plt>
add    $0x1,%ebx
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Parameter, chan=%d c1=%d c2=%d\0A\00"
define void @txt_parameter(i32 %0, i32 %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 = call i32 (...) @prtime()
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Parameter, chan=%d c1=%d c2=%d\0A\00"
define void @txt_parameter(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @prtime()
%5 = add nsw i32 %0, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %1, i32 %2)
ret void
}