#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*/ extended_bottom_up_cut_rod(int *, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
void print_cut_rod_solution(int *p, int n, int *r, int *s) {
  int i;
  extended_bottom_up_cut_rod(p, n, r, s);
  for (i = 0; i < 13; i++) {
    printf("%d\t%d\n", r[i], s[i]);
  }
}


x86 assembly (clang, -O0):
<print_cut_rod_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <extended_bottom_up_cut_rod@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0xd,-0x24(%rbp)
jge    118c <print_cut_rod_solution+0x6c>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1152 <print_cut_rod_solution+0x32>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cut_rod_solution>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
call   1040 <extended_bottom_up_cut_rod@plt>
mov    (%rbx),%esi
mov    (%r14),%edx
lea    0xec4(%rip),%r15
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
mov    0x4(%r14),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%esi
mov    0x8(%r14),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0xc(%rbx),%esi
mov    0xc(%r14),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x10(%rbx),%esi
mov    0x10(%r14),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x14(%rbx),%esi
mov    0x14(%r14),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x18(%rbx),%esi
mov    0x18(%r14),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x1c(%rbx),%esi
mov    0x1c(%r14),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x20(%rbx),%esi
mov    0x20(%r14),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x24(%rbx),%esi
mov    0x24(%r14),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x28(%rbx),%esi
mov    0x28(%r14),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x2c(%rbx),%esi
mov    0x2c(%r14),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x30(%rbx),%esi
mov    0x30(%r14),%edx
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d\09%d\0A\00"
define void @print_cut_rod_solution(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = call i32 @extended_bottom_up_cut_rod(i32* %10, i32 %11, i32* %12, i32* %13)
store i32 0, i32* %9
br label %15
15: ; preds = %30, %4
%16 = load i32, i32* %9
%17 = icmp slt i32 %16, 13
br i1 %17, label %18, label %33
18: ; preds = %15
%19 = load i32*, i32** %7
%20 = load i32, i32* %9
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = load i32*, i32** %8
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = load i32, i32* %27
%29 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %28)
br label %30
30: ; preds = %18
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %15
33: ; preds = %15
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d\09%d\0A\00"
define void @print_cut_rod_solution(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 @extended_bottom_up_cut_rod(i32* %0, i32 %1, i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = getelementptr inbounds i32, i32* %2, i64 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %3, i64 1
%12 = load i32, i32* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12)
%14 = getelementptr inbounds i32, i32* %2, i64 2
%15 = load i32, i32* %14
%16 = getelementptr inbounds i32, i32* %3, i64 2
%17 = load i32, i32* %16
%18 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %17)
%19 = getelementptr inbounds i32, i32* %2, i64 3
%20 = load i32, i32* %19
%21 = getelementptr inbounds i32, i32* %3, i64 3
%22 = load i32, i32* %21
%23 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %22)
%24 = getelementptr inbounds i32, i32* %2, i64 4
%25 = load i32, i32* %24
%26 = getelementptr inbounds i32, i32* %3, i64 4
%27 = load i32, i32* %26
%28 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %27)
%29 = getelementptr inbounds i32, i32* %2, i64 5
%30 = load i32, i32* %29
%31 = getelementptr inbounds i32, i32* %3, i64 5
%32 = load i32, i32* %31
%33 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %30, i32 %32)
%34 = getelementptr inbounds i32, i32* %2, i64 6
%35 = load i32, i32* %34
%36 = getelementptr inbounds i32, i32* %3, i64 6
%37 = load i32, i32* %36
%38 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %35, i32 %37)
%39 = getelementptr inbounds i32, i32* %2, i64 7
%40 = load i32, i32* %39
%41 = getelementptr inbounds i32, i32* %3, i64 7
%42 = load i32, i32* %41
%43 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %40, i32 %42)
%44 = getelementptr inbounds i32, i32* %2, i64 8
%45 = load i32, i32* %44
%46 = getelementptr inbounds i32, i32* %3, i64 8
%47 = load i32, i32* %46
%48 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %45, i32 %47)
%49 = getelementptr inbounds i32, i32* %2, i64 9
%50 = load i32, i32* %49
%51 = getelementptr inbounds i32, i32* %3, i64 9
%52 = load i32, i32* %51
%53 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %50, i32 %52)
%54 = getelementptr inbounds i32, i32* %2, i64 10
%55 = load i32, i32* %54
%56 = getelementptr inbounds i32, i32* %3, i64 10
%57 = load i32, i32* %56
%58 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %55, i32 %57)
%59 = getelementptr inbounds i32, i32* %2, i64 11
%60 = load i32, i32* %59
%61 = getelementptr inbounds i32, i32* %3, i64 11
%62 = load i32, i32* %61
%63 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %60, i32 %62)
%64 = getelementptr inbounds i32, i32* %2, i64 12
%65 = load i32, i32* %64
%66 = getelementptr inbounds i32, i32* %3, i64 12
%67 = load i32, i32* %66
%68 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %65, i32 %67)
ret void
}