#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 */
char *column_fill_characters(char *, char *);
char *column_skip_spaces(char *);
char *column(char *destination, int field_offset, char *string) {
  int this_column = 0;
  if (!string)
    return (char *)0;
  string = column_skip_spaces(string);
  while (*string) {
    if (this_column == field_offset) {
      column_fill_characters(destination, string);
      return destination;
    }
    this_column++;
    string = column_fill_characters(destination, string);
    string = column_skip_spaces(string);
  }
  *destination = '\0';
  return (char *)0;
}


x86 assembly (clang, -O0):
<column>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1152 <column+0x32>
movq   $0x0,-0x8(%rbp)
jmp    11cd <column+0xad>
mov    -0x20(%rbp),%rdi
call   1040 <column_skip_spaces@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     11be <column+0x9e>
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1192 <column+0x72>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <column_fill_characters@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11cd <column+0xad>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <column_fill_characters@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <column_skip_spaces@plt>
mov    %rax,-0x20(%rbp)
jmp    115f <column+0x3f>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<column>:
push   %rbp
push   %rbx
push   %rax
test   %rdx,%rdx
je     1160 <column+0x40>
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1040 <column_skip_spaces@plt>
cmpb   $0x0,(%rax)
je     115d <column+0x3d>
add    $0x1,%ebp
nopl   (%rax)
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0xffffffff,%ebp
je     116c <column+0x4c>
call   1030 <column_fill_characters@plt>
mov    %rax,%rdi
call   1040 <column_skip_spaces@plt>
cmpb   $0x0,(%rax)
jne    1140 <column+0x20>
movb   $0x0,(%rbx)
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
call   1030 <column_fill_characters@plt>
jmp    1162 <column+0x42>

LLVM IR (-O0):
define i8* @column(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 0, i32* %8
%9 = load i8*, i8** %7
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %3
store i8* null, i8** %4
br label %38
12: ; preds = %3
%13 = load i8*, i8** %7
%14 = call i8* @column_skip_spaces(i8* %13)
store i8* %14, i8** %7
br label %15
15: ; preds = %28, %12
%16 = load i8*, i8** %7
%17 = load i8, i8* %16
%18 = icmp ne i8 %17, 0
br i1 %18, label %19, label %36
19: ; preds = %15
%20 = load i32, i32* %8
%21 = load i32, i32* %6
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8*, i8** %5
%25 = load i8*, i8** %7
%26 = call i8* @column_fill_characters(i8* %24, i8* %25)
%27 = load i8*, i8** %5
store i8* %27, i8** %4
br label %38
28: ; preds = %19
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 1
store i32 %30, i32* %8
%31 = load i8*, i8** %5
%32 = load i8*, i8** %7
%33 = call i8* @column_fill_characters(i8* %31, i8* %32)
store i8* %33, i8** %7
%34 = load i8*, i8** %7
%35 = call i8* @column_skip_spaces(i8* %34)
store i8* %35, i8** %7
br label %15
36: ; preds = %15
%37 = load i8*, i8** %5
store i8 0, i8* %37
store i8* null, i8** %4
br label %38
38: ; preds = %36, %23, %11
%39 = load i8*, i8** %4
ret i8* %39
}

LLVM IR (-O2):
define i8* @column(i8* %0, i32 %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %22, label %5
5: ; preds = %3
%6 = tail call i8* @column_skip_spaces(i8* %2)
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %21, label %9
9: ; preds = %5, %15
%10 = phi i32 [ %16, %15 ], [ 0, %5 ]
%11 = phi i8* [ %18, %15 ], [ %6, %5 ]
%12 = icmp eq i32 %10, %1
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = tail call i8* @column_fill_characters(i8* %0, i8* %11)
br label %22
15: ; preds = %9
%16 = add nuw nsw i32 %10, 1
%17 = tail call i8* @column_fill_characters(i8* %0, i8* %11)
%18 = tail call i8* @column_skip_spaces(i8* %17)
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %9
21: ; preds = %15, %5
store i8 0, i8* %0
br label %22
22: ; preds = %3, %21, %13
%23 = phi i8* [ %0, %13 ], [ null, %21 ], [ null, %3 ]
ret i8* %23
}