xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("count relays on usb-Relay\n");
  printf("usage: ./count\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"count relays on usb-Relay\0A\00"
@.str.1 = [16 x i8] c"usage: ./count\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [26 x i8] c"count relays on usb-Relay\00"
@str.2 = [15 x i8] c"usage: ./count\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct dirent {
  char *d_name;
};

/* Variables and functions */
int nodots(const struct dirent *dp) { return (dp->d_name[0] != '.'); }


x86 assembly (clang, -O0):
<nodots>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nodots>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmpb   $0x2e,(%rcx)
setne  %al
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
define i32 @nodots(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 46
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
define i32 @nodots(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 46
%6 = zext i1 %5 to i32
ret i32 %6
}
void RTFileRename(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileRename() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CE_High();
int /*<<< orphan*/ CE_Low();
unsigned char SO();
void Poll_SO() {
  unsigned char temp = 0;
  CE_Low();
  while (temp == 0x00)
    temp = SO();
  CE_High();
}


x86 assembly (clang, -O0):
<Poll_SO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1050 <CE_Low@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    115f <Poll_SO+0x2f>
mov    $0x0,%al
call   1040 <SO@plt>
mov    %al,-0x1(%rbp)
jmp    1143 <Poll_SO+0x13>
mov    $0x0,%al
call   1030 <CE_High@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Poll_SO>:
push   %rax
xor    %eax,%eax
call   1050 <CE_Low@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <SO@plt>
test   %al,%al
je     1140 <Poll_SO+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CE_High@plt>

LLVM IR (-O0):
define void @Poll_SO() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 (...) @CE_Low()
br label %3
3: ; preds = %7, %0
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call zeroext i8 (...) @SO()
store i8 %8, i8* %1
br label %3
9: ; preds = %3
%10 = call i32 (...) @CE_High()
ret void
}

LLVM IR (-O2):
define void @Poll_SO() {
%1 = tail call i32 (...) @CE_Low()
br label %2
2: ; preds = %0, %2
%3 = tail call zeroext i8 (...) @SO()
%4 = icmp eq i8 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 (...) @CE_High()
ret void
}
unsigned long hash_csum(char *str) {
  unsigned long csum = 5381;
  char c;
  while (str && *str != '\0') {
    c = *str++;
    csum = ((csum << 5) + csum) ^ c;
  }
  return csum;
}


x86 assembly (clang, -O0):
<hash_csum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x12(%rbp)
je     1130 <hash_csum+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1140 <hash_csum+0x40>
jmp    1171 <hash_csum+0x71>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movsbq -0x11(%rbp),%rcx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_csum+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_csum>:
mov    $0x1505,%eax
test   %rdi,%rdi
je     113c <hash_csum+0x3c>
mov    (%rdi),%cl
test   %cl,%cl
je     113c <hash_csum+0x3c>
add    $0x1,%rdi
mov    $0x1505,%eax
nopl   0x0(%rax)
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
xor    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <hash_csum+0x20>
ret

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

LLVM IR (-O2):
define i64 @hash_csum(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %14, %6 ], [ %4, %3 ]
%8 = phi i64 [ %13, %6 ], [ 5381, %3 ]
%9 = phi i8* [ %10, %6 ], [ %0, %3 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = mul i64 %8, 33
%12 = sext i8 %7 to i64
%13 = xor i64 %11, %12
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %3, %1
%17 = phi i64 [ 5381, %1 ], [ 5381, %3 ], [ %13, %6 ]
ret i64 %17
}
int comma_3() {
  int a = 9, b = 7, c = 3;
  int d = (a = a * 2, b = 7 * a++, c = a + b + 9, c);
  return d;
}


x86 assembly (clang, -O0):
<comma_3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x9,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
imul   $0x7,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x9,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @comma_3() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 9, i32* %1
store i32 7, i32* %2
store i32 3, i32* %3
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, 2
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = mul nsw i32 7, %7
store i32 %9, i32* %2
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = add nsw i32 %10, %11
%13 = add nsw i32 %12, 9
store i32 %13, i32* %3
%14 = load i32, i32* %3
store i32 %14, i32* %4
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
define i32 @comma_3() {
ret i32 154
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void randomRanks(int *B) {
  time_t t;
  srand((unsigned)time(&t));
  for (int i = 0; i < 100; i++) {
    B[i] = rand() % 1000000;
  }
}


x86 assembly (clang, -O0):
<randomRanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jge    1185 <randomRanks+0x55>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1153 <randomRanks+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomRanks>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x4(%rsp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1150 <randomRanks+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @randomRanks(i32* nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i64 @time(i32* %2)
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
br label %8
7: ; preds = %8
ret void
8: ; preds = %1, %8
%9 = phi i64 [ 0, %1 ], [ %13, %8 ]
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 1000000
%12 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %11, i32* %12
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, 100
br i1 %14, label %7, label %8
}
void *llvm_gc_read(void *ObjPtr, void **FieldPtr) { return *FieldPtr; }


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

x86 assembly (clang, -O2):
<llvm_gc_read>:
mov    (%rsi),%rax
ret

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

LLVM IR (-O2):
define i8* @llvm_gc_read(i8* nocapture readnone %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world !!!!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"hello world !!!!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"hello world !!!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void RTTimerLRCreateEx(void) {}


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

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

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

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

/* Variables and functions */
intptr_t st_pop(struct forth_instance *);
int /*<<< orphan*/ st_push(struct forth_instance *, intptr_t);
void lshift(struct forth_instance *fi) {
  intptr_t tp;
  tp = st_pop(fi);
  st_push(fi, st_pop(fi) << tp);
}


x86 assembly (clang, -O0):
<lshift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
mov    -0x10(%rbp),%rcx
shl    %cl,%rsi
call   1040 <st_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lshift>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <st_pop@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <st_pop@plt>
mov    %r14d,%ecx
shl    %cl,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @lshift(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
%3 = alloca i64
store %struct.forth_instance* %0, %struct.forth_instance** %2
%4 = load %struct.forth_instance*, %struct.forth_instance** %2
%5 = call i64 @st_pop(%struct.forth_instance* %4)
store i64 %5, i64* %3
%6 = load %struct.forth_instance*, %struct.forth_instance** %2
%7 = load %struct.forth_instance*, %struct.forth_instance** %2
%8 = call i64 @st_pop(%struct.forth_instance* %7)
%9 = load i64, i64* %3
%10 = shl i64 %8, %9
%11 = call i32 @st_push(%struct.forth_instance* %6, i64 %10)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @lshift(%struct.forth_instance* %0) {
%2 = tail call i64 @st_pop(%struct.forth_instance* %0)
%3 = tail call i64 @st_pop(%struct.forth_instance* %0)
%4 = shl i64 %3, %2
%5 = tail call i32 @st_push(%struct.forth_instance* %0, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attrset(int /*<<< orphan*/);
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int);
int register_pair(void) {
  for (int i = 0; i < 256; i++) {
    init_pair(i, 0, i);
    attrset(COLOR_PAIR(i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<register_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1176 <register_pair+0x46>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <init_pair@plt>
mov    -0x4(%rbp),%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attrset@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <register_pair+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_pair>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <init_pair@plt>
mov    %ebx,%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attrset@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1140 <register_pair+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @register_pair() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 256
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* %1
%8 = call i32 @init_pair(i32 %6, i32 0, i32 %7)
%9 = load i32, i32* %1
%10 = call i32 @COLOR_PAIR(i32 %9)
%11 = call i32 @attrset(i32 %10)
br label %12
12: ; preds = %5
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @register_pair() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %7, %2 ]
%4 = tail call i32 @init_pair(i32 %3, i32 0, i32 %3)
%5 = tail call i32 @COLOR_PAIR(i32 %3)
%6 = tail call i32 @attrset(i32 %5)
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 256
br i1 %8, label %1, label %2
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
void TimerMatchSet64(uint32_t ui32Base, uint64_t ui64Value) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000034))) = ui64Value >> 32;
  (*((volatile uint32_t *)(ui32Base + 0x00000030))) = ui64Value & 0xffffffff;
}


x86 assembly (clang, -O0):
<TimerMatchSet64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x34,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
and    $0xffffffff,%ecx
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerMatchSet64>:
movslq %edi,%rax
mov    %esi,0x30(%rax)
ret

LLVM IR (-O0):
define void @TimerMatchSet64(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 = ashr i32 %5, 32
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 52
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %6, i32* %10
%11 = load i32, i32* %4
%12 = and i32 %11, -1
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 48
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
define void @TimerMatchSet64(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 52
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 poison, i32* %5
%6 = add nsw i32 %0, 48
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %1, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rfact(int);
int main() {
  printf("%d\n", rfact(10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <rfact@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <rfact@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @rfact(i32 10)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @rfact(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t delay_calc_time_us(uint64_t start_timestamp, uint64_t end_timestamp) {
  if (start_timestamp > end_timestamp) {
    return 0;
  }
  return (end_timestamp - start_timestamp) / 3;
}


x86 assembly (clang, -O0):
<delay_calc_time_us>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <delay_calc_time_us+0x27>
movq   $0x0,-0x8(%rbp)
jmp    113d <delay_calc_time_us+0x3d>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    $0x3,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_calc_time_us>:
sub    %rdi,%rsi
jge    1108 <delay_calc_time_us+0x8>
xor    %eax,%eax
ret
movabs $0x5555555555555556,%rcx
55 55 55
mov    %rsi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @delay_calc_time_us(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp sgt i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i64 0, i64* %3
br label %15
10: ; preds = %2
%11 = load i64, i64* %5
%12 = load i64, i64* %4
%13 = sub nsw i64 %11, %12
%14 = sdiv i64 %13, 3
store i64 %14, i64* %3
br label %15
15: ; preds = %10, %9
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @delay_calc_time_us(i64 %0, i64 %1) {
%3 = icmp slt i64 %1, %0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sub nsw i64 %1, %0
%6 = sdiv i64 %5, 3
br label %7
7: ; preds = %2, %4
%8 = phi i64 [ %6, %4 ], [ 0, %2 ]
ret i64 %8
}
/* Variables and functions */
char *str_slicep(char const *, char const *);
char *str_slicel(const char *from, long l) {
  return str_slicep(from, from + l);
}


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

x86 assembly (clang, -O2):
<str_slicel>:
add    %rdi,%rsi
jmp    1030 <str_slicep@plt>

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

LLVM IR (-O2):
define i8* @str_slicel(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = tail call i8* @str_slicep(i8* %0, i8* %3)
ret i8* %4
}
/* Variables and functions */
int check_egn(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char egn[12];
  scanf("%s", egn);
  printf("%d", check_egn(egn));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x10(%rbp),%rdi
call   1050 <check_egn@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <check_egn@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%6 = call i32 @check_egn(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @check_egn(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
void X(float *d, float s) {
  d[0] *= s;
  d[1] *= s;
  d[2] *= s;
}


x86 assembly (clang, -O0):
<X>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<X>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @X(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = fmul float %8, %5
store float %9, float* %7
%10 = load float, float* %4
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fmul float %13, %10
store float %14, float* %12
%15 = load float, float* %4
%16 = load float*, float** %3
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
%19 = fmul float %18, %15
store float %19, float* %17
ret void
}

LLVM IR (-O2):
define void @X(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret void
}
double realtime() { return -1.0; }


x86 assembly (clang, -O0):
<realtime>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<realtime>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @realtime() {
ret double -1.000000e+00
}

LLVM IR (-O2):
define double @realtime() {
ret double -1.000000e+00
}
int hash_function(int hash, int tablesize) {
  int ret = (hash) % tablesize;
  if (ret < 0)
    ret = ret * -1;
  return ret;
}


x86 assembly (clang, -O0):
<hash_function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1125 <hash_function+0x25>
imul   $0xffffffff,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @hash_function(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = tail call i32 @llvm.abs.i32(i32 %3, i1 true)
ret i32 %4
}
/* Variables and functions */
int acc_is_present(void *, size_t);
int is_mapped(void *p, size_t n) { return acc_is_present(p, n); }


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

x86 assembly (clang, -O2):
<is_mapped>:
jmp    1030 <acc_is_present@plt>

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

LLVM IR (-O2):
define i32 @is_mapped(i8* %0, i64 %1) {
%3 = tail call i32 @acc_is_present(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ term_minibuf_write(char *);
void minibuf_clear(void) { term_minibuf_write(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @minibuf_clear() {
%1 = call i32 @term_minibuf_write(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @minibuf_clear() {
%1 = tail call i32 @term_minibuf_write(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int);
void DoTwoRPut(void) { InlineWords(2, 40, 40); }


x86 assembly (clang, -O0):
<DoTwoRPut>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x28,%edx
mov    %edx,%esi
call   1030 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoTwoRPut>:
mov    $0x2,%edi
mov    $0x28,%esi
mov    $0x28,%edx
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoTwoRPut() {
%1 = call i32 @InlineWords(i32 2, i32 40, i32 40)
ret void
}

LLVM IR (-O2):
define void @DoTwoRPut() {
%1 = tail call i32 @InlineWords(i32 2, i32 40, i32 40)
ret void
}
int main() {
  int arg1 = 68;
  int arg2 = 0;
  int mov = 0;
  __asm__("movl %%ecx, %%eax;" : "=a"(mov) : "c"(arg1), "a"(arg2));
  return mov;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 68, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm "movl %ecx, %eax;", "={ax},{cx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "movl %ecx, %eax;", "={ax},{cx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fid_run_freebuf(void *runbuf) { free(runbuf); }


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

x86 assembly (clang, -O2):
<fid_run_freebuf>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @fid_run_freebuf(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int is_abundant(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  for (int i = 0; i < 1000; ++i) {
    if (is_abundant(i) == 1)
      printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1176 <main+0x56>
mov    -0x8(%rbp),%edi
call   1040 <is_abundant@plt>
cmp    $0x1,%eax
jne    1163 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
jmp    113b <main+0x1b>
nop
add    $0x1,%ebx
cmp    $0x3e8,%ebx
je     1153 <main+0x33>
mov    %ebx,%edi
call   1040 <is_abundant@plt>
cmp    $0x1,%eax
jne    1130 <main+0x10>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %2
1: ; preds = %8
ret i32 0
2: ; preds = %0, %8
%3 = phi i32 [ 0, %0 ], [ %9, %8 ]
%4 = tail call i32 @is_abundant(i32 %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %8
8: ; preds = %2, %6
%9 = add nuw nsw i32 %3, 1
%10 = icmp eq i32 %9, 1000
br i1 %10, label %1, label %2
}
int PckBacpSerialRsp(unsigned char *pRqtFrm, int nRqtFrmLen,
                     unsigned char *pRspFrm) {
  unsigned char nSeq;
  if (((void *)0) == pRspFrm) {
    return 0;
  }
  memcpy(&nSeq, (pRqtFrm + 5), 1);
  return PckBacpSerialRspEx(nSeq, pRspFrm);
}


x86 assembly (clang, -O0):
<PckBacpSerialRsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    113b <PckBacpSerialRsp+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1157 <PckBacpSerialRsp+0x47>
mov    -0x10(%rbp),%rax
mov    0x5(%rax),%al
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <PckBacpSerialRspEx@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PckBacpSerialRsp>:
test   %rdx,%rdx
je     1123 <PckBacpSerialRsp+0x13>
movzbl 0x5(%rdi),%edi
mov    %rdx,%rsi
xor    %eax,%eax
jmp    1030 <PckBacpSerialRspEx@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @PckBacpSerialRsp(i8* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%9 = load i8*, i8** %7
%10 = icmp eq i8* null, %9
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %4
br label %19
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 5
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = load i8*, i8** %7
%18 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @PckBacpSerialRspEx to i32 (i32, i8*, ...)*)(i32 %16, i8* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %12, %11
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @PckBacpSerialRsp(i8* nocapture %0, i32 %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %0, i64 5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @PckBacpSerialRspEx to i32 (i32, i8*, ...)*)(i32 %8, i8* %2)
br label %10
10: ; preds = %3, %5
%11 = phi i32 [ %9, %5 ], [ 0, %3 ]
ret i32 %11
}
void g_list_insert() {}


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

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

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

LLVM IR (-O2):
define void @g_list_insert() {
ret void
}
int _mr_dictionary_char_value(const char *word, unsigned int length,
                              unsigned int pos) {
  if (pos < length) {
    return (int)((unsigned char)word[pos]);
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<_mr_dictionary_char_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    112d <_mr_dictionary_char_value+0x2d>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <_mr_dictionary_char_value+0x34>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mr_dictionary_char_value>:
mov    $0xffffffff,%eax
cmp    %esi,%edx
jae    110f <_mr_dictionary_char_value+0xf>
mov    %edx,%eax
movzbl (%rdi,%rax,1),%eax
ret

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

LLVM IR (-O2):
define i32 @_mr_dictionary_char_value(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %2, %1
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
br label %10
10: ; preds = %3, %5
%11 = phi i32 [ %9, %5 ], [ -1, %3 ]
ret i32 %11
}
double berechne_tilgungsrate(double kredit, double tilgungssatz) {
  double tilgungsrate = kredit * tilgungssatz;
  return tilgungsrate;
}


x86 assembly (clang, -O0):
<berechne_tilgungsrate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<berechne_tilgungsrate>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @berechne_tilgungsrate(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fmul double %6, %7
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @berechne_tilgungsrate(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
char *cloneString(int /*<<< orphan*/);
int /*<<< orphan*/ skipToNumeric(char *);
char *splitOffNumber(char *db) { return cloneString(skipToNumeric(db)); }


x86 assembly (clang, -O0):
<splitOffNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skipToNumeric@plt>
mov    %eax,%edi
call   1030 <cloneString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitOffNumber>:
push   %rax
call   1040 <skipToNumeric@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <cloneString@plt>

LLVM IR (-O0):
define i8* @splitOffNumber(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @skipToNumeric(i8* %3)
%5 = call i8* @cloneString(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @splitOffNumber(i8* %0) {
%2 = tail call i32 @skipToNumeric(i8* %0)
%3 = tail call i8* @cloneString(i32 %2)
ret i8* %3
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ ungetch(char);
void ungets(char s[]) {
  int len;
  len = strlen(s);
  for (; len > 0;)
    ungetch(s[--len]);
}


x86 assembly (clang, -O0):
<ungets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1160 <ungets+0x40>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <ungetch@plt>
jmp    1138 <ungets+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungets>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1157 <ungets+0x37>
mov    %eax,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
movsbl (%r14,%rax,1),%edi
call   1040 <ungetch@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1140 <ungets+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ungets(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @ungetch(i8 signext %11)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func(int);
int main() {
  func(0);
  func(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <func@plt>
mov    $0x1,%edi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <func@plt>
mov    $0x1,%edi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @func(i32 0)
%2 = call i32 @func(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 0)
%2 = tail call i32 @func(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ custom_iowrite(unsigned char);
void myprintinteger(int number, unsigned char iStart) {
  unsigned char digit;
  if (number == 0) {
    if (iStart) {
      custom_iowrite('0');
    }
    return;
  }
  digit = (number % 10) + 0x30;
  myprintinteger(number / 10, 0);
  custom_iowrite(digit);
  return;
}


x86 assembly (clang, -O0):
<myprintinteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1154 <myprintinteger+0x34>
cmpb   $0x0,-0x5(%rbp)
je     114f <myprintinteger+0x2f>
mov    $0x30,%edi
call   1040 <custom_iowrite@plt>
jmp    1184 <myprintinteger+0x64>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
xor    %esi,%esi
call   1030 <myprintinteger@plt>
movzbl -0x6(%rbp),%edi
call   1040 <custom_iowrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myprintinteger>:
push   %rbx
test   %edi,%edi
je     1152 <myprintinteger+0x32>
mov    %edi,%ebx
movslq %edi,%rax
imul   $0x66666667,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x22,%rdi
add    %eax,%edi
lea    (%rdi,%rdi,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
add    $0x30,%bl
xor    %esi,%esi
call   1030 <myprintinteger@plt>
jmp    1159 <myprintinteger+0x39>
mov    $0x30,%bl
test   %sil,%sil
je     1162 <myprintinteger+0x42>
movzbl %bl,%edi
pop    %rbx
jmp    1040 <custom_iowrite@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @myprintinteger(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8, i8* %4
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @custom_iowrite(i8 zeroext 48)
br label %13
13: ; preds = %11, %8
br label %23
14: ; preds = %2
%15 = load i32, i32* %3
%16 = srem i32 %15, 10
%17 = add nsw i32 %16, 48
%18 = trunc i32 %17 to i8
store i8 %18, i8* %5
%19 = load i32, i32* %3
%20 = sdiv i32 %19, 10
%21 = load i8, i8* %5
%22 = call i32 @custom_iowrite(i8 zeroext %21)
br label %23
23: ; preds = %14, %13
ret void
}

LLVM IR (-O2):
define void @myprintinteger(i32 %0, i8 zeroext %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = icmp eq i8 %1, 0
br i1 %5, label %9, label %6
6: ; preds = %4, %10
%7 = phi i8 [ %13, %10 ], [ 48, %4 ]
%8 = tail call i32 @custom_iowrite(i8 zeroext %7)
br label %9
9: ; preds = %6, %4
ret void
10: ; preds = %2
%11 = srem i32 %0, 10
%12 = trunc i32 %11 to i8
%13 = add nsw i8 %12, 48
%14 = sdiv i32 %0, 10
tail call void @myprintinteger(i32 %14, i8 zeroext 0)
br label %6
}
/* Variables and functions */
int lengthHelper(int);
int printingLengthOfInteger(int x) {
  return x < 0 ? lengthHelper(-x) + 1 : lengthHelper(x);
}


x86 assembly (clang, -O0):
<printingLengthOfInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113a <printingLengthOfInteger+0x2a>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1030 <lengthHelper@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <printingLengthOfInteger+0x35>
mov    -0x4(%rbp),%edi
call   1030 <lengthHelper@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printingLengthOfInteger>:
test   %edi,%edi
js     1119 <printingLengthOfInteger+0x9>
jmp    1030 <lengthHelper@plt>
push   %rax
neg    %edi
call   1030 <lengthHelper@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @printingLengthOfInteger(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 %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
%8 = call i32 @lengthHelper(i32 %7)
%9 = add nsw i32 %8, 1
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 @lengthHelper(i32 %11)
br label %13
13: ; preds = %10, %5
%14 = phi i32 [ %9, %5 ], [ %12, %10 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @printingLengthOfInteger(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sub nsw i32 0, %0
%5 = tail call i32 @lengthHelper(i32 %4)
%6 = add nsw i32 %5, 1
br label %9
7: ; preds = %1
%8 = tail call i32 @lengthHelper(i32 %0)
br label %9
9: ; preds = %7, %3
%10 = phi i32 [ %6, %3 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int ENODEV;
int sandbox_sdl_sound_stop(void) { return -ENODEV; }


x86 assembly (clang, -O0):
<sandbox_sdl_sound_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sandbox_sdl_sound_stop>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @sandbox_sdl_sound_stop() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @sandbox_sdl_sound_stop() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}