#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*/ assertStringsEqual(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
void test_padding_point_20() {
  char buffer[100];
  sprintf(buffer, "%.20d", 1024);
  assertStringsEqual(buffer, "00000000000000001024");
  sprintf(buffer, "%.20d", -1024);
  assertStringsEqual(buffer, "-00000000000000001024");
  sprintf(buffer, "%.20i", 1024);
  assertStringsEqual(buffer, "00000000000000001024");
  sprintf(buffer, "%.20i", -1024);
  assertStringsEqual(buffer, "-00000000000000001024");
  sprintf(buffer, "%.20u", 1024);
  assertStringsEqual(buffer, "00000000000000001024");
  sprintf(buffer, "%.20u", 4294966272U);
  assertStringsEqual(buffer, "00000000004294966272");
  sprintf(buffer, "%.20o", 511);
  assertStringsEqual(buffer, "00000000000000000777");
  sprintf(buffer, "%.20o", 4294966785U);
  assertStringsEqual(buffer, "00000000037777777001");
  sprintf(buffer, "%.20x", 305441741);
  assertStringsEqual(buffer, "0000000000001234abcd");
  sprintf(buffer, "%.20x", 3989525555U);
  assertStringsEqual(buffer, "000000000000edcb5433");
  sprintf(buffer, "%.20X", 305441741);
  assertStringsEqual(buffer, "0000000000001234ABCD");
  sprintf(buffer, "%.20X", 3989525555U);
  assertStringsEqual(buffer, "000000000000EDCB5433");
}


x86 assembly (clang, -O0):
<test_padding_point_20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x400,%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xea8(%rip),%rsi
mov    $0xfffffc00,%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x400,%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xe7a(%rip),%rsi
mov    $0xfffffc00,%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe4f(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xe5b(%rip),%rsi
mov    $0x400,%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe2b(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xe36(%rip),%rsi
mov    $0xfffffc00,%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe27(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xe2c(%rip),%rsi
mov    $0x1ff,%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe1d(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xe07(%rip),%rsi
mov    $0xfffffe01,%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe0d(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xe12(%rip),%rsi
mov    $0x1234abcd,%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe03(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xded(%rip),%rsi
mov    $0xedcb5433,%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xdf3(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xdf8(%rip),%rsi
mov    $0x1234abcd,%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xde9(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xdd3(%rip),%rsi
mov    $0xedcb5433,%edx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xdd9(%rip),%rsi
call   1030 <assertStringsEqual@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_padding_point_20>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xece(%rip),%r15
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x400,%edx
call   1040 <sprintf@plt>
lea    0xebb(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xfffffc00,%edx
call   1040 <sprintf@plt>
lea    0xe98(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <assertStringsEqual@plt>
lea    0xe9c(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x400,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0xfffffc00,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <assertStringsEqual@plt>
lea    0xe65(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x400,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xfffffc00,%edx
call   1040 <sprintf@plt>
lea    0xe39(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
lea    0xe3f(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1ff,%edx
call   1040 <sprintf@plt>
lea    0xe2e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfffffe01,%edx
call   1040 <sprintf@plt>
lea    0xe24(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
lea    0xe2a(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1234abcd,%edx
call   1040 <sprintf@plt>
lea    0xe19(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xedcb5433,%edx
call   1040 <sprintf@plt>
lea    0xe0f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
lea    0xe15(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1234abcd,%edx
call   1040 <sprintf@plt>
lea    0xe04(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xedcb5433,%edx
call   1040 <sprintf@plt>
lea    0xdfa(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.20d\00"
@.str.1 = [21 x i8] c"00000000000000001024\00"
@.str.2 = [22 x i8] c"-00000000000000001024\00"
@.str.3 = [6 x i8] c"%.20i\00"
@.str.4 = [6 x i8] c"%.20u\00"
@.str.5 = [21 x i8] c"00000000004294966272\00"
@.str.6 = [6 x i8] c"%.20o\00"
@.str.7 = [21 x i8] c"00000000000000000777\00"
@.str.8 = [21 x i8] c"00000000037777777001\00"
@.str.9 = [6 x i8] c"%.20x\00"
@.str.10 = [21 x i8] c"0000000000001234abcd\00"
@.str.11 = [21 x i8] c"000000000000edcb5433\00"
@.str.12 = [6 x i8] c"%.20X\00"
@.str.13 = [21 x i8] c"0000000000001234ABCD\00"
@.str.14 = [21 x i8] c"000000000000EDCB5433\00"
define void @test_padding_point_20() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1024)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @assertStringsEqual(i8* %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 -1024)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%9 = call i32 @assertStringsEqual(i8* %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%11 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 1024)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%13 = call i32 @assertStringsEqual(i8* %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%15 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 -1024)
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%17 = call i32 @assertStringsEqual(i8* %16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%19 = call i32 @sprintf(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 1024)
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%21 = call i32 @assertStringsEqual(i8* %20, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%23 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 -1024)
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%25 = call i32 @assertStringsEqual(i8* %24, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%27 = call i32 @sprintf(i8* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 511)
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%29 = call i32 @assertStringsEqual(i8* %28, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%31 = call i32 @sprintf(i8* %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 -511)
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%33 = call i32 @assertStringsEqual(i8* %32, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%35 = call i32 @sprintf(i8* %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 305441741)
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%37 = call i32 @assertStringsEqual(i8* %36, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0))
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%39 = call i32 @sprintf(i8* %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 -305441741)
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%41 = call i32 @assertStringsEqual(i8* %40, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%43 = call i32 @sprintf(i8* %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 305441741)
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%45 = call i32 @assertStringsEqual(i8* %44, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0))
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%47 = call i32 @sprintf(i8* %46, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 -305441741)
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%49 = call i32 @assertStringsEqual(i8* %48, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.20d\00"
@.str.1 = [21 x i8] c"00000000000000001024\00"
@.str.2 = [22 x i8] c"-00000000000000001024\00"
@.str.3 = [6 x i8] c"%.20i\00"
@.str.4 = [6 x i8] c"%.20u\00"
@.str.5 = [21 x i8] c"00000000004294966272\00"
@.str.6 = [6 x i8] c"%.20o\00"
@.str.7 = [21 x i8] c"00000000000000000777\00"
@.str.8 = [21 x i8] c"00000000037777777001\00"
@.str.9 = [6 x i8] c"%.20x\00"
@.str.10 = [21 x i8] c"0000000000001234abcd\00"
@.str.11 = [21 x i8] c"000000000000edcb5433\00"
@.str.12 = [6 x i8] c"%.20X\00"
@.str.13 = [21 x i8] c"0000000000001234ABCD\00"
@.str.14 = [21 x i8] c"000000000000EDCB5433\00"
define void @test_padding_point_20() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1024)
%4 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 -1024)
%6 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 1024)
%8 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 -1024)
%10 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 1024)
%12 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 -1024)
%14 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 511)
%16 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 -511)
%18 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
%19 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 305441741)
%20 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0))
%21 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 -305441741)
%22 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
%23 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 305441741)
%24 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0))
%25 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 -305441741)
%26 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0))
ret void
}