#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 *strtok(char *, char *);
int main() {
  char my_string[] = "PAR     = dsdsd ";
  char seps[] = "=";
  char *parname, *parval;
  parname = strtok(my_string, seps);
  if (parname != NULL) {
    printf("Parameter name  = \"%s\"\n", parname);
    parval = strtok(NULL, seps);
    if (parval != NULL) {
      printf("Parameter value = \"%s\"\n", parval);
    } else {
      printf("Parameter value = (null)\n");
    }
  } else {
    printf("Parameter name  = (null)\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%al
mov    %al,-0x10(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x22(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x22(%rbp),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     11cd <main+0xad>
mov    -0x30(%rbp),%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x22(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <strtok@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     11ba <main+0x9a>
mov    -0x38(%rbp),%rsi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c8 <main+0xa8>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11db <main+0xbb>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movb   $0x0,0x20(%rsp)
movw   $0x3d,0xe(%rsp)
lea    0x10(%rsp),%rdi
lea    0xe(%rsp),%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     1195 <main+0x65>
lea    0xeaa(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe(%rsp),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
test   %rax,%rax
je     119e <main+0x6e>
lea    0xea0(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11aa <main+0x7a>
lea    0xea5(%rip),%rdi
jmp    11a5 <main+0x75>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.my_string = [17 x i8] c"PAR = dsdsd \00"
@__const.main.seps = [2 x i8] c"=\00"
@.str = [24 x i8] c"Parameter name = \22%s\22\0A\00"
@.str.1 = [24 x i8] c"Parameter value = \22%s\22\0A\00"
@.str.2 = [26 x i8] c"Parameter value = (null)\0A\00"
@.str.3 = [26 x i8] c"Parameter name = (null)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [17 x i8]
%3 = alloca [2 x i8]
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
%6 = bitcast [17 x i8]* %2 to i8*
%7 = bitcast [2 x i8]* %3 to i8*
%8 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%10 = call i8* @strtok(i8* %8, i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %26
13: ; preds = %0
%14 = load i8*, i8** %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%17 = call i8* @strtok(i8* null, i8* %16)
store i8* %17, i8** %5
%18 = load i8*, i8** %5
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %23
20: ; preds = %13
%21 = load i8*, i8** %5
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %21)
br label %25
23: ; preds = %13
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
br label %28
26: ; preds = %0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %26, %25
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@__const.main.my_string = [17 x i8] c"PAR = dsdsd \00"
@.str = [24 x i8] c"Parameter name = \22%s\22\0A\00"
@.str.1 = [24 x i8] c"Parameter value = \22%s\22\0A\00"
@str = [25 x i8] c"Parameter name = (null)\00"
@str.4 = [25 x i8] c"Parameter value = (null)\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = alloca i16
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%4 = bitcast i16* %2 to i8*
store i16 61, i16* %2
%5 = call i8* @strtok(i8* %3, i8* %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %15, label %7
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5)
%9 = call i8* @strtok(i8* null, i8* %4)
%10 = icmp eq i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %17
13: ; preds = %7
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.4, i64 0, i64 0))
br label %17
15: ; preds = %0
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %17
17: ; preds = %11, %13, %15
ret i32 0
}