#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 */
void extract_method(char *out, const char *in, size_t out_len) {
  int i;
  do {
  } while (1 != 1);
  ;
  for (i = 0; i < out_len; i++) {
    if (in[i] == ' ')
      break;
    out[i] = in[i];
  }
  out[i] = 0x00;
  do {
  } while (1 != 1);
  ;
  return;
}


x86 assembly (clang, -O0):
<extract_method>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
jmp    1115 <extract_method+0x15>
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1168 <extract_method+0x68>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1144 <extract_method+0x44>
jmp    1168 <extract_method+0x68>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111c <extract_method+0x1c>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1179 <extract_method+0x79>
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_method>:
xor    %eax,%eax
test   %rdx,%rdx
je     112a <extract_method+0x2a>
nopw   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
cmp    $0x20,%cl
je     1128 <extract_method+0x28>
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <extract_method+0x10>
mov    %rdx,%rax
mov    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @extract_method(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
br label %8
8: ; preds = %3
br label %9
9: ; preds = %8
store i32 0, i32* %7
br label %10
10: ; preds = %34, %9
%11 = load i32, i32* %7
%12 = sext i32 %11 to i64
%13 = load i64, i64* %6
%14 = icmp ult i64 %12, %13
br i1 %14, label %15, label %37
15: ; preds = %10
%16 = load i8*, i8** %5
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 32
br i1 %22, label %23, label %24
23: ; preds = %15
br label %37
24: ; preds = %15
%25 = load i8*, i8** %5
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = load i8*, i8** %4
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
store i8 %29, i8* %33
br label %34
34: ; preds = %24
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
store i32 %36, i32* %7
br label %10
37: ; preds = %23, %10
%38 = load i8*, i8** %4
%39 = load i32, i32* %7
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %38, i64 %40
store i8 0, i8* %41
br label %42
42: ; preds = %37
br label %43
43: ; preds = %42
ret void
}

LLVM IR (-O2):
define void @extract_method(i8* nocapture writeonly %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %17, label %5
5: ; preds = %3, %10
%6 = phi i64 [ %12, %10 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %8, i8* %11
%12 = add nuw i64 %6, 1
%13 = icmp eq i64 %12, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %10
%15 = phi i64 [ %2, %10 ], [ %6, %5 ]
%16 = and i64 %15, 4294967295
br label %17
17: ; preds = %14, %3
%18 = phi i64 [ 0, %3 ], [ %16, %14 ]
%19 = getelementptr inbounds i8, i8* %0, i64 %18
store i8 0, i8* %19
ret void
}