#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 */
struct Wheel {
  int dummy;
};
struct Map {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printOne(char, struct Map *);
int /*<<< orphan*/ printf(char *);
void exec(char start, struct Map *m) {
  struct Wheel *w;
  int i;
  if (m == NULL) {
    printf("Unable to proceed.");
    return;
  }
  for (i = 0; i < 20; i++) {
    printOne(start, m);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <exec+0x2e>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
jmp    1188 <exec+0x68>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jge    117c <exec+0x5c>
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <printOne@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <exec+0x35>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec>:
test   %rsi,%rsi
je     1218 <exec+0xe8>
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
movsbl %dil,%ebp
mov    %ebp,%edi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <printOne@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>
lea    0xde1(%rip),%rdi
jmp    1050 <printf@plt>

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

LLVM IR (-O2):
%struct.Map = type { i32 }
%struct.Wheel = type { i32 }
@.str = [19 x i8] c"Unable to proceed.\00"
define void @exec(i8 signext %0, %struct.Map* %1) {
%3 = icmp eq %struct.Map* %1, null
br i1 %3, label %26, label %4
4: ; preds = %2
%5 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%6 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%7 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%8 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%9 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%10 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%11 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%12 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%13 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%14 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%15 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%16 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%17 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%18 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%19 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%20 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%21 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%22 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%23 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%24 = tail call i32 @printOne(i8 signext %0, %struct.Map* %1)
%25 = tail call i32 @putchar(i32 10)
br label %28
26: ; preds = %2
%27 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %28
28: ; preds = %4, %26
ret void
}