#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 */
char *strchr(char *, char);
void break_args_explicit(char *s, char *arg1, char *arg2) {
  char *ns;
  ns = strchr(s, ',');
  if (ns) {
    *ns++ = '\0';
    while ((*arg2++ = *ns++) != '\0')
      ;
  } else {
    *arg2 = '\0';
  };
  while ((*arg1++ = *s++) != '\0')
    ;
}


x86 assembly (clang, -O0):
<break_args_explicit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     118b <break_args_explicit+0x7b>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1186 <break_args_explicit+0x76>
jmp    1153 <break_args_explicit+0x43>
jmp    1192 <break_args_explicit+0x82>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    1197 <break_args_explicit+0x87>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     11ca <break_args_explicit+0xba>
jmp    1197 <break_args_explicit+0x87>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<break_args_explicit>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x2c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1153 <break_args_explicit+0x43>
movb   $0x0,(%rax)
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%rax,%rcx,1),%edx
mov    %dl,(%r15,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1140 <break_args_explicit+0x30>
jmp    1157 <break_args_explicit+0x47>
movb   $0x0,(%r15)
xor    %eax,%eax
nopl   0x0(%rax)
movzbl (%rbx,%rax,1),%ecx
mov    %cl,(%r14,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1160 <break_args_explicit+0x50>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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