#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*/ TetQuadLag(double *, double *, double **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int TetShapeAndDrvL(int p, double par[3], double N[], double dN[][3]) {
  static int Nshp[3] = {4, 10, 20};
  if (p == 2) {
    TetQuadLag(par, N, dN);
  } else {
    fprintf(stderr, "p != 2 Not implemented for lagrange\n");
  }
  return Nshp[p];
}


x86 assembly (clang, -O0):
<TetShapeAndDrvL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1157 <TetShapeAndDrvL+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <TetQuadLag@plt>
jmp    116c <TetShapeAndDrvL+0x4c>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
movslq -0x4(%rbp),%rcx
lea    0x2eb9(%rip),%rax
mov    (%rax,%rcx,4),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TetShapeAndDrvL>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jne    1138 <TetShapeAndDrvL+0x18>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1040 <TetQuadLag@plt>
jmp    114d <TetShapeAndDrvL+0x2d>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
movslq %ebx,%rax
lea    0xea9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
@TetShapeAndDrvL.Nshp = internal global [3 x i32] [i32 4, i32 10, i32 20]
@stderr = global i32 0
@.str = [37 x i8] c"p != 2 Not implemented for lagrange\0A\00"
define i32 @TetShapeAndDrvL(i32 %0, double* %1, double* %2, [3 x double]* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca [3 x double]*
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store [3 x double]* %3, [3 x double]** %8
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = load double*, double** %6
%13 = load double*, double** %7
%14 = load [3 x double]*, [3 x double]** %8
%15 = bitcast [3 x double]* %14 to double**
%16 = call i32 @TetQuadLag(double* %12, double* %13, double** %15)
br label %20
17: ; preds = %4
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %17, %11
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [3 x i32], [3 x i32]* @TetShapeAndDrvL.Nshp, i64 0, i64 %22
%24 = load i32, i32* %23
ret i32 %24
}

LLVM IR (-O2):
@TetShapeAndDrvL.Nshp = internal unnamed_addr constant [3 x i32] [i32 4, i32 10, i32 20]
@stderr = global i32 0
@.str = [37 x i8] c"p != 2 Not implemented for lagrange\0A\00"
define i32 @TetShapeAndDrvL(i32 %0, double* %1, double* %2, [3 x double]* %3) {
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = bitcast [3 x double]* %3 to double**
%8 = tail call i32 @TetQuadLag(double* %1, double* %2, double** %7)
br label %12
9: ; preds = %4
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %6
%13 = sext i32 %0 to i64
%14 = getelementptr inbounds [3 x i32], [3 x i32]* @TetShapeAndDrvL.Nshp, i64 0, i64 %13
%15 = load i32, i32* %14
ret i32 %15
}