#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*/ sscanf(char *, char *, float *);
void dnaMark2Deserialize(char *buf, double mark2[5][5][5]) {
  int i, j, k;
  int offset = 0;
  for (i = 0; i < 5; i++)
    for (j = 0; j < 5; j++)
      for (k = 0; k < 5; k++) {
        float f;
        if (offset) {
          sscanf(buf + offset, ";%f", &f);
          mark2[i][j][k] = f;
          offset += (10 + 3);
        } else {
          sscanf(buf + offset, "%f", &f);
          mark2[i][j][k] = f;
          offset += (10 + 2);
        }
      }
}


x86 assembly (clang, -O0):
<dnaMark2Deserialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1248 <dnaMark2Deserialize+0x138>
movl   $0x0,-0x18(%rbp)
cmpl   $0x5,-0x18(%rbp)
jge    1235 <dnaMark2Deserialize+0x125>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x5,-0x1c(%rbp)
jge    1222 <dnaMark2Deserialize+0x112>
cmpl   $0x0,-0x20(%rbp)
je     11bc <dnaMark2Deserialize+0xac>
mov    -0x8(%rbp),%rdi
movslq -0x20(%rbp),%rax
add    %rax,%rdi
lea    0xe8a(%rip),%rsi
lea    -0x24(%rbp),%rdx
call   1030 <sscanf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0xc8,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0xd,%eax
mov    %eax,-0x20(%rbp)
jmp    120f <dnaMark2Deserialize+0xff>
mov    -0x8(%rbp),%rdi
movslq -0x20(%rbp),%rax
add    %rax,%rdi
lea    0xe33(%rip),%rsi
lea    -0x24(%rbp),%rdx
call   1030 <sscanf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0xc8,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0x20(%rbp)
jmp    1214 <dnaMark2Deserialize+0x104>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1150 <dnaMark2Deserialize+0x40>
jmp    1227 <dnaMark2Deserialize+0x117>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113f <dnaMark2Deserialize+0x2f>
jmp    123a <dnaMark2Deserialize+0x12a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <dnaMark2Deserialize+0x1e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnaMark2Deserialize>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r13
mov    %rdi,%r12
xor    %eax,%eax
lea    0x4(%rsp),%r14
xor    %r15d,%r15d
mov    %rdi,0x8(%rsp)
jmp    115a <dnaMark2Deserialize+0x4a>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x10(%rsp),%rax
add    $0x1,%rax
add    $0xc8,%r13
cmp    $0x5,%rax
je     135b <dnaMark2Deserialize+0x24b>
mov    %rax,0x10(%rsp)
xor    %ebp,%ebp
jmp    11d5 <dnaMark2Deserialize+0xc5>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x8(%rsp),%r12
mov    %r12,%rdi
lea    0xe82(%rip),%rsi
mov    %r14,%rdx
call   1030 <sscanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x18(%r13,%rbp,1)
mov    $0xc,%ebx
mov    %r15,%rsi
movslq %ebx,%r15
lea    (%r12,%r15,1),%rdi
mov    %r14,%rdx
call   1030 <sscanf@plt>
add    $0xd,%r15d
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x20(%r13,%rbp,1)
add    $0x28,%rbp
cmp    $0xc8,%rbp
je     1140 <dnaMark2Deserialize+0x30>
test   %r15d,%r15d
je     1240 <dnaMark2Deserialize+0x130>
movslq %r15d,%rdi
add    %r12,%rdi
lea    0xe19(%rip),%r12
mov    %r12,%rsi
mov    %r14,%rdx
call   1030 <sscanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x0(%r13,%rbp,1)
add    $0xd,%r15d
jne    1270 <dnaMark2Deserialize+0x160>
mov    0x8(%rsp),%rdi
lea    0xdec(%rip),%rsi
mov    %r14,%rdx
call   1030 <sscanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%r13,%rbp,1)
mov    $0xc,%ebx
mov    %r12,%r15
jmp    12a0 <dnaMark2Deserialize+0x190>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
lea    0xdb7(%rip),%rsi
mov    %r14,%rdx
call   1030 <sscanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x0(%r13,%rbp,1)
mov    $0xc,%r15d
lea    0xd90(%rip),%r12
movslq %r15d,%rbx
mov    0x8(%rsp),%rax
lea    (%rax,%rbx,1),%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1030 <sscanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%r13,%rbp,1)
add    $0xd,%ebx
mov    %r12,%r15
je     12e0 <dnaMark2Deserialize+0x1d0>
movslq %ebx,%rbx
mov    0x8(%rsp),%rax
lea    (%rax,%rbx,1),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <sscanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%r13,%rbp,1)
add    $0xd,%ebx
jne    130a <dnaMark2Deserialize+0x1fa>
jmp    1170 <dnaMark2Deserialize+0x60>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x8(%rsp),%rdi
lea    0xd15(%rip),%rsi
mov    %r14,%rdx
call   1030 <sscanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%r13,%rbp,1)
mov    $0xc,%ebx
movslq %ebx,%rbx
mov    0x8(%rsp),%r12
lea    (%r12,%rbx,1),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <sscanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x18(%r13,%rbp,1)
add    $0xd,%ebx
mov    %r15,%rsi
jne    11a0 <dnaMark2Deserialize+0x90>
mov    %r12,%rdi
lea    0xcb9(%rip),%rsi
mov    %r14,%rdx
call   1030 <sscanf@plt>
mov    $0xc,%r15d
jmp    11b3 <dnaMark2Deserialize+0xa3>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c";%f\00"
@.str.1 = [3 x i8] c"%f\00"
define void @dnaMark2Deserialize(i8* %0, [5 x [5 x double]]* %1) {
%3 = alloca i8*
%4 = alloca [5 x [5 x double]]*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
store i8* %0, i8** %3
store [5 x [5 x double]]* %1, [5 x [5 x double]]** %4
store i32 0, i32* %8
store i32 0, i32* %5
br label %10
10: ; preds = %73, %2
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %76
13: ; preds = %10
store i32 0, i32* %6
br label %14
14: ; preds = %69, %13
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 5
br i1 %16, label %17, label %72
17: ; preds = %14
store i32 0, i32* %7
br label %18
18: ; preds = %65, %17
%19 = load i32, i32* %7
%20 = icmp slt i32 %19, 5
br i1 %20, label %21, label %68
21: ; preds = %18
%22 = load i32, i32* %8
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %44
24: ; preds = %21
%25 = load i8*, i8** %3
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = call i32 @sscanf(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float* %9)
%30 = load float, float* %9
%31 = fpext float %30 to double
%32 = load [5 x [5 x double]]*, [5 x [5 x double]]** %4
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %32, i64 %34
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %35, i64 0, i64 %37
%39 = load i32, i32* %7
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [5 x double], [5 x double]* %38, i64 0, i64 %40
store double %31, double* %41
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 13
store i32 %43, i32* %8
br label %64
44: ; preds = %21
%45 = load i8*, i8** %3
%46 = load i32, i32* %8
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %45, i64 %47
%49 = call i32 @sscanf(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %9)
%50 = load float, float* %9
%51 = fpext float %50 to double
%52 = load [5 x [5 x double]]*, [5 x [5 x double]]** %4
%53 = load i32, i32* %5
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %52, i64 %54
%56 = load i32, i32* %6
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %55, i64 0, i64 %57
%59 = load i32, i32* %7
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [5 x double], [5 x double]* %58, i64 0, i64 %60
store double %51, double* %61
%62 = load i32, i32* %8
%63 = add nsw i32 %62, 12
store i32 %63, i32* %8
br label %64
64: ; preds = %44, %24
br label %65
65: ; preds = %64
%66 = load i32, i32* %7
%67 = add nsw i32 %66, 1
store i32 %67, i32* %7
br label %18
68: ; preds = %18
br label %69
69: ; preds = %68
%70 = load i32, i32* %6
%71 = add nsw i32 %70, 1
store i32 %71, i32* %6
br label %14
72: ; preds = %14
br label %73
73: ; preds = %72
%74 = load i32, i32* %5
%75 = add nsw i32 %74, 1
store i32 %75, i32* %5
br label %10
76: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c";%f\00"
@.str.1 = [3 x i8] c"%f\00"
define void @dnaMark2Deserialize(i8* nocapture %0, [5 x [5 x double]]* nocapture writeonly %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
br label %5
5: ; preds = %2, %86
%6 = phi i64 [ 0, %2 ], [ %87, %86 ]
%7 = phi i32 [ 0, %2 ], [ %80, %86 ]
br label %8
8: ; preds = %5, %79
%9 = phi i64 [ 0, %5 ], [ %84, %79 ]
%10 = phi i32 [ %7, %5 ], [ %80, %79 ]
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %1, i64 %6, i64 %9, i64 0
store double %15, double* %16
br label %31
17: ; preds = %8
%18 = sext i32 %10 to i64
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = call i32 @sscanf(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float* %3)
%21 = add nsw i32 %10, 13
%22 = load float, float* %3
%23 = fpext float %22 to double
%24 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %1, i64 %6, i64 %9, i64 0
store double %23, double* %24
%25 = icmp eq i32 %21, 0
br i1 %25, label %26, label %31
26: ; preds = %17
%27 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%28 = load float, float* %3
%29 = fpext float %28 to double
%30 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %1, i64 %6, i64 %9, i64 1
store double %29, double* %30
br label %46
31: ; preds = %17, %12
%32 = phi i32 [ 12, %12 ], [ %21, %17 ]
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %0, i64 %33
%35 = call i32 @sscanf(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float* %3)
%36 = add nsw i32 %32, 13
%37 = load float, float* %3
%38 = fpext float %37 to double
%39 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %1, i64 %6, i64 %9, i64 1
store double %38, double* %39
%40 = icmp eq i32 %36, 0
br i1 %40, label %41, label %46
41: ; preds = %31
%42 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%43 = load float, float* %3
%44 = fpext float %43 to double
%45 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %1, i64 %6, i64 %9, i64 2
store double %44, double* %45
br label %61
46: ; preds = %31, %26
%47 = phi i32 [ 12, %26 ], [ %36, %31 ]
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %0, i64 %48
%50 = call i32 @sscanf(i8* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float* %3)
%51 = add nsw i32 %47, 13
%52 = load float, float* %3
%53 = fpext float %52 to double
%54 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %1, i64 %6, i64 %9, i64 2
store double %53, double* %54
%55 = icmp eq i32 %51, 0
br i1 %55, label %56, label %61
56: ; preds = %46
%57 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%58 = load float, float* %3
%59 = fpext float %58 to double
%60 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %1, i64 %6, i64 %9, i64 3
store double %59, double* %60
br label %71
61: ; preds = %46, %41
%62 = phi i32 [ 12, %41 ], [ %51, %46 ]
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %0, i64 %63
%65 = call i32 @sscanf(i8* %64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float* %3)
%66 = add nsw i32 %62, 13
%67 = load float, float* %3
%68 = fpext float %67 to double
%69 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %1, i64 %6, i64 %9, i64 3
store double %68, double* %69
%70 = icmp eq i32 %66, 0
br i1 %70, label %77, label %71
71: ; preds = %56, %61
%72 = phi i32 [ 12, %56 ], [ %66, %61 ]
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %0, i64 %73
%75 = call i32 @sscanf(i8* %74, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float* %3)
%76 = add nsw i32 %72, 13
br label %79
77: ; preds = %61
%78 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
br label %79
79: ; preds = %77, %71
%80 = phi i32 [ %76, %71 ], [ 12, %77 ]
%81 = load float, float* %3
%82 = fpext float %81 to double
%83 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %1, i64 %6, i64 %9, i64 4
store double %82, double* %83
%84 = add nuw nsw i64 %9, 1
%85 = icmp eq i64 %84, 5
br i1 %85, label %86, label %8
86: ; preds = %79
%87 = add nuw nsw i64 %6, 1
%88 = icmp eq i64 %87, 5
br i1 %88, label %89, label %5
89: ; preds = %86
ret void
}