#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*/ my_err(char *, char *, int, long);
char *strsep(char **, char *);
float util_parse_double(char *);
void impute_parse_geno_probs(float *geno_probs, char *cur, long n_sample) {
  long expect_n, i;
  char delim[] = " \t";
  char *tok;
  expect_n = n_sample * 3;
  i = 0;
  while ((tok = strsep(&cur, delim)) != NULL) {
    if (i >= expect_n) {
      my_err("%s:%d: more genotype_probs per row than expected (%ld)",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/bmvdgeijn/WASP/refs/heads/master/"
             "snp2h5/impute.c",
             114, expect_n);
    }
    geno_probs[i] = util_parse_double(tok);
    i++;
  }
  if (i != expect_n) {
    my_err("%s:%d: fewer genotype_probs (%ld) per row than expected (%ld)",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/bmvdgeijn/WASP/refs/heads/master/snp2h5/"
           "impute.c",
           122, expect_n);
  }
}


x86 assembly (clang, -O0):
<impute_parse_geno_probs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0x2b(%rbp)
mov    0xead(%rip),%al
mov    %al,-0x29(%rbp)
imul   $0x3,-0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
lea    -0x2b(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1030 <strsep@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     11d5 <impute_parse_geno_probs+0xa5>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jl     11ae <impute_parse_geno_probs+0x7e>
mov    -0x20(%rbp),%rcx
lea    0xe66(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0x72,%edx
call   1040 <my_err@plt>
mov    -0x38(%rbp),%rdi
call   1050 <util_parse_double@plt>
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1169 <impute_parse_geno_probs+0x39>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     11ff <impute_parse_geno_probs+0xcf>
mov    -0x20(%rbp),%rcx
lea    0xed7(%rip),%rdi
lea    0xe45(%rip),%rsi
mov    $0x7a,%edx
call   1040 <my_err@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<impute_parse_geno_probs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r14
mov    %rsi,0x10(%rsp)
movb   $0x0,0xe(%rsp)
movw   $0x920,0xc(%rsp)
lea    (%rdx,%rdx,2),%rbx
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <strsep@plt>
test   %rax,%rax
je     11c7 <impute_parse_geno_probs+0x97>
mov    %rax,%r13
xor    %ebp,%ebp
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
jmp    11a5 <impute_parse_geno_probs+0x75>
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1050 <util_parse_double@plt>
movss  %xmm0,(%r14,%rbp,4)
add    $0x1,%rbp
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <strsep@plt>
mov    %rax,%r13
test   %rax,%rax
je     11c9 <impute_parse_geno_probs+0x99>
cmp    %rbx,%rbp
jl     1180 <impute_parse_geno_probs+0x50>
lea    0xe52(%rip),%rdi
lea    0xe82(%rip),%rsi
mov    $0x72,%edx
mov    %rbx,%rcx
call   1040 <my_err@plt>
jmp    1180 <impute_parse_geno_probs+0x50>
xor    %ebp,%ebp
cmp    %rbx,%rbp
je     11e9 <impute_parse_geno_probs+0xb9>
lea    0xef0(%rip),%rdi
lea    0xe5e(%rip),%rsi
mov    $0x7a,%edx
mov    %rbx,%rcx
call   1040 <my_err@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.impute_parse_geno_probs.delim = [3 x i8] c" \09\00"
@.str = [55 x i8] c"%s:%d: more genotype_probs per row than expected (%ld)\00"
@.str.1 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bmvdgeijn/WASP/refs/heads/master/snp2h5/impute.c\00"
@.str.2 = [62 x i8] c"%s:%d: fewer genotype_probs (%ld) per row than expected (%ld)\00"
define void @impute_parse_geno_probs(float* %0, i8* %1, i64 %2) {
%4 = alloca float*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca [3 x i8]
%10 = alloca i8*
store float* %0, float** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%11 = bitcast [3 x i8]* %9 to i8*
%12 = load i64, i64* %6
%13 = mul nsw i64 %12, 3
store i64 %13, i64* %7
store i64 0, i64* %8
br label %14
14: ; preds = %25, %3
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 0
%16 = call i8* @strsep(i8** %5, i8* %15)
store i8* %16, i8** %10
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %33
18: ; preds = %14
%19 = load i64, i64* %8
%20 = load i64, i64* %7
%21 = icmp sge i64 %19, %20
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load i64, i64* %7
%24 = call i32 @my_err(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.1, i64 0, i64 0), i32 114, i64 %23)
br label %25
25: ; preds = %22, %18
%26 = load i8*, i8** %10
%27 = call float @util_parse_double(i8* %26)
%28 = load float*, float** %4
%29 = load i64, i64* %8
%30 = getelementptr inbounds float, float* %28, i64 %29
store float %27, float* %30
%31 = load i64, i64* %8
%32 = add nsw i64 %31, 1
store i64 %32, i64* %8
br label %14
33: ; preds = %14
%34 = load i64, i64* %8
%35 = load i64, i64* %7
%36 = icmp ne i64 %34, %35
br i1 %36, label %37, label %40
37: ; preds = %33
%38 = load i64, i64* %7
%39 = call i32 @my_err(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.1, i64 0, i64 0), i32 122, i64 %38)
br label %40
40: ; preds = %37, %33
ret void
}

LLVM IR (-O2):
@__const.impute_parse_geno_probs.delim = [3 x i8] c" \09\00"
@.str = [55 x i8] c"%s:%d: more genotype_probs per row than expected (%ld)\00"
@.str.1 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bmvdgeijn/WASP/refs/heads/master/snp2h5/impute.c\00"
@.str.2 = [62 x i8] c"%s:%d: fewer genotype_probs (%ld) per row than expected (%ld)\00"
define void @impute_parse_geno_probs(float* nocapture writeonly %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca [3 x i8]
store i8* %1, i8** %4
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%7 = mul nsw i64 %2, 3
%8 = call i8* @strsep(i8** %4, i8* %6)
%9 = icmp eq i8* %8, null
br i1 %9, label %22, label %10
10: ; preds = %3, %16
%11 = phi i8* [ %20, %16 ], [ %8, %3 ]
%12 = phi i64 [ %19, %16 ], [ 0, %3 ]
%13 = icmp slt i64 %12, %7
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = call i32 @my_err(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.1, i64 0, i64 0), i32 114, i64 %7)
br label %16
16: ; preds = %14, %10
%17 = call float @util_parse_double(i8* %11)
%18 = getelementptr inbounds float, float* %0, i64 %12
store float %17, float* %18
%19 = add nuw nsw i64 %12, 1
%20 = call i8* @strsep(i8** %4, i8* %6)
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %10
22: ; preds = %16, %3
%23 = phi i64 [ 0, %3 ], [ %19, %16 ]
%24 = icmp eq i64 %23, %7
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = call i32 @my_err(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.1, i64 0, i64 0), i32 122, i64 %7)
br label %27
27: ; preds = %25, %22
ret void
}