#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 */
struct large {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FAIL(char *);
int large_coerce(struct large *);
int /*<<< orphan*/ large_free(struct large *);
struct large *large_from_int(int, int);
int large_len(struct large *);
struct large *large_pow(int, int);
void test_small() {
  struct large *n;
  n = large_from_int(10, 1);
  if (large_len(n) != 1)
    FAIL("1");
  large_free(n);
  n = large_from_int(10, 42);
  if (large_len(n) != 2)
    FAIL("42");
  large_free(n);
  n = large_from_int(10, 221);
  if (large_len(n) != 3)
    FAIL("221");
  large_free(n);
  n = large_from_int(10, 7770);
  if (large_len(n) != 4)
    FAIL("7770");
  large_free(n);
  n = large_pow(2, 3);
  if (large_coerce(n) != 8)
    FAIL("2^3");
  large_free(n);
  n = large_pow(1, 10);
  if (large_coerce(n) != 1)
    FAIL("1^10");
  large_free(n);
  n = large_pow(3, 3);
  if (large_coerce(n) != 27)
    FAIL("3^3");
  n = large_pow(12, 2);
  if (large_coerce(n) != 144)
    FAIL("12^2");
  large_free(n);
  n = large_pow(7, 5);
  if (large_coerce(n) != 16807)
    FAIL("7^5");
  large_free(n);
}


x86 assembly (clang, -O0):
<test_small>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
mov    $0x1,%esi
call   1060 <large_from_int@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <large_len@plt>
cmp    $0x1,%eax
je     1199 <test_small+0x39>
lea    0xe71(%rip),%rdi
call   1080 <FAIL@plt>
mov    -0x8(%rbp),%rdi
call   1050 <large_free@plt>
mov    $0xa,%edi
mov    $0x2a,%esi
call   1060 <large_from_int@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <large_len@plt>
cmp    $0x2,%eax
je     11d3 <test_small+0x73>
lea    0xe32(%rip),%rdi
call   1080 <FAIL@plt>
mov    -0x8(%rbp),%rdi
call   1050 <large_free@plt>
mov    $0xa,%edi
mov    $0xdd,%esi
call   1060 <large_from_int@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <large_len@plt>
cmp    $0x3,%eax
je     120d <test_small+0xad>
lea    0xdfb(%rip),%rdi
call   1080 <FAIL@plt>
mov    -0x8(%rbp),%rdi
call   1050 <large_free@plt>
mov    $0xa,%edi
mov    $0x1e5a,%esi
call   1060 <large_from_int@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <large_len@plt>
cmp    $0x4,%eax
je     1247 <test_small+0xe7>
lea    0xdc5(%rip),%rdi
call   1080 <FAIL@plt>
mov    -0x8(%rbp),%rdi
call   1050 <large_free@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <large_pow@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <large_coerce@plt>
cmp    $0x8,%eax
je     1281 <test_small+0x121>
lea    0xd90(%rip),%rdi
call   1080 <FAIL@plt>
mov    -0x8(%rbp),%rdi
call   1050 <large_free@plt>
mov    $0x1,%edi
mov    $0xa,%esi
call   1040 <large_pow@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <large_coerce@plt>
cmp    $0x1,%eax
je     12bb <test_small+0x15b>
lea    0xd5a(%rip),%rdi
call   1080 <FAIL@plt>
mov    -0x8(%rbp),%rdi
call   1050 <large_free@plt>
mov    $0x3,%esi
mov    %esi,%edi
call   1040 <large_pow@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <large_coerce@plt>
cmp    $0x1b,%eax
je     12f2 <test_small+0x192>
lea    0xd28(%rip),%rdi
call   1080 <FAIL@plt>
mov    $0xc,%edi
mov    $0x2,%esi
call   1040 <large_pow@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <large_coerce@plt>
cmp    $0x90,%eax
je     1325 <test_small+0x1c5>
lea    0xcf9(%rip),%rdi
call   1080 <FAIL@plt>
mov    -0x8(%rbp),%rdi
call   1050 <large_free@plt>
mov    $0x7,%edi
mov    $0x5,%esi
call   1040 <large_pow@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <large_coerce@plt>
cmp    $0x41a7,%eax
je     1361 <test_small+0x201>
lea    0xcc2(%rip),%rdi
call   1080 <FAIL@plt>
mov    -0x8(%rbp),%rdi
call   1050 <large_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_small>:
push   %rbx
mov    $0xa,%edi
mov    $0x1,%esi
call   1060 <large_from_int@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <large_len@plt>
cmp    $0x1,%eax
je     118c <test_small+0x2c>
lea    0xe7e(%rip),%rdi
call   1080 <FAIL@plt>
mov    %rbx,%rdi
call   1050 <large_free@plt>
mov    $0xa,%edi
mov    $0x2a,%esi
call   1060 <large_from_int@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <large_len@plt>
cmp    $0x2,%eax
je     11bf <test_small+0x5f>
lea    0xe46(%rip),%rdi
call   1080 <FAIL@plt>
mov    %rbx,%rdi
call   1050 <large_free@plt>
mov    $0xa,%edi
mov    $0xdd,%esi
call   1060 <large_from_int@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <large_len@plt>
cmp    $0x3,%eax
je     11f2 <test_small+0x92>
lea    0xe16(%rip),%rdi
call   1080 <FAIL@plt>
mov    %rbx,%rdi
call   1050 <large_free@plt>
mov    $0xa,%edi
mov    $0x1e5a,%esi
call   1060 <large_from_int@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <large_len@plt>
cmp    $0x4,%eax
je     1225 <test_small+0xc5>
lea    0xde7(%rip),%rdi
call   1080 <FAIL@plt>
mov    %rbx,%rdi
call   1050 <large_free@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <large_pow@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <large_coerce@plt>
cmp    $0x8,%eax
je     1258 <test_small+0xf8>
lea    0xdb9(%rip),%rdi
call   1080 <FAIL@plt>
mov    %rbx,%rdi
call   1050 <large_free@plt>
mov    $0x1,%edi
mov    $0xa,%esi
call   1040 <large_pow@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <large_coerce@plt>
cmp    $0x1,%eax
je     128b <test_small+0x12b>
lea    0xd8a(%rip),%rdi
call   1080 <FAIL@plt>
mov    %rbx,%rdi
call   1050 <large_free@plt>
mov    $0x3,%edi
mov    $0x3,%esi
call   1040 <large_pow@plt>
mov    %rax,%rdi
call   1030 <large_coerce@plt>
cmp    $0x1b,%eax
je     12bb <test_small+0x15b>
lea    0xd5f(%rip),%rdi
call   1080 <FAIL@plt>
mov    $0xc,%edi
mov    $0x2,%esi
call   1040 <large_pow@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <large_coerce@plt>
cmp    $0x90,%eax
je     12e8 <test_small+0x188>
lea    0xd36(%rip),%rdi
call   1080 <FAIL@plt>
mov    %rbx,%rdi
call   1050 <large_free@plt>
mov    $0x7,%edi
mov    $0x5,%esi
call   1040 <large_pow@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <large_coerce@plt>
cmp    $0x41a7,%eax
je     131d <test_small+0x1bd>
lea    0xd06(%rip),%rdi
call   1080 <FAIL@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <large_free@plt>

LLVM IR (-O0):
%struct.large = type { i32 }
@.str = [2 x i8] c"1\00"
@.str.1 = [3 x i8] c"42\00"
@.str.2 = [4 x i8] c"221\00"
@.str.3 = [5 x i8] c"7770\00"
@.str.4 = [4 x i8] c"2^3\00"
@.str.5 = [5 x i8] c"1^10\00"
@.str.6 = [4 x i8] c"3^3\00"
@.str.7 = [5 x i8] c"12^2\00"
@.str.8 = [4 x i8] c"7^5\00"
define void @test_small() {
%1 = alloca %struct.large*
%2 = call %struct.large* @large_from_int(i32 10, i32 1)
store %struct.large* %2, %struct.large** %1
%3 = load %struct.large*, %struct.large** %1
%4 = call i32 @large_len(%struct.large* %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @FAIL(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = load %struct.large*, %struct.large** %1
%10 = call i32 @large_free(%struct.large* %9)
%11 = call %struct.large* @large_from_int(i32 10, i32 42)
store %struct.large* %11, %struct.large** %1
%12 = load %struct.large*, %struct.large** %1
%13 = call i32 @large_len(%struct.large* %12)
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %8
%16 = call i32 @FAIL(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %8
%18 = load %struct.large*, %struct.large** %1
%19 = call i32 @large_free(%struct.large* %18)
%20 = call %struct.large* @large_from_int(i32 10, i32 221)
store %struct.large* %20, %struct.large** %1
%21 = load %struct.large*, %struct.large** %1
%22 = call i32 @large_len(%struct.large* %21)
%23 = icmp ne i32 %22, 3
br i1 %23, label %24, label %26
24: ; preds = %17
%25 = call i32 @FAIL(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24, %17
%27 = load %struct.large*, %struct.large** %1
%28 = call i32 @large_free(%struct.large* %27)
%29 = call %struct.large* @large_from_int(i32 10, i32 7770)
store %struct.large* %29, %struct.large** %1
%30 = load %struct.large*, %struct.large** %1
%31 = call i32 @large_len(%struct.large* %30)
%32 = icmp ne i32 %31, 4
br i1 %32, label %33, label %35
33: ; preds = %26
%34 = call i32 @FAIL(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %35
35: ; preds = %33, %26
%36 = load %struct.large*, %struct.large** %1
%37 = call i32 @large_free(%struct.large* %36)
%38 = call %struct.large* @large_pow(i32 2, i32 3)
store %struct.large* %38, %struct.large** %1
%39 = load %struct.large*, %struct.large** %1
%40 = call i32 @large_coerce(%struct.large* %39)
%41 = icmp ne i32 %40, 8
br i1 %41, label %42, label %44
42: ; preds = %35
%43 = call i32 @FAIL(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %44
44: ; preds = %42, %35
%45 = load %struct.large*, %struct.large** %1
%46 = call i32 @large_free(%struct.large* %45)
%47 = call %struct.large* @large_pow(i32 1, i32 10)
store %struct.large* %47, %struct.large** %1
%48 = load %struct.large*, %struct.large** %1
%49 = call i32 @large_coerce(%struct.large* %48)
%50 = icmp ne i32 %49, 1
br i1 %50, label %51, label %53
51: ; preds = %44
%52 = call i32 @FAIL(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %53
53: ; preds = %51, %44
%54 = load %struct.large*, %struct.large** %1
%55 = call i32 @large_free(%struct.large* %54)
%56 = call %struct.large* @large_pow(i32 3, i32 3)
store %struct.large* %56, %struct.large** %1
%57 = load %struct.large*, %struct.large** %1
%58 = call i32 @large_coerce(%struct.large* %57)
%59 = icmp ne i32 %58, 27
br i1 %59, label %60, label %62
60: ; preds = %53
%61 = call i32 @FAIL(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %62
62: ; preds = %60, %53
%63 = call %struct.large* @large_pow(i32 12, i32 2)
store %struct.large* %63, %struct.large** %1
%64 = load %struct.large*, %struct.large** %1
%65 = call i32 @large_coerce(%struct.large* %64)
%66 = icmp ne i32 %65, 144
br i1 %66, label %67, label %69
67: ; preds = %62
%68 = call i32 @FAIL(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %69
69: ; preds = %67, %62
%70 = load %struct.large*, %struct.large** %1
%71 = call i32 @large_free(%struct.large* %70)
%72 = call %struct.large* @large_pow(i32 7, i32 5)
store %struct.large* %72, %struct.large** %1
%73 = load %struct.large*, %struct.large** %1
%74 = call i32 @large_coerce(%struct.large* %73)
%75 = icmp ne i32 %74, 16807
br i1 %75, label %76, label %78
76: ; preds = %69
%77 = call i32 @FAIL(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %78
78: ; preds = %76, %69
%79 = load %struct.large*, %struct.large** %1
%80 = call i32 @large_free(%struct.large* %79)
ret void
}

LLVM IR (-O2):
%struct.large = type { i32 }
@.str = [2 x i8] c"1\00"
@.str.1 = [3 x i8] c"42\00"
@.str.2 = [4 x i8] c"221\00"
@.str.3 = [5 x i8] c"7770\00"
@.str.4 = [4 x i8] c"2^3\00"
@.str.5 = [5 x i8] c"1^10\00"
@.str.6 = [4 x i8] c"3^3\00"
@.str.7 = [5 x i8] c"12^2\00"
@.str.8 = [4 x i8] c"7^5\00"
define void @test_small() {
%1 = tail call %struct.large* @large_from_int(i32 10, i32 1)
%2 = tail call i32 @large_len(%struct.large* %1)
%3 = icmp eq i32 %2, 1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @FAIL(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = tail call i32 @large_free(%struct.large* %1)
%8 = tail call %struct.large* @large_from_int(i32 10, i32 42)
%9 = tail call i32 @large_len(%struct.large* %8)
%10 = icmp eq i32 %9, 2
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = tail call i32 @FAIL(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %6
%14 = tail call i32 @large_free(%struct.large* %8)
%15 = tail call %struct.large* @large_from_int(i32 10, i32 221)
%16 = tail call i32 @large_len(%struct.large* %15)
%17 = icmp eq i32 %16, 3
br i1 %17, label %20, label %18
18: ; preds = %13
%19 = tail call i32 @FAIL(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %13
%21 = tail call i32 @large_free(%struct.large* %15)
%22 = tail call %struct.large* @large_from_int(i32 10, i32 7770)
%23 = tail call i32 @large_len(%struct.large* %22)
%24 = icmp eq i32 %23, 4
br i1 %24, label %27, label %25
25: ; preds = %20
%26 = tail call i32 @FAIL(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %27
27: ; preds = %25, %20
%28 = tail call i32 @large_free(%struct.large* %22)
%29 = tail call %struct.large* @large_pow(i32 2, i32 3)
%30 = tail call i32 @large_coerce(%struct.large* %29)
%31 = icmp eq i32 %30, 8
br i1 %31, label %34, label %32
32: ; preds = %27
%33 = tail call i32 @FAIL(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %34
34: ; preds = %32, %27
%35 = tail call i32 @large_free(%struct.large* %29)
%36 = tail call %struct.large* @large_pow(i32 1, i32 10)
%37 = tail call i32 @large_coerce(%struct.large* %36)
%38 = icmp eq i32 %37, 1
br i1 %38, label %41, label %39
39: ; preds = %34
%40 = tail call i32 @FAIL(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %41
41: ; preds = %39, %34
%42 = tail call i32 @large_free(%struct.large* %36)
%43 = tail call %struct.large* @large_pow(i32 3, i32 3)
%44 = tail call i32 @large_coerce(%struct.large* %43)
%45 = icmp eq i32 %44, 27
br i1 %45, label %48, label %46
46: ; preds = %41
%47 = tail call i32 @FAIL(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %48
48: ; preds = %46, %41
%49 = tail call %struct.large* @large_pow(i32 12, i32 2)
%50 = tail call i32 @large_coerce(%struct.large* %49)
%51 = icmp eq i32 %50, 144
br i1 %51, label %54, label %52
52: ; preds = %48
%53 = tail call i32 @FAIL(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %54
54: ; preds = %52, %48
%55 = tail call i32 @large_free(%struct.large* %49)
%56 = tail call %struct.large* @large_pow(i32 7, i32 5)
%57 = tail call i32 @large_coerce(%struct.large* %56)
%58 = icmp eq i32 %57, 16807
br i1 %58, label %61, label %59
59: ; preds = %54
%60 = tail call i32 @FAIL(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %61
61: ; preds = %59, %54
%62 = tail call i32 @large_free(%struct.large* %56)
ret void
}