#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*/ error1(char *, char *);
int read_n_columns(char *, int *, double ***);
int read_two_columns(char *arg, double **data1, double **data2) {
  int nrec, nc;
  double **dp;
  nrec = read_n_columns(arg, &nc, &dp);
  if (nc != 2)
    error1("number of columns in '%s' is not 2\n", arg);
  *data1 = dp[0];
  *data2 = dp[1];
  return nrec;
}


x86 assembly (clang, -O0):
<read_two_columns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1030 <read_n_columns@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x2,-0x20(%rbp)
je     1162 <read_two_columns+0x42>
mov    -0x8(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1040 <error1@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_two_columns>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1030 <read_n_columns@plt>
mov    %eax,%ebp
cmpl   $0x2,0xc(%rsp)
je     115a <read_two_columns+0x3a>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1040 <error1@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%rcx
mov    %rcx,(%r15)
mov    0x8(%rax),%rax
mov    %rax,(%r14)
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"number of columns in '%s' is not 2\0A\00"
define i32 @read_two_columns(i8* %0, double** %1, double** %2) {
%4 = alloca i8*
%5 = alloca double**
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
%9 = alloca double**
store i8* %0, i8** %4
store double** %1, double*** %5
store double** %2, double*** %6
%10 = load i8*, i8** %4
%11 = call i32 @read_n_columns(i8* %10, i32* %8, double*** %9)
store i32 %11, i32* %7
%12 = load i32, i32* %8
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = call i32 @error1(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %3
%18 = load double**, double*** %9
%19 = getelementptr inbounds double*, double** %18, i64 0
%20 = load double*, double** %19
%21 = load double**, double*** %5
store double* %20, double** %21
%22 = load double**, double*** %9
%23 = getelementptr inbounds double*, double** %22, i64 1
%24 = load double*, double** %23
%25 = load double**, double*** %6
store double* %24, double** %25
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
@.str = [36 x i8] c"number of columns in '%s' is not 2\0A\00"
define i32 @read_two_columns(i8* %0, double** nocapture writeonly %1, double** nocapture writeonly %2) {
%4 = alloca i32
%5 = alloca double**
%6 = bitcast i32* %4 to i8*
%7 = bitcast double*** %5 to i8*
%8 = call i32 @read_n_columns(i8* %0, i32* %4, double*** %5)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 2
br i1 %10, label %13, label %11
11: ; preds = %3
%12 = call i32 @error1(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %13
13: ; preds = %11, %3
%14 = load double**, double*** %5
%15 = load double*, double** %14
store double* %15, double** %1
%16 = getelementptr inbounds double*, double** %14, i64 1
%17 = load double*, double** %16
store double* %17, double** %2
ret i32 %8
}