#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 const, int /*<<< orphan*/ *);
scalar_t__ isspace(char const);
void mtprint(const char *s, FILE *stream) {
  static int i = 0;
  while (isspace(s[i]) || s[i] == ',') {
    i++;
  }
  for (; s[i] != ',' && s[i] != '\0'; i++) {
    fputc(s[i], stream);
  }
  fputc('\n', stream);
}


x86 assembly (clang, -O0):
<mtprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq 0x2ef9(%rip),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    116e <mtprint+0x4e>
mov    -0x8(%rbp),%rax
movslq 0x2ed3(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2c,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    117e <mtprint+0x5e>
jmp    1192 <mtprint+0x72>
mov    0x2eb0(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ea7(%rip)
jmp    1130 <mtprint+0x10>
jmp    1197 <mtprint+0x77>
mov    -0x8(%rbp),%rax
movslq 0x2e92(%rip),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x2c,%ecx
mov    %al,-0x12(%rbp)
je     11cc <mtprint+0xac>
mov    -0x8(%rbp),%rax
movslq 0x2e75(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    11dc <mtprint+0xbc>
jmp    120a <mtprint+0xea>
mov    -0x8(%rbp),%rax
movslq 0x2e4d(%rip),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <fputc@plt>
mov    0x2e38(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e2f(%rip)
jmp    1197 <mtprint+0x77>
mov    -0x10(%rbp),%rsi
mov    $0xa,%edi
call   1040 <fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtprint>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2f04(%rip),%ecx
jmp    1149 <mtprint+0x29>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ecx
mov    %ecx,0x2eeb(%rip)
movslq %ecx,%rax
movsbl (%rbx,%rax,1),%edi
call   1030 <isspace@plt>
movslq 0x2ed8(%rip),%rcx
test   %rax,%rax
jne    1140 <mtprint+0x20>
movzbl (%rbx,%rcx,1),%eax
cmp    $0x2c,%al
je     1140 <mtprint+0x20>
jmp    1191 <mtprint+0x71>
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
movslq 0x2eb2(%rip),%rax
lea    0x1(%rax),%rcx
mov    %ecx,0x2ea8(%rip)
movzbl 0x1(%rbx,%rax,1),%eax
test   %al,%al
je     1199 <mtprint+0x79>
cmp    $0x2c,%al
jne    1170 <mtprint+0x50>
mov    $0xa,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fputc@plt>

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

LLVM IR (-O2):
@mtprint.i = internal unnamed_addr global i32 0
define void @mtprint(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* @mtprint.i
br label %4
4: ; preds = %17, %2
%5 = phi i32 [ %18, %17 ], [ %3, %2 ]
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i64 @isspace(i8 signext %8)
%10 = icmp eq i64 %9, 0
%11 = load i32, i32* @mtprint.i
br i1 %10, label %12, label %17
12: ; preds = %4
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 44
br i1 %16, label %17, label %19
17: ; preds = %4, %12
%18 = add nsw i32 %11, 1
store i32 %18, i32* @mtprint.i
br label %4
19: ; preds = %12, %21
%20 = phi i8 [ %27, %21 ], [ %15, %12 ]
switch i8 %20, label %21 [
i8 44, label %28
i8 0, label %28
]
21: ; preds = %19
%22 = tail call i32 @fputc(i8 signext %20, i32* %1)
%23 = load i32, i32* @mtprint.i
%24 = add nsw i32 %23, 1
store i32 %24, i32* @mtprint.i
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %0, i64 %25
%27 = load i8, i8* %26
br label %19
28: ; preds = %19, %19
%29 = tail call i32 @fputc(i8 signext 10, i32* %1)
ret void
}