#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 main(void) {
  int i = 1;
  while (i <= 42) {
    if (i % 7 == 0) {
      printf("%2d\n", i);
      i++;
    } else {
      printf("%2d\t", i);
      i++;
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x2a,-0x8(%rbp)
jg     1182 <main+0x72>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1163 <main+0x53>
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117d <main+0x6d>
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%ebx
lea    0xecf(%rip),%r14
lea    0xecd(%rip),%r15
jmp    1151 <main+0x31>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x2b,%ebx
je     1180 <main+0x60>
movzbl %bl,%eax
lea    (%rax,%rax,8),%ecx
lea    (%rax,%rcx,4),%ecx
shr    $0x8,%ecx
mov    %eax,%edx
sub    %cl,%dl
shr    %dl
add    %cl,%dl
shr    $0x2,%dl
movzbl %dl,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
mov    %r14,%rdi
add    %al,%cl
je     1140 <main+0x20>
mov    %r15,%rdi
jmp    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%2d\0A\00"
@.str.1 = [5 x i8] c"%2d\09\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %20, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 42
br i1 %5, label %6, label %21
6: ; preds = %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %20
15: ; preds = %6
%16 = load i32, i32* %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %20
20: ; preds = %15, %10
br label %3
21: ; preds = %3
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [5 x i8] c"%2d\0A\00"
@.str.1 = [5 x i8] c"%2d\09\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %8, %1 ]
%3 = trunc i32 %2 to i8
%4 = urem i8 %3, 7
%5 = icmp eq i8 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %6, i32 %2)
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 43
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = tail call i32 @putchar(i32 10)
ret i32 0
}