#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*/ COM_MatchToken(char **, char *);
char *COM_Parse(char **);
float atof(char *);
void Parse1DMatrix(char **buf_p, int x, float *m) {
  char *token;
  int i;
  COM_MatchToken(buf_p, "(");
  for (i = 0; i < x; i++) {
    token = COM_Parse(buf_p);
    m[i] = atof(token);
  }
  COM_MatchToken(buf_p, ")");
}


x86 assembly (clang, -O0):
<Parse1DMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <COM_MatchToken@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1197 <Parse1DMatrix+0x67>
mov    -0x8(%rbp),%rdi
call   1040 <COM_Parse@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <atof@plt>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115a <Parse1DMatrix+0x2a>
mov    -0x8(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1050 <COM_MatchToken@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Parse1DMatrix>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%r15
lea    0xeba(%rip),%rsi
call   1050 <COM_MatchToken@plt>
test   %ebp,%ebp
jle    117f <Parse1DMatrix+0x4f>
mov    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
call   1040 <COM_Parse@plt>
mov    %rax,%rdi
call   1030 <atof@plt>
movss  %xmm0,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1160 <Parse1DMatrix+0x30>
lea    0xe7c(%rip),%rsi
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <COM_MatchToken@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c")\00"
define void @Parse1DMatrix(i8** %0, i32 %1, float* %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca float*
%7 = alloca i8*
%8 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
store float* %2, float** %6
%9 = load i8**, i8*** %4
%10 = call i32 @COM_MatchToken(i8** %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %8
br label %11
11: ; preds = %24, %3
%12 = load i32, i32* %8
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %27
15: ; preds = %11
%16 = load i8**, i8*** %4
%17 = call i8* @COM_Parse(i8** %16)
store i8* %17, i8** %7
%18 = load i8*, i8** %7
%19 = call float @atof(i8* %18)
%20 = load float*, float** %6
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float, float* %20, i64 %22
store float %19, float* %23
br label %24
24: ; preds = %15
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %11
27: ; preds = %11
%28 = load i8**, i8*** %4
%29 = call i32 @COM_MatchToken(i8** %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c")\00"
define void @Parse1DMatrix(i8** %0, i32 %1, float* nocapture writeonly %2) {
%4 = tail call i32 @COM_MatchToken(i8** %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = tail call i8* @COM_Parse(i8** %0)
%11 = tail call float @atof(i8* %10)
%12 = getelementptr inbounds float, float* %2, i64 %9
store float %11, float* %12
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %3
%16 = tail call i32 @COM_MatchToken(i8** %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}