#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char);
int /*<<< orphan*/ free(double *);
void putoutpU_splitup(double **pUx, int k, int ulength, FILE *fp, char ident) {
  int i;
  fprintf(fp, "%d\t", k);
  for (i = 1; i <= ((ulength) < (k) ? (ulength) : (k)); i++) {
    fprintf(fp, "%.5g\t", pUx[k][i]);
  }
  fprintf(fp, "\t%c\n", ident);
  free(pUx[k]);
}


x86 assembly (clang, -O0):
<putoutpU_splitup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%eax
lea    0xeb6(%rip),%rsi
movsbl %al,%edx
call   1040 <fprintf@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1176 <putoutpU_splitup+0x56>
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    117c <putoutpU_splitup+0x5c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x28(%rbp),%ecx
cmp    %ecx,%eax
jg     11c4 <putoutpU_splitup+0xa4>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvttsd2si %xmm0,%eax
lea    0xe56(%rip),%rsi
movsbl %al,%edx
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1159 <putoutpU_splitup+0x39>
mov    -0x18(%rbp),%rdi
lea    0xe3b(%rip),%rsi
movsbl -0x19(%rbp),%edx
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putoutpU_splitup>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,0x4(%rsp)
mov    %rcx,%r13
mov    %edx,%ebp
mov    %esi,%r12d
mov    %rdi,%r14
movsbl %r12b,%edx
lea    0xeba(%rip),%rsi
mov    %rcx,%rdi
call   1040 <fprintf@plt>
cmp    %r12d,%ebp
cmovge %r12d,%ebp
movslq %r12d,%rbx
test   %ebp,%ebp
jle    1191 <putoutpU_splitup+0x71>
add    $0x1,%ebp
mov    $0x1,%r15d
lea    0xe98(%rip),%r12
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rax
cvttsd2si (%rax,%r15,8),%eax
movsbl %al,%edx
mov    %r13,%rdi
mov    %r12,%rsi
call   1040 <fprintf@plt>
add    $0x1,%r15
cmp    %r15,%rbp
jne    1170 <putoutpU_splitup+0x50>
movsbl 0x4(%rsp),%edx
lea    0xe6d(%rip),%rsi
mov    %r13,%rdi
call   1040 <fprintf@plt>
mov    (%r14,%rbx,8),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [6 x i8] c"%.5g\09\00"
@.str.2 = [5 x i8] c"\09%c\0A\00"
define void @putoutpU_splitup(double** %0, i32 %1, i32 %2, i32* %3, i8 signext %4) {
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i8
%11 = alloca i32
store double** %0, double*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i8 %4, i8* %10
%12 = load i32*, i32** %9
%13 = load i32, i32* %7
%14 = trunc i32 %13 to i8
%15 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %14)
store i32 1, i32* %11
br label %16
16: ; preds = %41, %5
%17 = load i32, i32* %11
%18 = load i32, i32* %8
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = load i32, i32* %8
br label %25
23: ; preds = %16
%24 = load i32, i32* %7
br label %25
25: ; preds = %23, %21
%26 = phi i32 [ %22, %21 ], [ %24, %23 ]
%27 = icmp sle i32 %17, %26
br i1 %27, label %28, label %44
28: ; preds = %25
%29 = load i32*, i32** %9
%30 = load double**, double*** %6
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double*, double** %30, i64 %32
%34 = load double*, double** %33
%35 = load i32, i32* %11
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
%38 = load double, double* %37
%39 = fptosi double %38 to i8
%40 = call i32 @fprintf(i32* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8 signext %39)
br label %41
41: ; preds = %28
%42 = load i32, i32* %11
%43 = add nsw i32 %42, 1
store i32 %43, i32* %11
br label %16
44: ; preds = %25
%45 = load i32*, i32** %9
%46 = load i8, i8* %10
%47 = call i32 @fprintf(i32* %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 signext %46)
%48 = load double**, double*** %6
%49 = load i32, i32* %7
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double*, double** %48, i64 %50
%52 = load double*, double** %51
%53 = call i32 @free(double* %52)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [6 x i8] c"%.5g\09\00"
@.str.2 = [5 x i8] c"\09%c\0A\00"
define void @putoutpU_splitup(double** nocapture %0, i32 %1, i32 %2, i32* nocapture %3, i8 signext %4) {
%6 = trunc i32 %1 to i8
%7 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = icmp slt i32 %2, %1
%9 = select i1 %8, i32 %2, i32 %1
%10 = icmp slt i32 %9, 1
%11 = sext i32 %1 to i64
br i1 %10, label %25, label %12
12: ; preds = %5
%13 = getelementptr inbounds double*, double** %0, i64 %11
%14 = add nuw i32 %9, 1
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %12, %16
%17 = phi i64 [ 1, %12 ], [ %23, %16 ]
%18 = load double*, double** %13
%19 = getelementptr inbounds double, double* %18, i64 %17
%20 = load double, double* %19
%21 = fptosi double %20 to i8
%22 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8 signext %21)
%23 = add nuw nsw i64 %17, 1
%24 = icmp eq i64 %23, %15
br i1 %24, label %25, label %16
25: ; preds = %16, %5
%26 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 signext %4)
%27 = getelementptr inbounds double*, double** %0, i64 %11
%28 = load double*, double** %27
%29 = tail call i32 @free(double* %28)
ret void
}