#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 atoi(char *);
char *strchr(char const *, char);
int /*<<< orphan*/ strncpy(char *, char const *, int);
void parse(const char *buf, int *n1, int *n2) {
  char arg1[8192 + 1], arg2[8192 + 1];
  if (buf != NULL) {
    char *p = strchr(buf, '&');
    if (p) {
      *p = '\0';
      strncpy(arg1, buf, 8192);
      strncpy(arg2, p + 1, 8192);
      *n1 = atoi(arg1);
      *n2 = atoi(arg2);
      return;
    }
  }
  *n1 = *n2 = 0;
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4040,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     11e2 <parse+0xb2>
mov    -0x8(%rbp),%rdi
mov    $0x26,%esi
call   1040 <strchr@plt>
mov    %rax,-0x4038(%rbp)
cmpq   $0x0,-0x4038(%rbp)
je     11dd <parse+0xad>
mov    -0x4038(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x2020(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x2000,%edx
call   1030 <strncpy@plt>
lea    -0x4030(%rbp),%rdi
mov    -0x4038(%rbp),%rsi
add    $0x1,%rsi
mov    $0x2000,%edx
call   1030 <strncpy@plt>
lea    -0x2020(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
lea    -0x4030(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    11f6 <parse+0xc6>
jmp    11e2 <parse+0xb2>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
add    $0x4040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4020,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
test   %rdi,%rdi
je     11aa <parse+0x7a>
mov    %rdi,%rbx
mov    $0x26,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11aa <parse+0x7a>
mov    %rax,%r12
movb   $0x0,(%rax)
lea    0x2010(%rsp),%r13
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x2000,%edx
call   1030 <strncpy@plt>
add    $0x1,%r12
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x2000,%edx
call   1030 <strncpy@plt>
mov    %r13,%rdi
call   1050 <atoi@plt>
mov    %eax,(%r15)
mov    %rbx,%rdi
call   1050 <atoi@plt>
mov    %eax,(%r14)
jmp    11b8 <parse+0x88>
movl   $0x0,(%r14)
movl   $0x0,(%r15)
add    $0x4020,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @parse(i8* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = alloca [8193 x i8]
%5 = alloca [8193 x i8]
%6 = getelementptr inbounds [8193 x i8], [8193 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [8193 x i8], [8193 x i8]* %5, i64 0, i64 0
%8 = icmp eq i8* %0, null
br i1 %8, label %18, label %9
9: ; preds = %3
%10 = tail call i8* @strchr(i8* %0, i8 signext 38)
%11 = icmp eq i8* %10, null
br i1 %11, label %18, label %12
12: ; preds = %9
store i8 0, i8* %10
%13 = call i32 @strncpy(i8* %6, i8* %0, i32 8192)
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = call i32 @strncpy(i8* %7, i8* %14, i32 8192)
%16 = call i32 @atoi(i8* %6)
store i32 %16, i32* %1
%17 = call i32 @atoi(i8* %7)
store i32 %17, i32* %2
br label %19
18: ; preds = %9, %3
store i32 0, i32* %2
store i32 0, i32* %1
br label %19
19: ; preds = %12, %18
ret void
}