#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*/ printf(char *, ...);
int strlen(char *);
void print_align(char aln1[], char aln2[], char aln[]) {
  int i, l;
  int j, k, m, n;
  l = strlen(aln1);
  printf("1        10        20        30        40        50\n");
  printf("....:....|....:....|....:....|....:....|....:....|\n\n");
  m = l;
  n = 0;
  for (i = 0; i < l; i = i + 50) {
    if (m > 50) {
      k = 50;
    } else {
      k = m % 50;
    }
    for (j = 0; j < k; j++) {
      printf("%c", aln1[i + j]);
    }
    printf("\n");
    for (j = 0; j < k; j++) {
      printf("%c", aln[i + j]);
    }
    printf("\n");
    for (j = 0; j < k; j++) {
      printf("%c", aln2[i + j]);
    }
    printf("\n\n");
    m = m - 50;
    n++;
  }
}


x86 assembly (clang, -O0):
<print_align>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    12aa <print_align+0x18a>
cmpl   $0x32,-0x2c(%rbp)
jle    1192 <print_align+0x72>
movl   $0x32,-0x28(%rbp)
jmp    11a0 <print_align+0x80>
mov    -0x2c(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %edx,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    11e0 <print_align+0xc0>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a7 <print_align+0x87>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    122e <print_align+0x10e>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11f5 <print_align+0xd5>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    127c <print_align+0x15c>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1243 <print_align+0x123>
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2c(%rbp),%eax
sub    $0x32,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x32,%eax
mov    %eax,-0x1c(%rbp)
jmp    1170 <print_align+0x50>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_align>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <strlen@plt>
mov    %eax,%ebp
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,0x8(%rsp)
test   %ebp,%ebp
jle    1288 <print_align+0x158>
xor    %edx,%edx
mov    0x8(%rsp),%esi
jmp    11c6 <print_align+0x96>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%esi
add    $0xffffffce,%esi
mov    0x10(%rsp),%rdx
add    $0x32,%rdx
add    $0x32,%rbx
add    $0x32,%r15
add    $0x32,%r14
cmp    %edx,0x8(%rsp)
jle    1288 <print_align+0x158>
mov    $0x32,%r13d
cmp    $0x32,%esi
jg     11f1 <print_align+0xc1>
movslq %esi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
imul   $0x32,%eax,%eax
mov    %esi,%r13d
sub    %eax,%r13d
test   %r13d,%r13d
mov    %rdx,0x10(%rsp)
mov    %esi,0xc(%rsp)
jle    1180 <print_align+0x50>
mov    %r13d,%r12d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx,%rbp,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1210 <print_align+0xe0>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r13d,%r13d
jle    118a <print_align+0x5a>
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbp,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1240 <print_align+0x110>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r13d,%r13d
jle    1194 <print_align+0x64>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbp,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1270 <print_align+0x140>
jmp    1194 <print_align+0x64>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [53 x i8] c"1 10 20 30 40 50\0A\00"
@.str.1 = [53 x i8] c"....:....|....:....|....:....|....:....|....:....|\0A\0A\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
define void @print_align(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%13 = load i8*, i8** %4
%14 = call i32 @strlen(i8* %13)
store i32 %14, i32* %8
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %8
store i32 %17, i32* %11
store i32 0, i32* %12
store i32 0, i32* %7
br label %18
18: ; preds = %91, %3
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %94
22: ; preds = %18
%23 = load i32, i32* %11
%24 = icmp sgt i32 %23, 50
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 50, i32* %10
br label %29
26: ; preds = %22
%27 = load i32, i32* %11
%28 = srem i32 %27, 50
store i32 %28, i32* %10
br label %29
29: ; preds = %26, %25
store i32 0, i32* %9
br label %30
30: ; preds = %44, %29
%31 = load i32, i32* %9
%32 = load i32, i32* %10
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %47
34: ; preds = %30
%35 = load i8*, i8** %4
%36 = load i32, i32* %7
%37 = load i32, i32* %9
%38 = add nsw i32 %36, %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %35, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %34
%45 = load i32, i32* %9
%46 = add nsw i32 %45, 1
store i32 %46, i32* %9
br label %30
47: ; preds = %30
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %9
br label %49
49: ; preds = %63, %47
%50 = load i32, i32* %9
%51 = load i32, i32* %10
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %66
53: ; preds = %49
%54 = load i8*, i8** %6
%55 = load i32, i32* %7
%56 = load i32, i32* %9
%57 = add nsw i32 %55, %56
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %54, i64 %58
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %53
%64 = load i32, i32* %9
%65 = add nsw i32 %64, 1
store i32 %65, i32* %9
br label %49
66: ; preds = %49
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %9
br label %68
68: ; preds = %82, %66
%69 = load i32, i32* %9
%70 = load i32, i32* %10
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %85
72: ; preds = %68
%73 = load i8*, i8** %5
%74 = load i32, i32* %7
%75 = load i32, i32* %9
%76 = add nsw i32 %74, %75
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %73, i64 %77
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %80)
br label %82
82: ; preds = %72
%83 = load i32, i32* %9
%84 = add nsw i32 %83, 1
store i32 %84, i32* %9
br label %68
85: ; preds = %68
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%87 = load i32, i32* %11
%88 = sub nsw i32 %87, 50
store i32 %88, i32* %11
%89 = load i32, i32* %12
%90 = add nsw i32 %89, 1
store i32 %90, i32* %12
br label %91
91: ; preds = %85
%92 = load i32, i32* %7
%93 = add nsw i32 %92, 50
store i32 %93, i32* %7
br label %18
94: ; preds = %18
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"1 10 20 30 40 50\00"
@str.5 = [52 x i8] c"....:....|....:....|....:....|....:....|....:....|\0A\00"
@str.6 = [2 x i8] c"\0A\00"
define void @print_align(i8* %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.5, i64 0, i64 0))
%7 = icmp sgt i32 %4, 0
br i1 %7, label %8, label %62
8: ; preds = %3, %56
%9 = phi i64 [ %59, %56 ], [ 0, %3 ]
%10 = phi i32 [ %58, %56 ], [ %4, %3 ]
%11 = icmp sgt i32 %10, 50
%12 = srem i32 %10, 50
%13 = select i1 %11, i32 50, i32 %12
%14 = icmp sgt i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %8
%16 = tail call i32 @putchar(i32 10)
br label %41
17: ; preds = %8
%18 = zext i32 %13 to i64
br label %19
19: ; preds = %17, %19
%20 = phi i64 [ 0, %17 ], [ %26, %19 ]
%21 = add nuw nsw i64 %20, %9
%22 = getelementptr inbounds i8, i8* %0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = tail call i32 @putchar(i32 %24)
%26 = add nuw nsw i64 %20, 1
%27 = icmp eq i64 %26, %18
br i1 %27, label %28, label %19
28: ; preds = %19
%29 = tail call i32 @putchar(i32 10)
br i1 %14, label %30, label %41
30: ; preds = %28
%31 = zext i32 %13 to i64
br label %32
32: ; preds = %30, %32
%33 = phi i64 [ 0, %30 ], [ %39, %32 ]
%34 = add nuw nsw i64 %33, %9
%35 = getelementptr inbounds i8, i8* %2, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = tail call i32 @putchar(i32 %37)
%39 = add nuw nsw i64 %33, 1
%40 = icmp eq i64 %39, %31
br i1 %40, label %43, label %32
41: ; preds = %15, %28
%42 = tail call i32 @putchar(i32 10)
br label %56
43: ; preds = %32
%44 = tail call i32 @putchar(i32 10)
br i1 %14, label %45, label %56
45: ; preds = %43
%46 = zext i32 %13 to i64
br label %47
47: ; preds = %45, %47
%48 = phi i64 [ 0, %45 ], [ %54, %47 ]
%49 = add nuw nsw i64 %48, %9
%50 = getelementptr inbounds i8, i8* %1, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = tail call i32 @putchar(i32 %52)
%54 = add nuw nsw i64 %48, 1
%55 = icmp eq i64 %54, %46
br i1 %55, label %56, label %47
56: ; preds = %47, %41, %43
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
%58 = add nsw i32 %10, -50
%59 = add nuw i64 %9, 50
%60 = trunc i64 %59 to i32
%61 = icmp sgt i32 %4, %60
br i1 %61, label %8, label %62
62: ; preds = %56, %3
ret void
}