#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int fscanf(int /*<<< orphan*/ *, char *, char);
char *malloc(int);
char pow_2(int);
int /*<<< orphan*/ printf(char *);
void fread_Data_d(char *elements, char **codes) {
  char tmp = 0;
  char code = 0;
  char number_elements = 0;
  FILE *file_in = fopen("in.txt", "r");
  if (!file_in) {
    printf("error\n");
    exit(1);
  }
  if (fscanf(file_in, "%c", number_elements) != 1) {
    exit(0);
  }
  elements = malloc(sizeof(char) * number_elements);
  for (int i = 0; i < number_elements; i++) {
    fscanf(file_in, "%c", elements[i]);
  }
  int i = 0;
  while (i < number_elements) {
    fscanf(file_in, "%c", code);
    for (int j = 0; j < 8; j++) {
      if ((tmp = (code / pow_2(j) % 2)) == 1) {
      } else {
      }
    }
  }
}


x86 assembly (clang, -O0):
<fread_Data_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movb   $0x0,-0x13(%rbp)
lea    0xe7d(%rip),%rdi
lea    0xe7d(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11b4 <fread_Data_d+0x54>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x20(%rbp),%rdi
lea    0xe51(%rip),%rsi
movsbl -0x13(%rbp),%edx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     11d8 <fread_Data_d+0x78>
xor    %edi,%edi
call   1080 <exit@plt>
movsbq -0x13(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
movsbl -0x13(%rbp),%ecx
cmp    %ecx,%eax
jge    122c <fread_Data_d+0xcc>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
lea    0xdfb(%rip),%rsi
movsbl (%rax,%rcx,1),%edx
call   1050 <fscanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11f3 <fread_Data_d+0x93>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
movsbl -0x13(%rbp),%ecx
cmp    %ecx,%eax
jge    12bc <fread_Data_d+0x15c>
mov    -0x20(%rbp),%rdi
lea    0xdc3(%rip),%rsi
movsbl -0x12(%rbp),%edx
call   1050 <fscanf@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x8,-0x2c(%rbp)
jge    12b7 <fread_Data_d+0x157>
movsbl -0x12(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%edi
call   1040 <pow_2@plt>
mov    %al,%cl
mov    -0x30(%rbp),%eax
movsbl %cl,%ecx
cltd
idiv   %ecx
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x1,%eax
jne    129f <fread_Data_d+0x13f>
jmp    12a4 <fread_Data_d+0x144>
jmp    12a4 <fread_Data_d+0x144>
jmp    12a9 <fread_Data_d+0x149>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    125d <fread_Data_d+0xfd>
jmp    1233 <fread_Data_d+0xd3>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fread_Data_d>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1171 <fread_Data_d+0x31>
lea    0xea7(%rip),%rsi
mov    %rax,%rdi
xor    %edx,%edx
call   1040 <fscanf@plt>
cmp    $0x1,%eax
jne    1187 <fread_Data_d+0x47>
pop    %rax
ret
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
xor    %edi,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"in.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"%c\00"
@str = [6 x i8] c"error\00"
define void @fread_Data_d(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8 signext 0)
%10 = icmp eq i32 %9, 1
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %8
ret void
}