#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
void assign_pointer(double ***ptr, double *delays[3][2], char *str) {
  if (!strcmp(str, "x(t)"))
    *ptr = &delays[0][0];
  else if (!strcmp(str, "y(t)"))
    *ptr = &delays[1][0];
  else if (!strcmp(str, "z(t)"))
    *ptr = &delays[2][0];
  else if (!strcmp(str, "x(t-delta)"))
    *ptr = &delays[0][1];
  else if (!strcmp(str, "y(t-delta)"))
    *ptr = &delays[1][1];
  else if (!strcmp(str, "z(t-delta)"))
    *ptr = &delays[2][1];
  else {
    fprintf(stderr, "Bad option passed to -xp or -yp: \"%s\"\n", str);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<assign_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    116d <assign_pointer+0x3d>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1292 <assign_pointer+0x162>
mov    -0x18(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    119a <assign_pointer+0x6a>
mov    -0x10(%rbp),%rcx
add    $0x10,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    128d <assign_pointer+0x15d>
mov    -0x18(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11c7 <assign_pointer+0x97>
mov    -0x10(%rbp),%rcx
add    $0x20,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1288 <assign_pointer+0x158>
mov    -0x18(%rbp),%rdi
lea    0xe3d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11f4 <assign_pointer+0xc4>
mov    -0x10(%rbp),%rcx
add    $0x8,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1283 <assign_pointer+0x153>
mov    -0x18(%rbp),%rdi
lea    0xe1b(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1225 <assign_pointer+0xf5>
mov    -0x10(%rbp),%rcx
add    $0x10,%rcx
add    $0x8,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    127e <assign_pointer+0x14e>
mov    -0x18(%rbp),%rdi
lea    0xdf5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1256 <assign_pointer+0x126>
mov    -0x10(%rbp),%rcx
add    $0x20,%rcx
add    $0x8,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1279 <assign_pointer+0x149>
mov    0x2d83(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xdc6(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    127e <assign_pointer+0x14e>
jmp    1283 <assign_pointer+0x153>
jmp    1288 <assign_pointer+0x158>
jmp    128d <assign_pointer+0x15d>
jmp    1292 <assign_pointer+0x162>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_pointer>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0xebb(%rip),%rsi
mov    %rdx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11cc <assign_pointer+0x9c>
lea    0xead(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11b6 <assign_pointer+0x86>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11bc <assign_pointer+0x8c>
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11c2 <assign_pointer+0x92>
lea    0xe89(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11c8 <assign_pointer+0x98>
lea    0xe81(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
jne    11d5 <assign_pointer+0xa5>
add    $0x28,%r15
jmp    11cc <assign_pointer+0x9c>
add    $0x10,%r15
jmp    11cc <assign_pointer+0x9c>
add    $0x20,%r15
jmp    11cc <assign_pointer+0x9c>
add    $0x8,%r15
jmp    11cc <assign_pointer+0x9c>
add    $0x18,%r15
mov    %r15,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2e04(%rip),%rax
mov    (%rax),%edi
lea    0xe4b(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"x(t)\00"
@.str.1 = [5 x i8] c"y(t)\00"
@.str.2 = [5 x i8] c"z(t)\00"
@.str.3 = [11 x i8] c"x(t-delta)\00"
@.str.4 = [11 x i8] c"y(t-delta)\00"
@.str.5 = [11 x i8] c"z(t-delta)\00"
@stderr = global i32 0
@.str.6 = [39 x i8] c"Bad option passed to -xp or -yp: \22%s\22\0A\00"
define void @assign_pointer(double*** %0, [2 x double*]* %1, i8* %2) {
%4 = alloca double***
%5 = alloca [2 x double*]*
%6 = alloca i8*
store double*** %0, double**** %4
store [2 x double*]* %1, [2 x double*]** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %3
%11 = load [2 x double*]*, [2 x double*]** %5
%12 = getelementptr inbounds [2 x double*], [2 x double*]* %11, i64 0
%13 = getelementptr inbounds [2 x double*], [2 x double*]* %12, i64 0, i64 0
%14 = load double***, double**** %4
store double** %13, double*** %14
br label %70
15: ; preds = %3
%16 = load i8*, i8** %6
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %24, label %19
19: ; preds = %15
%20 = load [2 x double*]*, [2 x double*]** %5
%21 = getelementptr inbounds [2 x double*], [2 x double*]* %20, i64 1
%22 = getelementptr inbounds [2 x double*], [2 x double*]* %21, i64 0, i64 0
%23 = load double***, double**** %4
store double** %22, double*** %23
br label %69
24: ; preds = %15
%25 = load i8*, i8** %6
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %33, label %28
28: ; preds = %24
%29 = load [2 x double*]*, [2 x double*]** %5
%30 = getelementptr inbounds [2 x double*], [2 x double*]* %29, i64 2
%31 = getelementptr inbounds [2 x double*], [2 x double*]* %30, i64 0, i64 0
%32 = load double***, double**** %4
store double** %31, double*** %32
br label %68
33: ; preds = %24
%34 = load i8*, i8** %6
%35 = call i32 @strcmp(i8* %34, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp ne i32 %35, 0
br i1 %36, label %42, label %37
37: ; preds = %33
%38 = load [2 x double*]*, [2 x double*]** %5
%39 = getelementptr inbounds [2 x double*], [2 x double*]* %38, i64 0
%40 = getelementptr inbounds [2 x double*], [2 x double*]* %39, i64 0, i64 1
%41 = load double***, double**** %4
store double** %40, double*** %41
br label %67
42: ; preds = %33
%43 = load i8*, i8** %6
%44 = call i32 @strcmp(i8* %43, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%45 = icmp ne i32 %44, 0
br i1 %45, label %51, label %46
46: ; preds = %42
%47 = load [2 x double*]*, [2 x double*]** %5
%48 = getelementptr inbounds [2 x double*], [2 x double*]* %47, i64 1
%49 = getelementptr inbounds [2 x double*], [2 x double*]* %48, i64 0, i64 1
%50 = load double***, double**** %4
store double** %49, double*** %50
br label %66
51: ; preds = %42
%52 = load i8*, i8** %6
%53 = call i32 @strcmp(i8* %52, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%54 = icmp ne i32 %53, 0
br i1 %54, label %60, label %55
55: ; preds = %51
%56 = load [2 x double*]*, [2 x double*]** %5
%57 = getelementptr inbounds [2 x double*], [2 x double*]* %56, i64 2
%58 = getelementptr inbounds [2 x double*], [2 x double*]* %57, i64 0, i64 1
%59 = load double***, double**** %4
store double** %58, double*** %59
br label %65
60: ; preds = %51
%61 = load i32, i32* @stderr
%62 = load i8*, i8** %6
%63 = call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i8* %62)
%64 = call i32 @exit(i32 1)
unreachable
65: ; preds = %55
br label %66
66: ; preds = %65, %46
br label %67
67: ; preds = %66, %37
br label %68
68: ; preds = %67, %28
br label %69
69: ; preds = %68, %19
br label %70
70: ; preds = %69, %10
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"x(t)\00"
@.str.1 = [5 x i8] c"y(t)\00"
@.str.2 = [5 x i8] c"z(t)\00"
@.str.3 = [11 x i8] c"x(t-delta)\00"
@.str.4 = [11 x i8] c"y(t-delta)\00"
@.str.5 = [11 x i8] c"z(t-delta)\00"
@stderr = global i32 0
@.str.6 = [39 x i8] c"Bad option passed to -xp or -yp: \22%s\22\0A\00"
define void @assign_pointer(double*** nocapture writeonly %0, [2 x double*]* %1, i8* %2) {
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = getelementptr inbounds [2 x double*], [2 x double*]* %1, i64 0, i64 0
br label %37
8: ; preds = %3
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = getelementptr inbounds [2 x double*], [2 x double*]* %1, i64 1, i64 0
br label %37
13: ; preds = %8
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = getelementptr inbounds [2 x double*], [2 x double*]* %1, i64 2, i64 0
br label %37
18: ; preds = %13
%19 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = getelementptr inbounds [2 x double*], [2 x double*]* %1, i64 0, i64 1
br label %37
23: ; preds = %18
%24 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = getelementptr inbounds [2 x double*], [2 x double*]* %1, i64 1, i64 1
br label %37
28: ; preds = %23
%29 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = getelementptr inbounds [2 x double*], [2 x double*]* %1, i64 2, i64 1
br label %37
33: ; preds = %28
%34 = load i32, i32* @stderr
%35 = tail call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i8* %2)
%36 = tail call i32 @exit(i32 1)
unreachable
37: ; preds = %11, %21, %31, %26, %16, %6
%38 = phi double** [ %12, %11 ], [ %22, %21 ], [ %32, %31 ], [ %27, %26 ], [ %17, %16 ], [ %7, %6 ]
store double** %38, double*** %0
ret void
}