#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void WriteBitmapText(char *str, FILE *out) {
  fputs("s   ", out);
  for (int j = 0; j < 10; j++) {
    if (str[j] == '*') {
      fputc('X', out);
      fputc(' ', out);
    } else if (str[j] == '.') {
      fputc('_', out);
      fputc(' ', out);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<WriteBitmapText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <fputs@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11d0 <WriteBitmapText+0xb0>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    1187 <WriteBitmapText+0x67>
mov    -0x10(%rbp),%rsi
mov    $0x58,%edi
call   1040 <fputc@plt>
mov    -0x10(%rbp),%rsi
mov    $0x20,%edi
call   1040 <fputc@plt>
jmp    11bd <WriteBitmapText+0x9d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    11b8 <WriteBitmapText+0x98>
mov    -0x10(%rbp),%rsi
mov    $0x5f,%edi
call   1040 <fputc@plt>
mov    -0x10(%rbp),%rsi
mov    $0x20,%edi
call   1040 <fputc@plt>
jmp    11bd <WriteBitmapText+0x9d>
jmp    11c2 <WriteBitmapText+0xa2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <WriteBitmapText+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteBitmapText>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xecf(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    (%r14),%al
cmp    $0x2a,%al
je     1152 <WriteBitmapText+0x32>
cmp    $0x2e,%al
jne    116c <WriteBitmapText+0x4c>
mov    $0x5f,%al
jmp    1154 <WriteBitmapText+0x34>
mov    $0x58,%al
movzbl %al,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    0x1(%r14),%al
cmp    $0x2a,%al
je     117c <WriteBitmapText+0x5c>
cmp    $0x2e,%al
jne    1196 <WriteBitmapText+0x76>
mov    $0x5f,%al
jmp    117e <WriteBitmapText+0x5e>
mov    $0x58,%al
movzbl %al,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    0x2(%r14),%al
cmp    $0x2a,%al
je     11a6 <WriteBitmapText+0x86>
cmp    $0x2e,%al
jne    11c0 <WriteBitmapText+0xa0>
mov    $0x5f,%al
jmp    11a8 <WriteBitmapText+0x88>
mov    $0x58,%al
movzbl %al,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    0x3(%r14),%al
cmp    $0x2a,%al
je     11d0 <WriteBitmapText+0xb0>
cmp    $0x2e,%al
jne    11ea <WriteBitmapText+0xca>
mov    $0x5f,%al
jmp    11d2 <WriteBitmapText+0xb2>
mov    $0x58,%al
movzbl %al,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    0x4(%r14),%al
cmp    $0x2a,%al
je     11fa <WriteBitmapText+0xda>
cmp    $0x2e,%al
jne    1214 <WriteBitmapText+0xf4>
mov    $0x5f,%al
jmp    11fc <WriteBitmapText+0xdc>
mov    $0x58,%al
movzbl %al,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    0x5(%r14),%al
cmp    $0x2a,%al
je     1224 <WriteBitmapText+0x104>
cmp    $0x2e,%al
jne    123e <WriteBitmapText+0x11e>
mov    $0x5f,%al
jmp    1226 <WriteBitmapText+0x106>
mov    $0x58,%al
movzbl %al,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    0x6(%r14),%al
cmp    $0x2a,%al
je     124e <WriteBitmapText+0x12e>
cmp    $0x2e,%al
jne    1268 <WriteBitmapText+0x148>
mov    $0x5f,%al
jmp    1250 <WriteBitmapText+0x130>
mov    $0x58,%al
movzbl %al,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    0x7(%r14),%al
cmp    $0x2a,%al
je     1278 <WriteBitmapText+0x158>
cmp    $0x2e,%al
jne    1292 <WriteBitmapText+0x172>
mov    $0x5f,%al
jmp    127a <WriteBitmapText+0x15a>
mov    $0x58,%al
movzbl %al,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    0x8(%r14),%al
cmp    $0x2a,%al
je     12a2 <WriteBitmapText+0x182>
cmp    $0x2e,%al
jne    12bc <WriteBitmapText+0x19c>
mov    $0x5f,%al
jmp    12a4 <WriteBitmapText+0x184>
mov    $0x58,%al
movzbl %al,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    0x9(%r14),%al
cmp    $0x2a,%al
je     12cc <WriteBitmapText+0x1ac>
cmp    $0x2e,%al
jne    12ed <WriteBitmapText+0x1cd>
mov    $0x5f,%al
jmp    12ce <WriteBitmapText+0x1ae>
mov    $0x58,%al
movzbl %al,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"s \00"
define void @WriteBitmapText(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 0, i32* %5
br label %8
8: ; preds = %39, %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %42
11: ; preds = %8
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 42
br i1 %18, label %19, label %24
19: ; preds = %11
%20 = load i32*, i32** %4
%21 = call i32 @fputc(i8 signext 88, i32* %20)
%22 = load i32*, i32** %4
%23 = call i32 @fputc(i8 signext 32, i32* %22)
br label %38
24: ; preds = %11
%25 = load i8*, i8** %3
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 46
br i1 %31, label %32, label %37
32: ; preds = %24
%33 = load i32*, i32** %4
%34 = call i32 @fputc(i8 signext 95, i32* %33)
%35 = load i32*, i32** %4
%36 = call i32 @fputc(i8 signext 32, i32* %35)
br label %37
37: ; preds = %32, %24
br label %38
38: ; preds = %37, %19
br label %39
39: ; preds = %38
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %8
42: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"s \00"
define void @WriteBitmapText(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %1)
%4 = load i8, i8* %0
switch i8 %4, label %10 [
i8 42, label %6
i8 46, label %5
]
5: ; preds = %2
br label %6
6: ; preds = %2, %5
%7 = phi i8 [ 95, %5 ], [ 88, %2 ]
%8 = tail call i32 @fputc(i8 signext %7, i32* %1)
%9 = tail call i32 @fputc(i8 signext 32, i32* %1)
br label %10
10: ; preds = %6, %2
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
switch i8 %12, label %18 [
i8 42, label %14
i8 46, label %13
]
13: ; preds = %10
br label %14
14: ; preds = %13, %10
%15 = phi i8 [ 95, %13 ], [ 88, %10 ]
%16 = tail call i32 @fputc(i8 signext %15, i32* %1)
%17 = tail call i32 @fputc(i8 signext 32, i32* %1)
br label %18
18: ; preds = %14, %10
%19 = getelementptr inbounds i8, i8* %0, i64 2
%20 = load i8, i8* %19
switch i8 %20, label %26 [
i8 42, label %22
i8 46, label %21
]
21: ; preds = %18
br label %22
22: ; preds = %21, %18
%23 = phi i8 [ 95, %21 ], [ 88, %18 ]
%24 = tail call i32 @fputc(i8 signext %23, i32* %1)
%25 = tail call i32 @fputc(i8 signext 32, i32* %1)
br label %26
26: ; preds = %22, %18
%27 = getelementptr inbounds i8, i8* %0, i64 3
%28 = load i8, i8* %27
switch i8 %28, label %34 [
i8 42, label %30
i8 46, label %29
]
29: ; preds = %26
br label %30
30: ; preds = %29, %26
%31 = phi i8 [ 95, %29 ], [ 88, %26 ]
%32 = tail call i32 @fputc(i8 signext %31, i32* %1)
%33 = tail call i32 @fputc(i8 signext 32, i32* %1)
br label %34
34: ; preds = %30, %26
%35 = getelementptr inbounds i8, i8* %0, i64 4
%36 = load i8, i8* %35
switch i8 %36, label %42 [
i8 42, label %38
i8 46, label %37
]
37: ; preds = %34
br label %38
38: ; preds = %37, %34
%39 = phi i8 [ 95, %37 ], [ 88, %34 ]
%40 = tail call i32 @fputc(i8 signext %39, i32* %1)
%41 = tail call i32 @fputc(i8 signext 32, i32* %1)
br label %42
42: ; preds = %38, %34
%43 = getelementptr inbounds i8, i8* %0, i64 5
%44 = load i8, i8* %43
switch i8 %44, label %50 [
i8 42, label %46
i8 46, label %45
]
45: ; preds = %42
br label %46
46: ; preds = %45, %42
%47 = phi i8 [ 95, %45 ], [ 88, %42 ]
%48 = tail call i32 @fputc(i8 signext %47, i32* %1)
%49 = tail call i32 @fputc(i8 signext 32, i32* %1)
br label %50
50: ; preds = %46, %42
%51 = getelementptr inbounds i8, i8* %0, i64 6
%52 = load i8, i8* %51
switch i8 %52, label %58 [
i8 42, label %54
i8 46, label %53
]
53: ; preds = %50
br label %54
54: ; preds = %53, %50
%55 = phi i8 [ 95, %53 ], [ 88, %50 ]
%56 = tail call i32 @fputc(i8 signext %55, i32* %1)
%57 = tail call i32 @fputc(i8 signext 32, i32* %1)
br label %58
58: ; preds = %54, %50
%59 = getelementptr inbounds i8, i8* %0, i64 7
%60 = load i8, i8* %59
switch i8 %60, label %66 [
i8 42, label %62
i8 46, label %61
]
61: ; preds = %58
br label %62
62: ; preds = %61, %58
%63 = phi i8 [ 95, %61 ], [ 88, %58 ]
%64 = tail call i32 @fputc(i8 signext %63, i32* %1)
%65 = tail call i32 @fputc(i8 signext 32, i32* %1)
br label %66
66: ; preds = %62, %58
%67 = getelementptr inbounds i8, i8* %0, i64 8
%68 = load i8, i8* %67
switch i8 %68, label %74 [
i8 42, label %70
i8 46, label %69
]
69: ; preds = %66
br label %70
70: ; preds = %69, %66
%71 = phi i8 [ 95, %69 ], [ 88, %66 ]
%72 = tail call i32 @fputc(i8 signext %71, i32* %1)
%73 = tail call i32 @fputc(i8 signext 32, i32* %1)
br label %74
74: ; preds = %70, %66
%75 = getelementptr inbounds i8, i8* %0, i64 9
%76 = load i8, i8* %75
switch i8 %76, label %82 [
i8 42, label %78
i8 46, label %77
]
77: ; preds = %74
br label %78
78: ; preds = %77, %74
%79 = phi i8 [ 95, %77 ], [ 88, %74 ]
%80 = tail call i32 @fputc(i8 signext %79, i32* %1)
%81 = tail call i32 @fputc(i8 signext 32, i32* %1)
br label %82
82: ; preds = %78, %74
ret void
}