#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*/ printexp(int);
int /*<<< orphan*/ printnumword(char *, char);
char printwords(char *number) {
  int maxlength, numlength;
  int i;
  char first = 1;
  for (i = 0; number[i] != ';' && number[i] != '\0'; ++i)
    ;
  maxlength = numlength = i;
  for (i = 0; i <= maxlength; i++) {
    printnumword(number + i, first);
    first = 0;
    printexp(numlength);
    --numlength;
  }
}


x86 assembly (clang, -O0):
<printwords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movb   $0x1,-0x1d(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x3b,%ecx
mov    %al,-0x1e(%rbp)
je     1166 <printwords+0x46>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
test   $0x1,%al
jne    1176 <printwords+0x56>
jmp    1189 <printwords+0x69>
jmp    117b <printwords+0x5b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1137 <printwords+0x17>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11dc <printwords+0xbc>
mov    -0x10(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
movsbl -0x1d(%rbp),%esi
call   1040 <printnumword@plt>
movb   $0x0,-0x1d(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <printexp@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1199 <printwords+0x79>
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printwords>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%ebp
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx,%r14,1),%eax
test   %al,%al
je     1156 <printwords+0x36>
cmp    $0x3b,%al
je     1156 <printwords+0x36>
add    $0x1,%r14
add    $0x1,%ebp
jmp    1140 <printwords+0x20>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <printnumword@plt>
mov    %r14d,%edi
call   1030 <printexp@plt>
test   %r14d,%r14d
je     11b3 <printwords+0x93>
add    $0x1,%rbx
mov    %ebp,%r15d
neg    %r15
mov    $0xffffffffffffffff,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%r14,%rbp,1),%r12d
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <printnumword@plt>
mov    %r12d,%edi
call   1030 <printexp@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%rbp
cmp    %rbp,%r15
jne    1190 <printwords+0x70>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @printwords(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %3
store i8 1, i8* %7
store i32 0, i32* %6
br label %8
8: ; preds = %27, %1
%9 = load i8*, i8** %3
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 59
br i1 %15, label %16, label %24
16: ; preds = %8
%17 = load i8*, i8** %3
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 0
br label %24
24: ; preds = %16, %8
%25 = phi i1 [ false, %8 ], [ %23, %16 ]
br i1 %25, label %26, label %30
26: ; preds = %24
br label %27
27: ; preds = %26
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %8
30: ; preds = %24
%31 = load i32, i32* %6
store i32 %31, i32* %5
store i32 %31, i32* %4
store i32 0, i32* %6
br label %32
32: ; preds = %47, %30
%33 = load i32, i32* %6
%34 = load i32, i32* %4
%35 = icmp sle i32 %33, %34
br i1 %35, label %36, label %50
36: ; preds = %32
%37 = load i8*, i8** %3
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %37, i64 %39
%41 = load i8, i8* %7
%42 = call i32 @printnumword(i8* %40, i8 signext %41)
store i8 0, i8* %7
%43 = load i32, i32* %5
%44 = call i32 @printexp(i32 %43)
%45 = load i32, i32* %5
%46 = add nsw i32 %45, -1
store i32 %46, i32* %5
br label %47
47: ; preds = %36
%48 = load i32, i32* %6
%49 = add nsw i32 %48, 1
store i32 %49, i32* %6
br label %32
50: ; preds = %32
%51 = load i8, i8* %2
ret i8 %51
}

LLVM IR (-O2):
define signext i8 @printwords(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 59, label %8
i8 0, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2, %2
%9 = trunc i64 %3 to i32
%10 = add i64 %3, 1
%11 = and i64 %10, 4294967295
%12 = tail call i32 @printnumword(i8* %0, i8 signext 1)
%13 = tail call i32 @printexp(i32 %9)
%14 = icmp eq i64 %11, 1
br i1 %14, label %24, label %15
15: ; preds = %8, %15
%16 = phi i64 [ %22, %15 ], [ 1, %8 ]
%17 = phi i32 [ %18, %15 ], [ %9, %8 ]
%18 = add nsw i32 %17, -1
%19 = getelementptr inbounds i8, i8* %0, i64 %16
%20 = tail call i32 @printnumword(i8* %19, i8 signext 0)
%21 = tail call i32 @printexp(i32 %18)
%22 = add nuw nsw i64 %16, 1
%23 = icmp eq i64 %22, %11
br i1 %23, label %24, label %15
24: ; preds = %15, %8
ret i8 undef
}