#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 *, ...);
int /*<<< orphan*/ free(double *);
void putoutpU(double **pUx, int k, int ulength, FILE *fp) {
  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, "\n");
  free(pUx[k]);
}


x86 assembly (clang, -O0):
<putoutpU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116f <putoutpU+0x4f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1175 <putoutpU+0x55>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x24(%rbp),%ecx
cmp    %ecx,%eax
jg     11b8 <putoutpU+0x98>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe61(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1152 <putoutpU+0x32>
mov    -0x18(%rbp),%rdi
lea    0xe47(%rip),%rsi
mov    $0x0,%al
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>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xeb4(%rip),%rsi
mov    %rcx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
cmp    %ebp,%ebx
cmovge %ebp,%ebx
movslq %ebp,%r13
test   %ebx,%ebx
jle    119f <putoutpU+0x6f>
add    $0x1,%ebx
mov    $0x1,%ebp
lea    0xe91(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14,%r13,8),%rax
movsd  (%rax,%rbp,8),%xmm0
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1180 <putoutpU+0x50>
mov    $0xa,%edi
mov    %r15,%rsi
call   1040 <fputc@plt>
mov    (%r14,%r13,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 = [2 x i8] c"\0A\00"
define void @putoutpU(double** %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca double**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store double** %0, double*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%10 = load i32*, i32** %8
%11 = load i32, i32* %6
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 1, i32* %9
br label %13
13: ; preds = %37, %4
%14 = load i32, i32* %9
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = load i32, i32* %7
br label %22
20: ; preds = %13
%21 = load i32, i32* %6
br label %22
22: ; preds = %20, %18
%23 = phi i32 [ %19, %18 ], [ %21, %20 ]
%24 = icmp sle i32 %14, %23
br i1 %24, label %25, label %40
25: ; preds = %22
%26 = load i32*, i32** %8
%27 = load double**, double*** %5
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double*, double** %27, i64 %29
%31 = load double*, double** %30
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = load double, double* %34
%36 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %35)
br label %37
37: ; preds = %25
%38 = load i32, i32* %9
%39 = add nsw i32 %38, 1
store i32 %39, i32* %9
br label %13
40: ; preds = %22
%41 = load i32*, i32** %8
%42 = call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%43 = load double**, double*** %5
%44 = load i32, i32* %6
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double*, double** %43, i64 %45
%47 = load double*, double** %46
%48 = call i32 @free(double* %47)
ret void
}

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