#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 get_vector_bit(char *, int);
int /*<<< orphan*/ printf(char *, ...);
void print_vector(char *vector) {
  int i, a, b, val;
  for (i = 0; i < 9025; i++) {
    if (get_vector_bit(vector, i) == 1) {
      a = i / 95;
      b = i - (a * 95);
      printf("%c%c ", a + 32, b + 32);
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2341,-0xc(%rbp)
jge    119c <print_vector+0x7c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <get_vector_bit@plt>
cmp    $0x1,%eax
jne    1189 <print_vector+0x69>
mov    -0xc(%rbp),%eax
mov    $0x5f,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   $0x5f,-0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%esi
add    $0x20,%esi
mov    -0x14(%rbp),%edx
add    $0x20,%edx
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    118e <print_vector+0x6e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <print_vector+0x13>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vector>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xec2(%rip),%r14
xor    %ebp,%ebp
jmp    115b <print_vector+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebp
cmp    $0x2341,%ebp
je     11a9 <print_vector+0x79>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <get_vector_bit@plt>
cmp    $0x1,%eax
jne    1150 <print_vector+0x20>
mov    %ebp,%eax
imul   $0x58ed2309,%rax,%rax
shr    $0x20,%rax
mov    %ebp,%ecx
sub    %eax,%ecx
shr    %ecx
add    %eax,%ecx
shr    $0x6,%ecx
imul   $0x5f,%ecx,%eax
mov    $0x20,%edx
sub    %eax,%edx
movzwl %bp,%eax
imul   $0xac77,%eax,%esi
shr    $0x16,%esi
add    $0x20,%esi
add    %ebp,%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1150 <print_vector+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%c%c \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_vector(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %7
7: ; preds = %28, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 9025
br i1 %9, label %10, label %31
10: ; preds = %7
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = call i32 @get_vector_bit(i8* %11, i32 %12)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %27
15: ; preds = %10
%16 = load i32, i32* %3
%17 = sdiv i32 %16, 95
store i32 %17, i32* %4
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = mul nsw i32 %19, 95
%21 = sub nsw i32 %18, %20
store i32 %21, i32* %5
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 32
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 32
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %25)
br label %27
27: ; preds = %15, %10
br label %28
28: ; preds = %27
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %7
31: ; preds = %7
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%c%c \00"
define void @print_vector(i8* %0) {
br label %2
2: ; preds = %1, %15
%3 = phi i32 [ 0, %1 ], [ %16, %15 ]
%4 = tail call i32 @get_vector_bit(i8* %0, i32 %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = trunc i32 %3 to i16
%8 = udiv i16 %7, 95
%9 = zext i16 %8 to i32
%10 = mul nsw i32 %9, -95
%11 = add nuw nsw i32 %9, 32
%12 = add nuw nsw i32 %3, 32
%13 = add i32 %12, %10
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %13)
br label %15
15: ; preds = %2, %6
%16 = add nuw nsw i32 %3, 1
%17 = icmp eq i32 %16, 9025
br i1 %17, label %18, label %2
18: ; preds = %15
%19 = tail call i32 @putchar(i32 10)
ret void
}