#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 */
char *PercentE(int, int, int);
int /*<<< orphan*/ arith_self_test();
int /*<<< orphan*/ printf(char *, ...);
void self_test(void) {
  printf("*** self test begin ***\n");
  arith_self_test();
  printf("1054 displays with increasing precision as: %s %s %s %s\n",
         PercentE(1054, 1, 0), PercentE(1054, 1, 1), PercentE(1054, 1, 2),
         PercentE(1054, 1, 3));
  printf("*** self test complete ***\n");
}


x86 assembly (clang, -O0):
<self_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <arith_self_test@plt>
mov    $0x41e,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <PercentE@plt>
mov    %rax,-0x18(%rbp)
mov    $0x41e,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1050 <PercentE@plt>
mov    %rax,-0x10(%rbp)
mov    $0x41e,%edi
mov    $0x1,%esi
mov    $0x2,%edx
call   1050 <PercentE@plt>
mov    %rax,-0x8(%rbp)
mov    $0x41e,%edi
mov    $0x1,%esi
mov    $0x3,%edx
call   1050 <PercentE@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    %rax,%r8
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<self_test>:
push   %r15
push   %r14
push   %rbx
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <arith_self_test@plt>
mov    $0x41e,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1060 <PercentE@plt>
mov    %rax,%r14
mov    $0x41e,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1060 <PercentE@plt>
mov    %rax,%r15
mov    $0x41e,%edi
mov    $0x1,%esi
mov    $0x2,%edx
call   1060 <PercentE@plt>
mov    %rax,%rbx
mov    $0x41e,%edi
mov    $0x1,%esi
mov    $0x3,%edx
call   1060 <PercentE@plt>
lea    0xe4b(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe82(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"*** self test begin ***\0A\00"
@.str.1 = [57 x i8] c"1054 displays with increasing precision as: %s %s %s %s\0A\00"
@.str.2 = [28 x i8] c"*** self test complete ***\0A\00"
define void @self_test() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @arith_self_test()
%3 = call i8* @PercentE(i32 1054, i32 1, i32 0)
%4 = call i8* @PercentE(i32 1054, i32 1, i32 1)
%5 = call i8* @PercentE(i32 1054, i32 1, i32 2)
%6 = call i8* @PercentE(i32 1054, i32 1, i32 3)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4, i8* %5, i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [57 x i8] c"1054 displays with increasing precision as: %s %s %s %s\0A\00"
@str = [24 x i8] c"*** self test begin ***\00"
@str.3 = [27 x i8] c"*** self test complete ***\00"
define void @self_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @arith_self_test()
%3 = tail call i8* @PercentE(i32 1054, i32 1, i32 0)
%4 = tail call i8* @PercentE(i32 1054, i32 1, i32 1)
%5 = tail call i8* @PercentE(i32 1054, i32 1, i32 2)
%6 = tail call i8* @PercentE(i32 1054, i32 1, i32 3)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4, i8* %5, i8* %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0))
ret void
}