#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*/ printf(char *, char *);
char *strsep(char **, char *);
void show_browser_pid(char *buffer) {
  char *ret;
  int count = 0;
  while ((ret = strsep(&buffer, " ")) != NULL) {
    if (ret[0] == 0) {
      continue;
    }
    if (count == 3) {
      printf("%s\n", ret);
      break;
    }
    count++;
  }
}


x86 assembly (clang, -O0):
<show_browser_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <strsep@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1193 <show_browser_pid+0x73>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1166 <show_browser_pid+0x46>
jmp    1133 <show_browser_pid+0x13>
cmpl   $0x3,-0x14(%rbp)
jne    1185 <show_browser_pid+0x65>
mov    -0x10(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    1193 <show_browser_pid+0x73>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <show_browser_pid+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_browser_pid>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,(%rsp)
lea    0xed1(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strsep@plt>
test   %rax,%rax
je     11c4 <show_browser_pid+0xa4>
cmpb   $0x0,(%rax)
je     1140 <show_browser_pid+0x20>
lea    0xea4(%rip),%r14
mov    %rsp,%rbx
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strsep@plt>
test   %rax,%rax
je     11c4 <show_browser_pid+0xa4>
cmpb   $0x0,(%rax)
je     1160 <show_browser_pid+0x40>
lea    0xe84(%rip),%r14
mov    %rsp,%rbx
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strsep@plt>
test   %rax,%rax
je     11c4 <show_browser_pid+0xa4>
cmpb   $0x0,(%rax)
je     1180 <show_browser_pid+0x60>
lea    0xe64(%rip),%r14
mov    %rsp,%rbx
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strsep@plt>
test   %rax,%rax
je     11c4 <show_browser_pid+0xa4>
cmpb   $0x0,(%rax)
je     11a0 <show_browser_pid+0x80>
lea    0xe46(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @show_browser_pid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %6
%4 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %29, label %6
6: ; preds = %3
%7 = load i8, i8* %4
%8 = icmp eq i8 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %6, %12
%10 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i8* %10, null
br i1 %11, label %29, label %12
12: ; preds = %9
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %9, label %15
15: ; preds = %12, %18
%16 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i8* %16, null
br i1 %17, label %29, label %18
18: ; preds = %15
%19 = load i8, i8* %16
%20 = icmp eq i8 %19, 0
br i1 %20, label %15, label %21
21: ; preds = %18, %24
%22 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%23 = icmp eq i8* %22, null
br i1 %23, label %29, label %24
24: ; preds = %21
%25 = load i8, i8* %22
%26 = icmp eq i8 %25, 0
br i1 %26, label %21, label %27
27: ; preds = %24
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %22)
br label %29
29: ; preds = %3, %9, %15, %21, %27
ret void
}