#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void seekcol(FILE *f, int src, int dst) {
  if (dst <= src)
    fprintf(f, "\t");
  else {
    int n = dst / 8 - src / 8;
    if (n) {
      while (n--)
        fprintf(f, "\t");
      n = dst & 7;
    } else
      n = dst - src;
    while (n--)
      fprintf(f, " ");
  }
}


x86 assembly (clang, -O0):
<seekcol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1143 <seekcol+0x33>
mov    -0x8(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11e8 <seekcol+0xd8>
mov    -0x10(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11ac <seekcol+0x9c>
jmp    1175 <seekcol+0x65>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     119e <seekcol+0x8e>
mov    -0x8(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1175 <seekcol+0x65>
mov    -0x10(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x14(%rbp)
jmp    11b5 <seekcol+0xa5>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11ba <seekcol+0xaa>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     11e3 <seekcol+0xd3>
mov    -0x8(%rbp),%rdi
lea    0xe29(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11ba <seekcol+0xaa>
jmp    11e8 <seekcol+0xd8>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seekcol>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
mov    %edx,%ebp
sub    %esi,%ebp
jle    117d <seekcol+0x6d>
mov    %edx,%r14d
lea    0x7(%r14),%ebx
test   %edx,%edx
cmovns %edx,%ebx
sar    $0x3,%ebx
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
sub    %eax,%ebx
je     1159 <seekcol+0x49>
xchg   %ax,%ax
mov    $0x9,%edi
mov    %r15,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
jne    1140 <seekcol+0x30>
and    $0x7,%r14d
mov    %r14d,%ebp
test   %ebp,%ebp
je     1172 <seekcol+0x62>
nopl   (%rax)
mov    $0x20,%edi
mov    %r15,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1160 <seekcol+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x9,%edi
mov    %r15,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
@.str.1 = [2 x i8] c" \00"
define void @seekcol(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %46
14: ; preds = %3
%15 = load i32, i32* %6
%16 = sdiv i32 %15, 8
%17 = load i32, i32* %5
%18 = sdiv i32 %17, 8
%19 = sub nsw i32 %16, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %33
22: ; preds = %14
br label %23
23: ; preds = %27, %22
%24 = load i32, i32* %7
%25 = add nsw i32 %24, -1
store i32 %25, i32* %7
%26 = icmp ne i32 %24, 0
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i32*, i32** %4
%29 = call i32 @fprintf(i32* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %23
30: ; preds = %23
%31 = load i32, i32* %6
%32 = and i32 %31, 7
store i32 %32, i32* %7
br label %37
33: ; preds = %14
%34 = load i32, i32* %6
%35 = load i32, i32* %5
%36 = sub nsw i32 %34, %35
store i32 %36, i32* %7
br label %37
37: ; preds = %33, %30
br label %38
38: ; preds = %42, %37
%39 = load i32, i32* %7
%40 = add nsw i32 %39, -1
store i32 %40, i32* %7
%41 = icmp ne i32 %39, 0
br i1 %41, label %42, label %45
42: ; preds = %38
%43 = load i32*, i32** %4
%44 = call i32 @fprintf(i32* %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %38
45: ; preds = %38
br label %46
46: ; preds = %45, %11
ret void
}

LLVM IR (-O2):
define void @seekcol(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @fputc(i32 9, i32* %0)
br label %29
7: ; preds = %3
%8 = sdiv i32 %2, 8
%9 = sdiv i32 %1, -8
%10 = add nsw i32 %8, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %7, %12
%13 = phi i32 [ %14, %12 ], [ %10, %7 ]
%14 = add nsw i32 %13, -1
%15 = tail call i32 @fputc(i32 9, i32* %0)
%16 = icmp eq i32 %14, 0
br i1 %16, label %17, label %12
17: ; preds = %12
%18 = and i32 %2, 7
br label %21
19: ; preds = %7
%20 = sub nsw i32 %2, %1
br label %21
21: ; preds = %19, %17
%22 = phi i32 [ %18, %17 ], [ %20, %19 ]
%23 = icmp eq i32 %22, 0
br i1 %23, label %29, label %24
24: ; preds = %21, %24
%25 = phi i32 [ %26, %24 ], [ %22, %21 ]
%26 = add nsw i32 %25, -1
%27 = tail call i32 @fputc(i32 32, i32* %0)
%28 = icmp eq i32 %26, 0
br i1 %28, label %29, label %24
29: ; preds = %24, %21, %5
ret void
}