#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 *, char *);
int /*<<< orphan*/ strncpy(char *, char *, long);
void printValue(char line[], long length) {
  char output[length];
  int i;
  for (i = 0; i < length; i++) {
    if (line[i] != ' ') {
      strncpy(output, line + i, length);
      printf("%s\n\n", output);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<printValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    11c1 <printValue+0xa1>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     11ae <printValue+0x8e>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x24(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x30(%rbp),%rsi
lea    0xe5c(%rip),%rdi
call   1040 <printf@plt>
jmp    11c1 <printValue+0xa1>
jmp    11b3 <printValue+0x93>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115e <printValue+0x3e>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printValue>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rsi,%rdx
mov    %rsp,%rbx
lea    0xf(%rsi),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
test   %rsi,%rsi
jle    117d <printValue+0x5d>
mov    %rdi,%rsi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x20,(%rsi,%rax,1)
jne    1161 <printValue+0x41>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1150 <printValue+0x30>
jmp    117d <printValue+0x5d>
mov    %eax,%eax
add    %rax,%rsi
mov    %rbx,%rdi
call   1030 <strncpy@plt>
lea    0xe8b(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s\0A\0A\00"
define void @printValue(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%8 = load i64, i64* %4
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
store i32 0, i32* %7
br label %11
11: ; preds = %33, %2
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = load i64, i64* %4
%15 = icmp slt i64 %13, %14
br i1 %15, label %16, label %36
16: ; preds = %11
%17 = load i8*, i8** %3
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 32
br i1 %23, label %24, label %32
24: ; preds = %16
%25 = load i8*, i8** %3
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i64, i64* %4
%30 = call i32 @strncpy(i8* %10, i8* %28, i64 %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %36
32: ; preds = %16
br label %33
33: ; preds = %32
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %11
36: ; preds = %24, %11
%37 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0A\0A\00"
define void @printValue(i8* %0, i64 %1) {
%3 = alloca i8, i64 %1
%4 = icmp sgt i64 %1, 0
br i1 %4, label %5, label %18
5: ; preds = %2, %15
%6 = phi i64 [ %16, %15 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = and i64 %6, 4294967295
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = call i32 @strncpy(i8* %3, i8* %12, i64 %1)
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %18
15: ; preds = %5
%16 = add nuw nsw i64 %6, 1
%17 = icmp eq i64 %16, %1
br i1 %17, label %18, label %5
18: ; preds = %15, %2, %10
ret void
}