int main() {
  srand(time(0));
  char s[64];
  int offset = 0;
  for (int i = 0; i < 10; i++) {
    offset += sprintf(s + offset, "%d,", rand() % 100);
  }
  s[offset - 1] = '\n';
  printf(s);
  char str[20];
  char s1[3] = {'A', 'B', 'C'};
  char s2[3] = {'T', 'Y', 'x'};
  sprintf(str, "%.*s%.*s", 2, s1, 3, s2);
  sprintf(s, "%*.*f", 10, 2, 3.1415926);
  printf(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1050 <time@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <srand@plt>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
cmpl   $0xa,-0x58(%rbp)
jge    11d0 <main+0x80>
lea    -0x50(%rbp),%rax
movslq -0x54(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
mov    -0x80(%rbp),%rdi
mov    $0x64,%ecx
cltd
idiv   %ecx
lea    0xe53(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
add    -0x54(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1182 <main+0x32>
mov    -0x54(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0xa,-0x50(%rbp,%rax,1)
lea    -0x50(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xe2c(%rip),%ax
mov    %ax,-0x73(%rbp)
mov    0xe24(%rip),%al
mov    %al,-0x71(%rbp)
mov    0xe1b(%rip),%ax
mov    %ax,-0x76(%rbp)
mov    0xe13(%rip),%al
mov    %al,-0x74(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0x73(%rbp),%rcx
lea    -0x76(%rbp),%r9
lea    0xde9(%rip),%rsi
mov    $0x2,%edx
mov    $0x3,%r8d
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0x50(%rbp),%rdi
lea    0xdd5(%rip),%rsi
mov    $0xa,%edx
mov    $0x2,%ecx
movsd  0xdae(%rip),%xmm0
mov    $0x1,%al
call   1060 <sprintf@plt>
lea    -0x70(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
xor    %edi,%edi
xor    %eax,%eax
call   1050 <time@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <srand@plt>
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rdx
imul   $0x51eb851f,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edx
lea    0xe71(%rip),%r15
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sprintf@plt>
movslq %eax,%rbx
lea    (%rsp,%rbx,1),%r12
add    $0x10,%r12
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rdx
imul   $0x51eb851f,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sprintf@plt>
add    %eax,%ebx
movslq %ebx,%rbx
lea    (%rsp,%rbx,1),%r12
add    $0x10,%r12
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rdx
imul   $0x51eb851f,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sprintf@plt>
add    %eax,%ebx
movslq %ebx,%rbx
lea    (%rsp,%rbx,1),%r12
add    $0x10,%r12
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rdx
imul   $0x51eb851f,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sprintf@plt>
add    %eax,%ebx
movslq %ebx,%rbx
lea    (%rsp,%rbx,1),%r12
add    $0x10,%r12
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rdx
imul   $0x51eb851f,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sprintf@plt>
add    %eax,%ebx
movslq %ebx,%rbx
lea    (%rsp,%rbx,1),%r12
add    $0x10,%r12
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rdx
imul   $0x51eb851f,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sprintf@plt>
add    %eax,%ebx
movslq %ebx,%rbx
lea    (%rsp,%rbx,1),%r12
add    $0x10,%r12
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rdx
imul   $0x51eb851f,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sprintf@plt>
add    %eax,%ebx
movslq %ebx,%rbx
lea    (%rsp,%rbx,1),%r12
add    $0x10,%r12
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rdx
imul   $0x51eb851f,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sprintf@plt>
add    %eax,%ebx
movslq %ebx,%rbx
lea    (%rsp,%rbx,1),%r12
add    $0x10,%r12
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rdx
imul   $0x51eb851f,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sprintf@plt>
add    %eax,%ebx
movslq %ebx,%rbx
lea    (%rsp,%rbx,1),%r12
add    $0x10,%r12
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rdx
imul   $0x51eb851f,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sprintf@plt>
add    %eax,%ebx
movslq %ebx,%rax
movb   $0xa,-0x1(%rax,%r14,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movb   $0x43,0xe(%rsp)
movw   $0x4241,0xc(%rsp)
movb   $0x78,0xa(%rsp)
movw   $0x5954,0x8(%rsp)
lea    0xc0c(%rip),%rsi
lea    0x50(%rsp),%rbx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r9
mov    %rbx,%rdi
mov    $0x2,%edx
mov    $0x3,%r8d
xor    %eax,%eax
call   1060 <sprintf@plt>
lea    0xbea(%rip),%rsi
movsd  0xbcd(%rip),%xmm0
mov    %r14,%rdi
mov    $0xa,%edx
mov    $0x2,%ecx
mov    $0x1,%al
call   1060 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d,\00"
@__const.main.s1 = [3 x i8] c"ABC"
@__const.main.s2 = [3 x i8] c"TYx"
@.str.1 = [9 x i8] c"%.*s%.*s\00"
@.str.2 = [6 x i8] c"%*.*f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [20 x i8]
%6 = alloca [3 x i8]
%7 = alloca [3 x i8]
store i32 0, i32* %1
%8 = call i32 (i32, ...) bitcast (i32 (...)* @time to i32 (i32, ...)*)(i32 0)
%9 = call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 %8)
store i32 0, i32* %3
store i32 0, i32* %4
br label %10
10: ; preds = %23, %0
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = call i32 (...) @rand()
%19 = srem i32 %18, 100
%20 = call i32 (i8*, i8*, ...) @sprintf(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %3
%22 = add nsw i32 %21, %20
store i32 %22, i32* %3
br label %23
23: ; preds = %13
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %10
26: ; preds = %10
%27 = load i32, i32* %3
%28 = sub nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 %29
store i8 10, i8* %30
%31 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%32 = call i32 (i8*, ...) @printf(i8* %31)
%33 = bitcast [3 x i8]* %6 to i8*
%34 = bitcast [3 x i8]* %7 to i8*
%35 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%36 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%37 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%38 = call i32 (i8*, i8*, ...) @sprintf(i8* %35, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %36, i32 3, i8* %37)
%39 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%40 = call i32 (i8*, i8*, ...) @sprintf(i8* %39, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 10, i32 2, double 0x400921FB4D12D84A)
%41 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%42 = call i32 (i8*, ...) @printf(i8* %41)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d,\00"
@__const.main.s1 = [3 x i8] c"ABC"
@__const.main.s2 = [3 x i8] c"TYx"
@.str.1 = [9 x i8] c"%.*s%.*s\00"
@.str.2 = [6 x i8] c"%*.*f\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = alloca [20 x i8]
%3 = alloca [3 x i8]
%4 = alloca [3 x i8]
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @time to i32 (i32, ...)*)(i32 0)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 100
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %11
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 100
%15 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = add nsw i32 %15, %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %17
%19 = tail call i32 (...) @rand()
%20 = srem i32 %19, 100
%21 = call i32 (i8*, i8*, ...) @sprintf(i8* %18, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = add nsw i32 %21, %16
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %23
%25 = tail call i32 (...) @rand()
%26 = srem i32 %25, 100
%27 = call i32 (i8*, i8*, ...) @sprintf(i8* %24, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = add nsw i32 %27, %22
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %29
%31 = tail call i32 (...) @rand()
%32 = srem i32 %31, 100
%33 = call i32 (i8*, i8*, ...) @sprintf(i8* %30, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %32)
%34 = add nsw i32 %33, %28
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %35
%37 = tail call i32 (...) @rand()
%38 = srem i32 %37, 100
%39 = call i32 (i8*, i8*, ...) @sprintf(i8* %36, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %38)
%40 = add nsw i32 %39, %34
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %41
%43 = tail call i32 (...) @rand()
%44 = srem i32 %43, 100
%45 = call i32 (i8*, i8*, ...) @sprintf(i8* %42, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %44)
%46 = add nsw i32 %45, %40
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %47
%49 = tail call i32 (...) @rand()
%50 = srem i32 %49, 100
%51 = call i32 (i8*, i8*, ...) @sprintf(i8* %48, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %50)
%52 = add nsw i32 %51, %46
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %53
%55 = tail call i32 (...) @rand()
%56 = srem i32 %55, 100
%57 = call i32 (i8*, i8*, ...) @sprintf(i8* %54, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %56)
%58 = add nsw i32 %57, %52
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %59
%61 = tail call i32 (...) @rand()
%62 = srem i32 %61, 100
%63 = call i32 (i8*, i8*, ...) @sprintf(i8* %60, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %62)
%64 = add nsw i32 %63, %58
%65 = add nsw i32 %64, -1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %66
store i8 10, i8* %67
%68 = call i32 (i8*, ...) @printf(i8* %7)
%69 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%70 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%71 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%72 = call i32 (i8*, i8*, ...) @sprintf(i8* %69, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %70, i32 3, i8* %71)
%73 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 10, i32 2, double 0x400921FB4D12D84A)
%74 = call i32 (i8*, ...) @printf(i8* %69)
ret i32 0
}