#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 */
scalar_t__ com_parse_char_command(char *, char *, char);
unsigned int strlen(char *);
int com_parse_info_string(char *response, char *message) {
  char raw_message[256];
  if (com_parse_char_command(raw_message, response, 'i')) {
    return 1;
  }
  unsigned int i;
  for (i = 0; i < strlen(raw_message); i++) {
    if (raw_message[i] == '-') {
      message[i] = ' ';
    } else {
      message[i] = raw_message[i];
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<com_parse_info_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x69,%edx
call   1040 <com_parse_char_command@plt>
cmp    $0x0,%rax
je     115e <com_parse_info_string+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    11f4 <com_parse_info_string+0xd4>
movl   $0x0,-0x124(%rbp)
mov    -0x124(%rbp),%eax
mov    %eax,-0x128(%rbp)
lea    -0x120(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x128(%rbp),%eax
cmp    %ecx,%eax
jae    11ed <com_parse_info_string+0xcd>
mov    -0x124(%rbp),%eax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0x2d,%eax
jne    11ba <com_parse_info_string+0x9a>
mov    -0x18(%rbp),%rax
mov    -0x124(%rbp),%ecx
movb   $0x20,(%rax,%rcx,1)
jmp    11d4 <com_parse_info_string+0xb4>
mov    -0x124(%rbp),%eax
mov    -0x120(%rbp,%rax,1),%dl
mov    -0x18(%rbp),%rax
mov    -0x124(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
jmp    11d9 <com_parse_info_string+0xb9>
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    1168 <com_parse_info_string+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<com_parse_info_string>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x69,%edx
call   1040 <com_parse_char_command@plt>
mov    $0x1,%r14d
test   %rax,%rax
jne    1190 <com_parse_info_string+0x70>
mov    %rsp,%rdi
call   1030 <strlen@plt>
xor    %r14d,%r14d
test   %eax,%eax
je     1190 <com_parse_info_string+0x70>
mov    $0x20,%r12d
mov    %rsp,%r15
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movzbl (%rsp,%rbp,1),%eax
cmp    $0x2d,%al
cmove  %r12d,%eax
mov    %al,(%rbx,%rbp,1)
add    $0x1,%rbp
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%rbp
jb     1170 <com_parse_info_string+0x50>
mov    %r14d,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @com_parse_info_string(i8* %0, i8* nocapture writeonly %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i64 @com_parse_char_command(i8* %4, i8* %0, i8 signext 105)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %21
7: ; preds = %2
%8 = call i32 @strlen(i8* %4)
%9 = icmp eq i32 %8, 0
br i1 %9, label %21, label %10
10: ; preds = %7, %10
%11 = phi i64 [ %17, %10 ], [ 0, %7 ]
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 45
%15 = select i1 %14, i8 32, i8 %13
%16 = getelementptr inbounds i8, i8* %1, i64 %11
store i8 %15, i8* %16
%17 = add nuw nsw i64 %11, 1
%18 = call i32 @strlen(i8* %4)
%19 = zext i32 %18 to i64
%20 = icmp ult i64 %17, %19
br i1 %20, label %10, label %21
21: ; preds = %10, %7, %2
%22 = phi i32 [ 1, %2 ], [ 0, %7 ], [ 0, %10 ]
ret i32 %22
}