xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned int);
int main() {
  for (unsigned int i = 0; i < 10; ++i)
    bar(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   $0xa,-0x8(%rbp)
jae    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <bar@plt>
mov    $0x1,%edi
call   1030 <bar@plt>
mov    $0x2,%edi
call   1030 <bar@plt>
mov    $0x3,%edi
call   1030 <bar@plt>
mov    $0x4,%edi
call   1030 <bar@plt>
mov    $0x5,%edi
call   1030 <bar@plt>
mov    $0x6,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x8,%edi
call   1030 <bar@plt>
mov    $0x9,%edi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 0)
%2 = tail call i32 @bar(i32 1)
%3 = tail call i32 @bar(i32 2)
%4 = tail call i32 @bar(i32 3)
%5 = tail call i32 @bar(i32 4)
%6 = tail call i32 @bar(i32 5)
%7 = tail call i32 @bar(i32 6)
%8 = tail call i32 @bar(i32 7)
%9 = tail call i32 @bar(i32 8)
%10 = tail call i32 @bar(i32 9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dub_die(char *, unsigned int);
void *malloc(unsigned int);
void *xmalloc0(unsigned int size) {
  void *p = malloc(size);
  if (!p)
    dub_die("Memory allocation failed (%u bytes)", size);
  return p;
}


x86 assembly (clang, -O0):
<xmalloc0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <xmalloc0+0x31>
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1040 <dub_die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc0>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <xmalloc0+0x20>
lea    0xec7(%rip),%rdi
mov    %ebp,%esi
call   1040 <dub_die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Memory allocation failed (%u bytes)\00"
define i8* @xmalloc0(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @dub_die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [36 x i8] c"Memory allocation failed (%u bytes)\00"
define noalias i8* @xmalloc0(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @dub_die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
unsigned int packline(int, int, int);
int /*<<< orphan*/ printf(char *, unsigned int);
void dumppacked_lt32(int xy, int w, int h) {
  int i;
  unsigned int ch;
  for (i = 0; i < w; i++) {
    ch = packline(xy + i, 256, h);
    printf("%u,", ch);
  }
}


x86 assembly (clang, -O0):
<dumppacked_lt32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1177 <dumppacked_lt32+0x57>
mov    -0x4(%rbp),%edi
add    -0x10(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x100,%esi
call   1030 <packline@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <dumppacked_lt32+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumppacked_lt32>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1161 <dumppacked_lt32+0x41>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xec7(%rip),%r15
nopl   0x0(%rax)
mov    %ebx,%edi
mov    $0x100,%esi
mov    %r14d,%edx
call   1030 <packline@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1140 <dumppacked_lt32+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u,\00"
define void @dumppacked_lt32(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ 0, %3 ]
%7 = add nsw i32 %6, %0
%8 = tail call i32 @packline(i32 %7, i32 256, i32 %2)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw nsw i32 %6, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int semop(int, struct sembuf *, int);
int v(int semidgroup, int donut_type) {
  struct sembuf semopbuf;
  semopbuf.sem_num = donut_type;
  semopbuf.sem_op = (+1);
  semopbuf.sem_flg = 0;
  if (semop(semidgroup, &semopbuf, 1) == -1) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x1,-0x1c(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
cmp    $0xffffffff,%eax
jne    1159 <v+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <v+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movl   $0x1,0xc(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define i32 @v(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sembuf
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 1
store i32 1, i32* %9
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 2
store i64 0, i64* %10
%11 = load i32, i32* %4
%12 = call i32 @semop(i32 %11, %struct.sembuf* %6, i32 1)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define i32 @v(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i64 0, i64* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
%9 = icmp eq i32 %8, -1
%10 = sext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ nand_cmd(int);
int /*<<< orphan*/ nand_deselect();
int /*<<< orphan*/ nand_ready();
int /*<<< orphan*/ nand_select();
void nand_reset() {
  nand_select();
  nand_cmd(0xff);
  nand_ready();
  nand_deselect();
}


x86 assembly (clang, -O0):
<nand_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <nand_select@plt>
mov    $0xff,%edi
call   1050 <nand_cmd@plt>
mov    $0x0,%al
call   1040 <nand_ready@plt>
mov    $0x0,%al
call   1030 <nand_deselect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_reset>:
push   %rax
xor    %eax,%eax
call   1060 <nand_select@plt>
mov    $0xff,%edi
call   1050 <nand_cmd@plt>
xor    %eax,%eax
call   1040 <nand_ready@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nand_deselect@plt>

LLVM IR (-O0):
define void @nand_reset() {
%1 = call i32 (...) @nand_select()
%2 = call i32 @nand_cmd(i32 255)
%3 = call i32 (...) @nand_ready()
%4 = call i32 (...) @nand_deselect()
ret void
}

LLVM IR (-O2):
define void @nand_reset() {
%1 = tail call i32 (...) @nand_select()
%2 = tail call i32 @nand_cmd(i32 255)
%3 = tail call i32 (...) @nand_ready()
%4 = tail call i32 (...) @nand_deselect()
ret void
}
void FMC_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @FMC_IRQHandler() {
ret void
}
void swap_str(char a, char b) {
  char temp;
  temp = b;
  b = a;
  a = temp;
}


x86 assembly (clang, -O0):
<swap_str>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @swap_str(i8 signext %0, i8 signext %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, square, cube;
  scanf("%d", &a);
  square = a * a;
  cube = a * a * a;
  printf("\n%d", square);
  printf("\n%d\n", cube);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe94(%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    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
@.str.2 = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int getlines(char **, int);
int /*<<< orphan*/ output_tail_lines(char **, int, int);
int parse_cmd(int, char **);
int main(int argc, char *argv[]) {
  int tail_num, lines_num;
  char *lines[1000];
  tail_num = parse_cmd(argc, argv);
  if (tail_num == -1) {
    tail_num = 10;
  }
  lines_num = getlines(lines, 1000);
  output_tail_lines(lines, lines_num, tail_num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parse_cmd@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1169 <main+0x39>
movl   $0xa,-0x14(%rbp)
lea    -0x1f60(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getlines@plt>
mov    %eax,-0x18(%rbp)
lea    -0x1f60(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1050 <output_tail_lines@plt>
xor    %eax,%eax
add    $0x1f60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1f48,%rsp
call   1030 <parse_cmd@plt>
cmp    $0xffffffff,%eax
mov    $0xa,%ebx
cmovne %eax,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x3e8,%esi
call   1040 <getlines@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %ebx,%edx
call   1050 <output_tail_lines@plt>
xor    %eax,%eax
add    $0x1f48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [1000 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @parse_cmd(i32 %9, i8** %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 10, i32* %6
br label %15
15: ; preds = %14, %2
%16 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %8, i64 0, i64 0
%17 = call i32 @getlines(i8** %16, i32 1000)
store i32 %17, i32* %7
%18 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %8, i64 0, i64 0
%19 = load i32, i32* %7
%20 = load i32, i32* %6
%21 = call i32 @output_tail_lines(i8** %18, i32 %19, i32 %20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [1000 x i8*]
%4 = bitcast [1000 x i8*]* %3 to i8*
%5 = tail call i32 @parse_cmd(i32 %0, i8** %1)
%6 = icmp eq i32 %5, -1
%7 = select i1 %6, i32 10, i32 %5
%8 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %3, i64 0, i64 0
%9 = call i32 @getlines(i8** %8, i32 1000)
%10 = call i32 @output_tail_lines(i8** %8, i32 %9, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_putstr(char *str) {
  int i;
  i = 0;
  while (str[i]) {
    ft_putchar(str[i++]);
  }
  return;
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <ft_putstr+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @ft_putchar(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NP();
int /*<<< orphan*/ V();
int /*<<< orphan*/ printf(char *);
int VP() {
  printf("<VP>");
  V();
  NP();
  printf("</VP>");
}


x86 assembly (clang, -O0):
<VP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <V@plt>
mov    $0x0,%al
call   1030 <NP@plt>
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VP>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <V@plt>
xor    %eax,%eax
call   1030 <NP@plt>
lea    0xeb3(%rip),%rdi
pop    %rax
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"<VP>\00"
@.str.1 = [6 x i8] c"</VP>\00"
define i32 @VP() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @V()
%4 = call i32 (...) @NP()
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"<VP>\00"
@.str.1 = [6 x i8] c"</VP>\00"
define i32 @VP() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @V()
%3 = tail call i32 (...) @NP()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
unsigned short safeScale(unsigned short baseValue, unsigned short scaler) {
  unsigned short scaled = ((unsigned long)baseValue * scaler) / 0x8000;
  if ((scaler > 0x8000) && (baseValue > scaled)) {
    return 0xFFFF;
  } else {
    return scaled;
  }
}


x86 assembly (clang, -O0):
<safeScale>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
movzwl -0x6(%rbp),%ecx
imul   %rcx,%rax
shr    $0xf,%rax
mov    %ax,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
cmp    $0x8000,%eax
jle    1150 <safeScale+0x50>
movzwl -0x4(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jle    1150 <safeScale+0x50>
movw   $0xffff,-0x2(%rbp)
jmp    1158 <safeScale+0x58>
mov    -0x8(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<safeScale>:
mov    %esi,%ecx
imul   %edi,%ecx
shr    $0xf,%ecx
movzwl %cx,%eax
cmp    %edi,%eax
mov    $0xffff,%eax
cmovae %ecx,%eax
cmp    $0x8001,%esi
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @safeScale(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
%7 = load i16, i16* %4
%8 = zext i16 %7 to i64
%9 = load i16, i16* %5
%10 = zext i16 %9 to i64
%11 = mul i64 %8, %10
%12 = udiv i64 %11, 32768
%13 = trunc i64 %12 to i16
store i16 %13, i16* %6
%14 = load i16, i16* %5
%15 = zext i16 %14 to i32
%16 = icmp sgt i32 %15, 32768
br i1 %16, label %17, label %24
17: ; preds = %2
%18 = load i16, i16* %4
%19 = zext i16 %18 to i32
%20 = load i16, i16* %6
%21 = zext i16 %20 to i32
%22 = icmp sgt i32 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %17
store i16 -1, i16* %3
br label %26
24: ; preds = %17, %2
%25 = load i16, i16* %6
store i16 %25, i16* %3
br label %26
26: ; preds = %24, %23
%27 = load i16, i16* %3
ret i16 %27
}

LLVM IR (-O2):
define zeroext i16 @safeScale(i16 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %0 to i32
%4 = zext i16 %1 to i32
%5 = mul nuw i32 %4, %3
%6 = lshr i32 %5, 15
%7 = trunc i32 %6 to i16
%8 = icmp ugt i16 %1, -32768
%9 = and i32 %6, 65535
%10 = icmp ult i32 %9, %3
%11 = select i1 %8, i1 %10, i1 false
%12 = select i1 %11, i16 -1, i16 %7
ret i16 %12
}
/* Variables and functions */
int getLettersLeft(const char *word, const bool *mask) {
  int ret = 0;
  for (; *word; word++) {
    if (!mask[*word - 'a']) {
      ret++;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<getLettersLeft>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <getLettersLeft+0x5a>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x61,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1144 <getLettersLeft+0x44>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <getLettersLeft+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <getLettersLeft+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLettersLeft>:
mov    (%rdi),%cl
test   %cl,%cl
je     112b <getLettersLeft+0x2b>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
cmpl   $0x1,-0x184(%rsi,%rcx,4)
01
adc    $0x0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <getLettersLeft+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getLettersLeft(i8* nocapture %0, i32* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %17, %5 ], [ %3, %2 ]
%7 = phi i32 [ %15, %5 ], [ 0, %2 ]
%8 = phi i8* [ %16, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i64
%10 = add nsw i64 %9, -97
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %7, %14
%16 = getelementptr inbounds i8, i8* %8, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %5
19: ; preds = %5, %2
%20 = phi i32 [ 0, %2 ], [ %15, %5 ]
ret i32 %20
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int dash_offset;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
void set_XGCValues_dash_offset(void *_p, int _v) {
  ((XGCValues *)_p)->dash_offset = (int)_v;
}


x86 assembly (clang, -O0):
<set_XGCValues_dash_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XGCValues_dash_offset>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGCValues_dash_offset(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XGCValues_dash_offset(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void Com_Printf(const char *format, ...) {}


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

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

LLVM IR (-O0):
define void @Com_Printf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @Com_Printf(i8* nocapture %0, ...) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int width;
};
struct TYPE_4__ {
  TYPE_1__ xcreatewindow;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcreatewindow_width(void *_p, int _v) {
  ((XEvent *)_p)->xcreatewindow.width = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xcreatewindow_width>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xcreatewindow_width>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xcreatewindow_width(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcreatewindow_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int printlock_w39_fwh(struct flashctx *);
int printlock_w39v040b(struct flashctx *);
int printlock_w39v040fb(struct flashctx *flash) {
  int ret = 0;
  ret = printlock_w39v040b(flash);
  ret |= printlock_w39_fwh(flash);
  return ret;
}


x86 assembly (clang, -O0):
<printlock_w39v040fb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printlock_w39v040b@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <printlock_w39_fwh@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printlock_w39v040fb>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <printlock_w39v040b@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <printlock_w39_fwh@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @printlock_w39v040fb(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
%3 = alloca i32
store %struct.flashctx* %0, %struct.flashctx** %2
store i32 0, i32* %3
%4 = load %struct.flashctx*, %struct.flashctx** %2
%5 = call i32 @printlock_w39v040b(%struct.flashctx* %4)
store i32 %5, i32* %3
%6 = load %struct.flashctx*, %struct.flashctx** %2
%7 = call i32 @printlock_w39_fwh(%struct.flashctx* %6)
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @printlock_w39v040fb(%struct.flashctx* %0) {
%2 = tail call i32 @printlock_w39v040b(%struct.flashctx* %0)
%3 = tail call i32 @printlock_w39_fwh(%struct.flashctx* %0)
%4 = or i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pause();
void YabThreadSleep(void) { pause(); }


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

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

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

LLVM IR (-O2):
define void @YabThreadSleep() {
%1 = tail call i32 (...) @pause()
ret void
}
int hash_string(register const unsigned char *s, int modulo) {
  register unsigned result = 0;
  register int i = 1;
  while (*s != 0)
    result += (*s++ << i++);
  return (result % modulo);
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <hash_string+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
shl    %cl,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <hash_string+0x19>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%dl
xor    %eax,%eax
test   %dl,%dl
je     1123 <hash_string+0x23>
mov    $0x1,%ecx
nopl   (%rax)
movzbl %dl,%edx
shl    %cl,%edx
add    %edx,%eax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <hash_string+0x10>
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %15, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 1, %2 ]
%8 = phi i32 [ %14, %5 ], [ 0, %2 ]
%9 = phi i8* [ %11, %5 ], [ %0, %2 ]
%10 = zext i8 %6 to i32
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = add nuw nsw i32 %7, 1
%13 = shl i32 %10, %7
%14 = add i32 %13, %8
%15 = load i8, i8* %11
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %2
%18 = phi i32 [ 0, %2 ], [ %14, %5 ]
%19 = urem i32 %18, %1
ret i32 %19
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRA8_get(void) { return U_WMRCORENONE_get("U_WMRA8"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA8\00"
define i32 @U_WMRA8_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRA8\00"
define i32 @U_WMRA8_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void delay_ms(int ms) {
  volatile int count = ms * 166667;
  while (count--)
    ;
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x28b0b,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     112a <delay_ms+0x2a>
jmp    1111 <delay_ms+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_ms>:
imul   $0x28b0b,%edi,%eax
mov    %eax,-0x4(%rsp)
nopw   0x0(%rax,%rax,1)
subl   $0x1,-0x4(%rsp)
jae    1110 <delay_ms+0x10>
ret

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

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = mul nsw i32 %0, 166667
store volatile i32 %4, i32* %2
br label %5
5: ; preds = %5, %1
%6 = load volatile i32, i32* %2
%7 = add nsw i32 %6, -1
store volatile i32 %7, i32* %2
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %5
9: ; preds = %5
ret void
}
char *remchar(char *str, const char ch) {
  char *src, *dest;
  for (src = dest = str; *src; src++) {
    if (*src != ch)
      *dest++ = *src;
  }
  *dest = 0;
  return str;
}


x86 assembly (clang, -O0):
<remchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1167 <remchar+0x67>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     1151 <remchar+0x51>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1156 <remchar+0x56>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <remchar+0x1a>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remchar>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <remchar+0x38>
lea    0x1(%rax),%rdx
mov    %rax,%rdi
jmp    112b <remchar+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     1138 <remchar+0x38>
cmp    %sil,%cl
je     1120 <remchar+0x20>
mov    %cl,(%rdi)
add    $0x1,%rdi
jmp    1120 <remchar+0x20>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @remchar(i8* returned %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %12
%6 = phi i8 [ %15, %12 ], [ %3, %2 ]
%7 = phi i8* [ %13, %12 ], [ %0, %2 ]
%8 = phi i8* [ %14, %12 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
br i1 %9, label %12, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
br label %12
12: ; preds = %5, %10
%13 = phi i8* [ %11, %10 ], [ %7, %5 ]
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ]
store i8 0, i8* %18
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ extract_values_delim(char *, char *);
char **extract_values(char *value) { extract_values_delim(value, "%"); }


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

x86 assembly (clang, -O2):
<extract_values>:
lea    0xee9(%rip),%rsi
jmp    1030 <extract_values_delim@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"%\00"
define noalias i8** @extract_values(i8* %0) {
%2 = tail call i32 @extract_values_delim(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8** undef
}
/* Variables and functions */
int /*<<< orphan*/ test_one_icon(char *, char *);
void test_icons(void) {
  test_one_icon("application/x-font-ttx", "font-x-generic");
  test_one_icon("application/mathematica", "x-office-document");
  test_one_icon("text/plain", NULL);
}


x86 assembly (clang, -O0):
<test_icons>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef5(%rip),%rsi
call   1030 <test_one_icon@plt>
lea    0xef8(%rip),%rdi
lea    0xf09(%rip),%rsi
call   1030 <test_one_icon@plt>
lea    0xf0f(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <test_one_icon@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_icons>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef8(%rip),%rsi
call   1030 <test_one_icon@plt>
lea    0xefb(%rip),%rdi
lea    0xf0c(%rip),%rsi
call   1030 <test_one_icon@plt>
lea    0xf12(%rip),%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <test_one_icon@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"application/x-font-ttx\00"
@.str.1 = [15 x i8] c"font-x-generic\00"
@.str.2 = [24 x i8] c"application/mathematica\00"
@.str.3 = [18 x i8] c"x-office-document\00"
@.str.4 = [11 x i8] c"text/plain\00"
define void @test_icons() {
%1 = call i32 @test_one_icon(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_one_icon(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @test_one_icon(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* null)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"application/x-font-ttx\00"
@.str.1 = [15 x i8] c"font-x-generic\00"
@.str.2 = [24 x i8] c"application/mathematica\00"
@.str.3 = [18 x i8] c"x-office-document\00"
@.str.4 = [11 x i8] c"text/plain\00"
define void @test_icons() {
%1 = tail call i32 @test_one_icon(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_one_icon(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @test_one_icon(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* null)
ret void
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct rq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ resched_task(struct task_struct *);
void prio_changed_dl(struct rq *rq, struct task_struct *p, int oldprio) {
  resched_task(p);
}


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

x86 assembly (clang, -O2):
<prio_changed_dl>:
mov    %rsi,%rdi
jmp    1030 <resched_task@plt>

LLVM IR (-O0):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @prio_changed_dl(%struct.rq* %0, %struct.task_struct* %1, i32 %2) {
%4 = alloca %struct.rq*
%5 = alloca %struct.task_struct*
%6 = alloca i32
store %struct.rq* %0, %struct.rq** %4
store %struct.task_struct* %1, %struct.task_struct** %5
store i32 %2, i32* %6
%7 = load %struct.task_struct*, %struct.task_struct** %5
%8 = call i32 @resched_task(%struct.task_struct* %7)
ret void
}

LLVM IR (-O2):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @prio_changed_dl(%struct.rq* nocapture readnone %0, %struct.task_struct* %1, i32 %2) {
%4 = tail call i32 @resched_task(%struct.task_struct* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func4();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello from subdir2/subdir3/subdir4/prog4.c\n");
  func4();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"Hello from subdir2/subdir3/subdir4/prog4.c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @func4()
ret i32 0
}

LLVM IR (-O2):
@str = [43 x i8] c"Hello from subdir2/subdir3/subdir4/prog4.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @func4()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nsc_assert(int);
void ttysleep(void) {
  nsc_assert(0 && "This function is unimplemented.");
  ;
}


x86 assembly (clang, -O0):
<ttysleep>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <nsc_assert@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ttysleep() {
%1 = call i32 @nsc_assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @ttysleep() {
%1 = tail call i32 @nsc_assert(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glRectd(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
void Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) {
  glRectd(x1, y1, x2, y2);
}


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

x86 assembly (clang, -O2):
<Rectd>:
jmp    1030 <glRectd@plt>

LLVM IR (-O0):
define void @Rectd(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @glRectd(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @Rectd(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @glRectd(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ is_end_of_line(char);
bool is_white_space(char c) {
  bool result = ((c == ' ') || (c == '\t') || (is_end_of_line(c)));
  return (result);
}


x86 assembly (clang, -O0):
<is_white_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1155 <is_white_space+0x45>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1155 <is_white_space+0x45>
movsbl -0x1(%rbp),%edi
call   1030 <is_end_of_line@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_white_space>:
mov    $0x1,%eax
cmp    $0x9,%dil
je     1121 <is_white_space+0x11>
cmp    $0x20,%dil
jne    1122 <is_white_space+0x12>
ret
push   %rax
movsbl %dil,%edi
call   1030 <is_end_of_line@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @is_white_space(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %6
i8 9, label %6
]
2: ; preds = %1
%3 = tail call i64 @is_end_of_line(i8 signext %0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %2
%7 = phi i32 [ 1, %1 ], [ %5, %2 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_sleep__();
void msleep(int n) { __coverity_sleep__(); }


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

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

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

LLVM IR (-O2):
define void @msleep(i32 %0) {
%2 = tail call i32 (...) @__coverity_sleep__()
ret void
}