#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 */

/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void parse(char *code) {
  char c, l;
  while (*code) {
    if ((c = *code++) == '\n') {
      putchar('\n');
      continue;
    }
    l = *code++;
    while (l-- > 0)
      putchar(c);
  }
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1196 <parse+0x86>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
jne    1158 <parse+0x48>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    111c <parse+0xc>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,%cl
add    $0xff,%cl
mov    %cl,-0xa(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
jle    1191 <parse+0x81>
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
jmp    116c <parse+0x5c>
jmp    111c <parse+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%bpl
test   %bpl,%bpl
je     1173 <parse+0x63>
mov    %rdi,%r14
jmp    1146 <parse+0x36>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%r14),%bpl
test   %bpl,%bpl
je     1173 <parse+0x63>
cmp    $0xa,%bpl
je     1130 <parse+0x20>
mov    0x1(%r14),%bl
add    $0x2,%r14
test   %bl,%bl
jle    113e <parse+0x2e>
add    $0x1,%bl
nopl   0x0(%rax,%rax,1)
movsbl %bpl,%edi
call   1030 <putchar@plt>
add    $0xff,%bl
cmp    $0x1,%bl
ja     1160 <parse+0x50>
jmp    113e <parse+0x2e>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @parse(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %24, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = icmp eq i8 %5, 10
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = tail call i32 @putchar(i8 signext 10)
br label %11
11: ; preds = %19, %15, %9
%12 = phi i8* [ %7, %9 ], [ %16, %15 ], [ %16, %19 ]
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %24, label %4
15: ; preds = %4
%16 = getelementptr inbounds i8, i8* %6, i64 2
%17 = load i8, i8* %7
%18 = icmp sgt i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %15, %19
%20 = phi i8 [ %21, %19 ], [ %17, %15 ]
%21 = add nsw i8 %20, -1
%22 = tail call i32 @putchar(i8 signext %5)
%23 = icmp ugt i8 %20, 1
br i1 %23, label %19, label %11
24: ; preds = %11, %1
ret void
}