#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 */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
double atof(char *);
int atoi(char *);
char getchar();
void read_data(char *C, int *I, double *D) {
  char buffer[26];
  *C = getchar();
  getchar();
  int j;
  for (j = 0; j < 2; j++) {
    int i;
    for (i = 0; i < sizeof(buffer) - 1; i++) {
      char current = getchar();
      if (current == '$')
        break;
      else
        buffer[i] = current;
    }
    buffer[i] = '\0';
    if (j == 0)
      *I = atoi(buffer);
    else
      *D = atof(buffer);
  }
  return;
}


x86 assembly (clang, -O0):
<read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <getchar@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x2,-0x44(%rbp)
jge    1207 <read_data+0xd7>
movl   $0x0,-0x48(%rbp)
movslq -0x48(%rbp),%rax
cmp    $0x19,%rax
jae    11ba <read_data+0x8a>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x49(%rbp)
movsbl -0x49(%rbp),%eax
cmp    $0x24,%eax
jne    119c <read_data+0x6c>
jmp    11ba <read_data+0x8a>
mov    -0x49(%rbp),%cl
movslq -0x48(%rbp),%rax
mov    %cl,-0x40(%rbp,%rax,1)
jmp    11ac <read_data+0x7c>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1172 <read_data+0x42>
movslq -0x48(%rbp),%rax
movb   $0x0,-0x40(%rbp,%rax,1)
cmpl   $0x0,-0x44(%rbp)
jne    11e3 <read_data+0xb3>
lea    -0x40(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    11f4 <read_data+0xc4>
lea    -0x40(%rbp),%rdi
call   1030 <atof@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    11f9 <read_data+0xc9>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1161 <read_data+0x31>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,(%rbx)
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x24,%al
je     117d <read_data+0x4d>
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x19,%rbx
jne    1160 <read_data+0x30>
mov    $0x19,%ebx
mov    %ebx,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %rsp,%rdi
call   1050 <atoi@plt>
mov    %eax,(%r15)
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x24,%al
je     11ad <read_data+0x7d>
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x19,%rbx
jne    1190 <read_data+0x60>
mov    $0x19,%ebx
mov    %ebx,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %rsp,%rdi
call   1030 <atof@plt>
movsd  %xmm0,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @read_data(i8* %0, i32* %1, double* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca double*
%7 = alloca [26 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store i8* %0, i8** %4
store i32* %1, i32** %5
store double* %2, double** %6
%11 = call signext i8 (...) @getchar()
%12 = load i8*, i8** %4
store i8 %11, i8* %12
%13 = call signext i8 (...) @getchar()
store i32 0, i32* %8
br label %14
14: ; preds = %52, %3
%15 = load i32, i32* %8
%16 = icmp slt i32 %15, 2
br i1 %16, label %17, label %55
17: ; preds = %14
store i32 0, i32* %9
br label %18
18: ; preds = %34, %17
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = icmp ult i64 %20, 25
br i1 %21, label %22, label %37
22: ; preds = %18
%23 = call signext i8 (...) @getchar()
store i8 %23, i8* %10
%24 = load i8, i8* %10
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 36
br i1 %26, label %27, label %28
27: ; preds = %22
br label %37
28: ; preds = %22
%29 = load i8, i8* %10
%30 = load i32, i32* %9
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [26 x i8], [26 x i8]* %7, i64 0, i64 %31
store i8 %29, i8* %32
br label %33
33: ; preds = %28
br label %34
34: ; preds = %33
%35 = load i32, i32* %9
%36 = add nsw i32 %35, 1
store i32 %36, i32* %9
br label %18
37: ; preds = %27, %18
%38 = load i32, i32* %9
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [26 x i8], [26 x i8]* %7, i64 0, i64 %39
store i8 0, i8* %40
%41 = load i32, i32* %8
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %37
%44 = getelementptr inbounds [26 x i8], [26 x i8]* %7, i64 0, i64 0
%45 = call i32 @atoi(i8* %44)
%46 = load i32*, i32** %5
store i32 %45, i32* %46
br label %51
47: ; preds = %37
%48 = getelementptr inbounds [26 x i8], [26 x i8]* %7, i64 0, i64 0
%49 = call double @atof(i8* %48)
%50 = load double*, double** %6
store double %49, double* %50
br label %51
51: ; preds = %47, %43
br label %52
52: ; preds = %51
%53 = load i32, i32* %8
%54 = add nsw i32 %53, 1
store i32 %54, i32* %8
br label %14
55: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @read_data(i8* nocapture writeonly %0, i32* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = alloca [26 x i8]
%5 = getelementptr inbounds [26 x i8], [26 x i8]* %4, i64 0, i64 0
%6 = tail call signext i8 (...) @getchar()
store i8 %6, i8* %0
%7 = tail call signext i8 (...) @getchar()
br label %8
8: ; preds = %3, %12
%9 = phi i64 [ 0, %3 ], [ %14, %12 ]
%10 = tail call signext i8 (...) @getchar()
%11 = icmp eq i8 %10, 36
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = getelementptr inbounds [26 x i8], [26 x i8]* %4, i64 0, i64 %9
store i8 %10, i8* %13
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, 25
br i1 %15, label %16, label %8
16: ; preds = %8, %12
%17 = phi i64 [ %9, %8 ], [ 25, %12 ]
%18 = and i64 %17, 4294967295
%19 = getelementptr inbounds [26 x i8], [26 x i8]* %4, i64 0, i64 %18
store i8 0, i8* %19
%20 = call i32 @atoi(i8* %5)
store i32 %20, i32* %1
br label %21
21: ; preds = %25, %16
%22 = phi i64 [ 0, %16 ], [ %27, %25 ]
%23 = tail call signext i8 (...) @getchar()
%24 = icmp eq i8 %23, 36
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = getelementptr inbounds [26 x i8], [26 x i8]* %4, i64 0, i64 %22
store i8 %23, i8* %26
%27 = add nuw nsw i64 %22, 1
%28 = icmp eq i64 %27, 25
br i1 %28, label %29, label %21
29: ; preds = %25, %21
%30 = phi i64 [ %22, %21 ], [ 25, %25 ]
%31 = and i64 %30, 4294967295
%32 = getelementptr inbounds [26 x i8], [26 x i8]* %4, i64 0, i64 %31
store i8 0, i8* %32
%33 = call double @atof(i8* %5)
store double %33, double* %2
ret void
}