xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t strlen(const char *s) {
  size_t r;
  for (r = 0; s[r]; r++) {
  }
  return r;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1138 <strlen+0x38>
jmp    1127 <strlen+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
void concatStrsTestC() {
  char *result = concatStrs("test", "", 5);
  assert(result == '\0');
  printf("Test successful.");
}


x86 assembly (clang, -O0):
<concatStrsTestC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xecf(%rip),%rsi
mov    $0x5,%edx
mov    $0x0,%al
call   1050 <concatStrs@plt>
cltq
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concatStrsTestC>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    $0x5,%edx
xor    %eax,%eax
call   1050 <concatStrs@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
xor    %eax,%eax
call   1040 <assert@plt>
lea    0xea4(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [17 x i8] c"Test successful.\00"
define void @concatStrsTestC() {
%1 = alloca i8*
%2 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @concatStrs to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 5)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = icmp eq i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [17 x i8] c"Test successful.\00"
define void @concatStrsTestC() {
%1 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @concatStrs to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ test_recursive_once();
void test_recursive(void) {
  int i;
  srand(0);
  for (i = 0; i < 10; i++) {
    test_recursive_once();
  }
}


x86 assembly (clang, -O0):
<test_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <srand@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1155 <test_recursive+0x35>
mov    $0x0,%al
call   1040 <test_recursive_once@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <test_recursive+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_recursive>:
push   %rax
xor    %edi,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1040 <test_recursive_once@plt>
xor    %eax,%eax
call   1040 <test_recursive_once@plt>
xor    %eax,%eax
call   1040 <test_recursive_once@plt>
xor    %eax,%eax
call   1040 <test_recursive_once@plt>
xor    %eax,%eax
call   1040 <test_recursive_once@plt>
xor    %eax,%eax
call   1040 <test_recursive_once@plt>
xor    %eax,%eax
call   1040 <test_recursive_once@plt>
xor    %eax,%eax
call   1040 <test_recursive_once@plt>
xor    %eax,%eax
call   1040 <test_recursive_once@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_recursive_once@plt>

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

LLVM IR (-O2):
define void @test_recursive() {
%1 = tail call i32 @srand(i32 0)
%2 = tail call i32 (...) @test_recursive_once()
%3 = tail call i32 (...) @test_recursive_once()
%4 = tail call i32 (...) @test_recursive_once()
%5 = tail call i32 (...) @test_recursive_once()
%6 = tail call i32 (...) @test_recursive_once()
%7 = tail call i32 (...) @test_recursive_once()
%8 = tail call i32 (...) @test_recursive_once()
%9 = tail call i32 (...) @test_recursive_once()
%10 = tail call i32 (...) @test_recursive_once()
%11 = tail call i32 (...) @test_recursive_once()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void d() { printf("I am D\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"I am D\00"
define void @d() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
int f5(int x, int y) {
  if (y >= 0)
    __builtin_unreachable();
  return x % -y;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1114 <f5+0x14>
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f5(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 = icmp sge i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
unreachable
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 0, %10
%12 = srem i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f5(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
tail call void @llvm.assume(i1 %3)
%4 = sub nsw i32 0, %1
%5 = srem i32 %0, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ c_data;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int serial_write(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char, char *);
int /*<<< orphan*/ strlen(char *);
int serial_write_ctrlmsg(char *msg) {
  char c_data[5];
  memset(c_data, 0, sizeof(c_data));
  sprintf(c_data, "%c%s", '$', msg);
  return serial_write(c_data, strlen(c_data));
}


x86 assembly (clang, -O0):
<serial_write_ctrlmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xd(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1040 <memset@plt>
lea    -0xd(%rbp),%rdi
mov    -0x8(%rbp),%rcx
lea    0xe95(%rip),%rsi
mov    $0x24,%edx
call   1050 <sprintf@plt>
lea    -0xd(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xd(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1060 <serial_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write_ctrlmsg>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x3(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1040 <memset@plt>
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdi
mov    $0x24,%edx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1060 <serial_write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%c%s\00"
define i32 @serial_write_ctrlmsg(i8* %0) {
%2 = alloca i8*
%3 = alloca [5 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 5)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 36, i8* %7)
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @serial_write(i8* %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"%c%s\00"
define i32 @serial_write_ctrlmsg(i8* %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 5)
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 36, i8* %0)
%6 = call i32 @strlen(i8* %3)
%7 = call i32 @serial_write(i8* %3, i32 %6)
ret i32 %7
}
int isEmptyQ(int Q[], int front, int rear) {
  if (front == -1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isEmptyQ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1124 <isEmptyQ+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <isEmptyQ+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEmptyQ>:
xor    %eax,%eax
cmp    $0xffffffff,%esi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isEmptyQ(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ sem_destroy(int /*<<< orphan*/ *);
void semaDestroy(sem_t *sem) {
  sem_destroy(sem);
  return;
}


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

x86 assembly (clang, -O2):
<semaDestroy>:
jmp    1030 <sem_destroy@plt>

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

LLVM IR (-O2):
define void @semaDestroy(i32* %0) {
%2 = tail call i32 @sem_destroy(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void fatal(char *str) {
  perror(str);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *_ui64tow(unsigned long long, int /*<<< orphan*/ *, int);
wchar_t *ulltow(unsigned long long _n, wchar_t *_w, int _i) {
  return _ui64tow(_n, _w, _i);
}


x86 assembly (clang, -O0):
<ulltow>:
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
call   1030 <_ui64tow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulltow>:
jmp    1030 <_ui64tow@plt>

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

LLVM IR (-O2):
define i32* @ulltow(i64 %0, i32* %1, i32 %2) {
%4 = tail call i32* @_ui64tow(i64 %0, i32* %1, i32 %2)
ret i32* %4
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int32_t QEIDirectionGet(uint32_t ui32Base) {
  ASSERT((ui32Base == 0x4002C000) || (ui32Base == 0x4002D000));
  return (((*((volatile uint32_t *)(ui32Base + 0x00000004))) & 0x00000002) ? -1
                                                                           : 1);
}


x86 assembly (clang, -O0):
<QEIDirectionGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x4002c000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113a <QEIDirectionGet+0x2a>
cmpl   $0x4002d000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cltq
mov    (%rax),%edx
and    $0x2,%edx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIDirectionGet>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x4002c000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x4(%rax),%eax
and    $0x2,%eax
neg    %eax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @QEIDirectionGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073922048
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1073926144
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @ASSERT(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 4
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = and i32 %16, 2
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 -1, i32 1
ret i32 %20
}

LLVM IR (-O2):
define i32 @QEIDirectionGet(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073922048
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 4
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, 2
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 1, i32 -1
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int s_isshm(mode_t mode) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @s_isshm(i32 %0) {
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
void hw_get_adc_values(uint16_t *i_out_raw, uint16_t *v_in_raw,
                       uint16_t *v_out_raw) {
  *i_out_raw = 0;
  *v_in_raw = 0;
  *v_out_raw = 0;
}


x86 assembly (clang, -O0):
<hw_get_adc_values>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hw_get_adc_values>:
movq   $0x0,(%rdi)
movq   $0x0,(%rsi)
movq   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define void @hw_get_adc_values(i64* nocapture writeonly %0, i64* nocapture writeonly %1, i64* nocapture writeonly %2) {
store i64 0, i64* %0
store i64 0, i64* %1
store i64 0, i64* %2
ret void
}
void my_func(double *x, double y) {
  if (*x < y)
    *x = y;
}


x86 assembly (clang, -O0):
<my_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <my_func+0x31>
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_func>:
ucomisd (%rdi),%xmm0
jbe    110a <my_func+0xa>
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @my_func(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load double, double* %4
%11 = load double*, double** %3
store double %10, double* %11
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @my_func(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp olt double %3, %1
br i1 %4, label %5, label %6
5: ; preds = %2
store double %1, double* %0
br label %6
6: ; preds = %5, %2
ret void
}
int v5dHHMMSStoSeconds(int hhmmss) {
  int h, m, s;
  h = hhmmss / 10000;
  m = (hhmmss / 100) % 100;
  s = hhmmss % 100;
  return s + m * 60 + h * 60 * 60;
}


x86 assembly (clang, -O0):
<v5dHHMMSStoSeconds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   $0x3c,-0xc(%rbp),%ecx
add    %ecx,%eax
imul   $0x3c,-0x8(%rbp),%ecx
imul   $0x3c,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<v5dHHMMSStoSeconds>:
movslq %edi,%rcx
imul   $0x68db8bad,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rax
add    %edx,%eax
imul   $0x51eb851f,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x25,%rdx
add    %esi,%edx
movslq %edx,%rdx
imul   $0x51eb851f,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x25,%rsi
add    %edi,%esi
imul   $0x64,%esi,%esi
imul   $0x64,%edx,%edi
sub    %esi,%edx
sub    %edi,%ecx
imul   $0x3c,%edx,%edx
imul   $0xe10,%eax,%eax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @v5dHHMMSStoSeconds(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 10000
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 100
%10 = srem i32 %9, 100
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = srem i32 %11, 100
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 60
%16 = add nsw i32 %13, %15
%17 = load i32, i32* %3
%18 = mul nsw i32 %17, 60
%19 = mul nsw i32 %18, 60
%20 = add nsw i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @v5dHHMMSStoSeconds(i32 %0) {
%2 = sdiv i32 %0, 10000
%3 = sdiv i32 %0, 100
%4 = srem i32 %3, 100
%5 = srem i32 %0, 100
%6 = mul nsw i32 %4, 60
%7 = mul nsw i32 %2, 3600
%8 = add nsw i32 %7, %5
%9 = add nsw i32 %8, %6
ret i32 %9
}
/* Type definitions */
struct test {
  int dummy;
};

/* Variables and functions */
int priv_vm_munlock_setup(int asroot, int injail, struct test *test) {
  return (0);
}


x86 assembly (clang, -O0):
<priv_vm_munlock_setup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test = type { i32 }
define i32 @priv_vm_munlock_setup(i32 %0, i32 %1, %struct.test* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.test*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.test* %2, %struct.test** %6
ret i32 0
}

LLVM IR (-O2):
%struct.test = type { i32 }
define i32 @priv_vm_munlock_setup(i32 %0, i32 %1, %struct.test* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
struct contacts {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ display(struct contacts *);
struct contacts *readcon(char *, struct contacts *);
int main(void) {
  struct contacts *head;
  head = readcon("contracts.dat", head);
  display(head);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <readcon@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <readcon@plt>
mov    %rax,%rdi
call   1030 <display@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.contacts = type { i32 }
@.str = [14 x i8] c"contracts.dat\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.contacts*
store i32 0, i32* %1
%3 = load %struct.contacts*, %struct.contacts** %2
%4 = call %struct.contacts* @readcon(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.contacts* %3)
store %struct.contacts* %4, %struct.contacts** %2
%5 = load %struct.contacts*, %struct.contacts** %2
%6 = call i32 @display(%struct.contacts* %5)
ret i32 0
}

LLVM IR (-O2):
%struct.contacts = type { i32 }
@.str = [14 x i8] c"contracts.dat\00"
define i32 @main() {
%1 = tail call %struct.contacts* @readcon(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.contacts* undef)
%2 = tail call i32 @display(%struct.contacts* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ sig_unblock(int /*<<< orphan*/);
extern void sig_alarm_unblock(void) { sig_unblock(SIGALRM); }


x86 assembly (clang, -O0):
<sig_alarm_unblock>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sig_unblock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_alarm_unblock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_unblock@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @sig_alarm_unblock() {
%1 = load i32, i32* @SIGALRM
%2 = call i32 @sig_unblock(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @sig_alarm_unblock() {
%1 = load i32, i32* @SIGALRM
%2 = tail call i32 @sig_unblock(i32 %1)
ret void
}
/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ uart_put(char const);
void uart_puts(const char *str) {
  const int len = strlen(str);
  for (int i = 0; i < len; ++i) {
    uart_put(str[i]);
  }
}


x86 assembly (clang, -O0):
<uart_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116a <uart_puts+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <uart_put@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <uart_puts+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_puts>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1153 <uart_puts+0x33>
mov    %eax,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <uart_put@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <uart_puts+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @uart_puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %7
6: ; preds = %7, %1
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @uart_put(i8 signext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
char *alloc_str(char const *const);
char **xrealloc(char **, int);
void add_str(register char ***const arr, register const unsigned int size,
             register const char *const str) {
  *arr = xrealloc(*arr, sizeof(char *) * (size + 1));
  (*arr)[size] = alloc_str(str);
}


x86 assembly (clang, -O0):
<add_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x3,%rax
mov    %eax,%esi
call   1040 <xrealloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <alloc_str@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0xc(%rbp),%ecx
mov    %rdx,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_str>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
mov    (%rdi),%rdi
lea    0x8(,%r15,8),%esi
call   1040 <xrealloc@plt>
mov    %rax,(%rbx)
mov    %r14,%rdi
call   1030 <alloc_str@plt>
mov    (%rbx),%rcx
mov    %r15d,%edx
mov    %rax,(%rcx,%rdx,8)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @add_str(i8*** %0, i32 %1, i8* %2) {
%4 = alloca i8***
%5 = alloca i32
%6 = alloca i8*
store i8*** %0, i8**** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8***, i8**** %4
%8 = load i8**, i8*** %7
%9 = load i32, i32* %5
%10 = add i32 %9, 1
%11 = zext i32 %10 to i64
%12 = mul i64 8, %11
%13 = trunc i64 %12 to i32
%14 = call i8** @xrealloc(i8** %8, i32 %13)
%15 = load i8***, i8**** %4
store i8** %14, i8*** %15
%16 = load i8*, i8** %6
%17 = call i8* @alloc_str(i8* %16)
%18 = load i8***, i8**** %4
%19 = load i8**, i8*** %18
%20 = load i32, i32* %5
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
store i8* %17, i8** %22
ret void
}

LLVM IR (-O2):
define void @add_str(i8*** nocapture %0, i32 %1, i8* %2) {
%4 = load i8**, i8*** %0
%5 = shl i32 %1, 3
%6 = add i32 %5, 8
%7 = tail call i8** @xrealloc(i8** %4, i32 %6)
store i8** %7, i8*** %0
%8 = tail call i8* @alloc_str(i8* %2)
%9 = load i8**, i8*** %0
%10 = zext i32 %1 to i64
%11 = getelementptr inbounds i8*, i8** %9, i64 %10
store i8* %8, i8** %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void error(const char *reason) {
  (void)printf("Fatal error: %s\n", reason);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Fatal error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"Fatal error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ isspace(unsigned char);
char *skip_whitespace(char const *);
char *skip_token(const char *p) {
  p = skip_whitespace(p);
  while (*p && !isspace((unsigned char)*p))
    ++p;
  return (char *)p;
}


x86 assembly (clang, -O0):
<skip_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skip_whitespace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1165 <skip_token+0x45>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1175 <skip_token+0x55>
jmp    1186 <skip_token+0x66>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1139 <skip_token+0x19>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_token>:
push   %rbx
call   1040 <skip_whitespace@plt>
mov    %rax,%rbx
mov    (%rax),%al
test   %al,%al
je     1148 <skip_token+0x28>
nop
movzbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1148 <skip_token+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <skip_token+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_token(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @skip_whitespace(i8* %3)
store i8* %4, i8** %2
br label %5
5: ; preds = %18, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = call i32 @isspace(i8 zeroext %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br label %16
16: ; preds = %10, %5
%17 = phi i1 [ false, %5 ], [ %15, %10 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %5
21: ; preds = %16
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @skip_token(i8* %0) {
%2 = tail call i8* @skip_whitespace(i8* %0)
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %10
%6 = phi i8 [ %12, %10 ], [ %3, %1 ]
%7 = phi i8* [ %11, %10 ], [ %2, %1 ]
%8 = tail call i32 @isspace(i8 zeroext %6)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %1
%15 = phi i8* [ %2, %1 ], [ %11, %10 ], [ %7, %5 ]
ret i8* %15
}
unsigned char get_PCB_Version(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @get_PCB_Version() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @get_PCB_Version() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void sigalrm_handler(int signum) { assert(0 && "Please fill me!"); }


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

x86 assembly (clang, -O2):
<sigalrm_handler>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @sigalrm_handler(i32 %0) {
%2 = tail call i32 @assert(i32 0)
ret void
}
unsigned char GetMAX(unsigned char a, unsigned char b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<GetMAX>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x2(%rbp),%eax
movzbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
jle    112b <GetMAX+0x2b>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1131 <GetMAX+0x31>
mov    -0x3(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMAX>:
mov    %esi,%eax
cmp    %al,%dil
cmova  %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @GetMAX(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp ugt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ system(char *);
void helloFork(char *__command) {
  printf("[%s]\tLaunching (PID=%d)...\n", __command, getpid());
  system(__command);
}


x86 assembly (clang, -O0):
<helloFork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helloFork>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"[%s]\09Launching (PID=%d)...\0A\00"
define void @helloFork(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @getpid()
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4)
%6 = load i8*, i8** %2
%7 = call i32 @system(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"[%s]\09Launching (PID=%d)...\0A\00"
define void @helloFork(i8* %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
%4 = tail call i32 @system(i8* %0)
ret void
}
int asln_bind_mbutton(int btn, char *action) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @asln_bind_mbutton(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
unsigned int __aeabi_uidivmod(unsigned int, unsigned int);
unsigned int __aeabi_uidiv(unsigned int numerator, unsigned int denominator) {
  return __aeabi_uidivmod(numerator, denominator);
}


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

x86 assembly (clang, -O2):
<__aeabi_uidiv>:
jmp    1030 <__aeabi_uidivmod@plt>

LLVM IR (-O0):
define i32 @__aeabi_uidiv(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 @__aeabi_uidivmod(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__aeabi_uidiv(i32 %0, i32 %1) {
%3 = tail call i32 @__aeabi_uidivmod(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int skipLine(char *line) {
  if (line == NULL) {
    return 1;
  }
  if (line[0] == '#') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<skipLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <skipLine+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1142 <skipLine+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    113b <skipLine+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <skipLine+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipLine>:
test   %rdi,%rdi
je     110e <skipLine+0xe>
xor    %eax,%eax
cmpb   $0x23,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @skipLine(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 35
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_cvector(char *v, int nl, int nh) { free((char *)(v + nl)); }


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

x86 assembly (clang, -O2):
<free_cvector>:
movslq %esi,%rax
add    %rax,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_cvector(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
define void @free_cvector(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
double cgi_getnentrydouble(char const *, int /*<<< orphan*/);
double cgi_getentrydouble(const char *field_name) {
  return cgi_getnentrydouble(field_name, 0);
}


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

x86 assembly (clang, -O2):
<cgi_getentrydouble>:
xor    %esi,%esi
jmp    1030 <cgi_getnentrydouble@plt>

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

LLVM IR (-O2):
define double @cgi_getentrydouble(i8* %0) {
%2 = tail call double @cgi_getnentrydouble(i8* %0, i32 0)
ret double %2
}
int a_twist_b_on_corner(corner)
int corner;
{
  int temp_arr[8];
  a_corner_unpack(corner, temp_arr);
  four_cycle(temp_arr, 7, 6, 2, 1);
  adjust_corner(temp_arr, 7, 6, 2, 1);
  return a_corner_pack(temp_arr);
}


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

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

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

LLVM IR (-O2):
define i32 @a_twist_b_on_corner(i32 %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_corner_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 7, i32 6, i32 2, i32 1)
%7 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @adjust_corner to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 7, i32 6, i32 2, i32 1)
%8 = call i32 (i32*, ...) bitcast (i32 (...)* @a_corner_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %8
}
/* Variables and functions */
int ffs(int mask) {
  int bit;
  if (mask == 0)
    return (0);
  for (bit = 1; !(mask & 1); bit++)
    mask = (unsigned int)mask >> 1;
  return (bit);
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <ffs+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    115c <ffs+0x5c>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113f <ffs+0x3f>
jmp    1156 <ffs+0x56>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <ffs+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
test   %edi,%edi
je     112e <ffs+0x2e>
mov    $0x1,%eax
test   $0x1,%dil
jne    112d <ffs+0x2d>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1120 <ffs+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ffs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %22
8: ; preds = %1
store i32 1, i32* %4
br label %9
9: ; preds = %17, %8
%10 = load i32, i32* %3
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %20
14: ; preds = %9
%15 = load i32, i32* %3
%16 = lshr i32 %15, 1
store i32 %16, i32* %3
br label %17
17: ; preds = %14
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %9
20: ; preds = %9
%21 = load i32, i32* %4
store i32 %21, i32* %2
br label %22
22: ; preds = %20, %7
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i32 [ %9, %6 ], [ %0, %3 ]
%9 = lshr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %10, %6 ]
ret i32 %14
}