#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 */
unsigned int EOF;
int /*<<< orphan*/ FileIsDucked(int /*<<< orphan*/ *);
unsigned char FillBit(unsigned char, int, int);
int /*<<< orphan*/ MarkFileAsDucked(int /*<<< orphan*/ *);
int /*<<< orphan*/ PopulateKeyholeArray(int *, char *);
unsigned int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(unsigned char, int /*<<< orphan*/ *);
int getBitFromByte(int, unsigned int);
int *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int Duckfile(FILE *fptr_in, FILE *fptr_out) {
  char duck_key[64];
  srand(time(NULL));
  int ducking_mode = 0;
  if (!FileIsDucked(fptr_in)) {
    printf("\n[ENCRYPTING] Please specify the Ducking Key (do not lose this "
           "key): ");
    ducking_mode = 1;
  } else {
    printf(
        "\n[REVERSING] Please specify the Ducking Key to unduck this file: ");
  }
  scanf("%s", duck_key);
  if (ducking_mode) {
    MarkFileAsDucked(fptr_out);
  }
  printf("\n[ PROCESSING ] Ducking file right here right now..\n");
  int *keyholes = malloc(sizeof(int) * strlen(duck_key));
  PopulateKeyholeArray(keyholes, duck_key);
  int bytecount = 0;
  unsigned int block;
  unsigned char byte_ducked;
  while (block != EOF) {
    byte_ducked = 0x00;
    block = fgetc(fptr_in);
    if (block == EOF) {
      break;
    }
    int i = 0, j = 0;
    for (i = 1; i <= 8; i++) {
      bytecount += 1;
      int writebit = getBitFromByte(i, block);
      int FLIP_THIS_BIT = keyholes[j];
      if (FLIP_THIS_BIT) {
        byte_ducked = FillBit(byte_ducked, (writebit == 0 ? 1 : 0), i);
      } else {
        byte_ducked = FillBit(byte_ducked, writebit, i);
      }
      j = i;
      if (j > strlen(duck_key)) {
        j = 0;
      }
    }
    fputc(byte_ducked, fptr_out);
  }
  printf("\n");
  printf("%d Bytes Can Fly!\n", bytecount);
  return ducking_mode;
}


x86 assembly (clang, -O0):
<Duckfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
movl   $0x0,-0x54(%rbp)
mov    -0x8(%rbp),%rdi
call   10e0 <FileIsDucked@plt>
cmp    $0x0,%eax
jne    1226 <Duckfile+0x56>
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x54(%rbp)
jmp    1234 <Duckfile+0x64>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xe49(%rip),%rdi
call   10d0 <scanf@plt>
cmpl   $0x0,-0x54(%rbp)
je     1257 <Duckfile+0x87>
mov    -0x10(%rbp),%rdi
call   10c0 <MarkFileAsDucked@plt>
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1040 <strlen@plt>
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1060 <PopulateKeyholeArray@plt>
movl   $0x0,-0x64(%rbp)
mov    -0x68(%rbp),%eax
mov    0x2d4b(%rip),%rcx
cmp    (%rcx),%eax
je     13a4 <Duckfile+0x1d4>
movb   $0x0,-0x69(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%eax
mov    0x2d29(%rip),%rcx
cmp    (%rcx),%eax
jne    12cc <Duckfile+0xfc>
jmp    13a4 <Duckfile+0x1d4>
movl   $0x0,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
movl   $0x1,-0x70(%rbp)
cmpl   $0x8,-0x70(%rbp)
jg     1390 <Duckfile+0x1c0>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
mov    -0x70(%rbp),%edi
mov    -0x68(%rbp),%esi
call   10f0 <getBitFromByte@plt>
mov    %eax,-0x78(%rbp)
mov    -0x60(%rbp),%rax
movslq -0x74(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x7c(%rbp)
cmpl   $0x0,-0x7c(%rbp)
je     1340 <Duckfile+0x170>
mov    -0x69(%rbp),%al
mov    -0x78(%rbp),%edx
xor    %esi,%esi
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%esi
mov    -0x70(%rbp),%edx
movzbl %al,%edi
call   1030 <FillBit@plt>
mov    %al,-0x69(%rbp)
jmp    1354 <Duckfile+0x184>
mov    -0x69(%rbp),%al
mov    -0x78(%rbp),%esi
mov    -0x70(%rbp),%edx
movzbl %al,%edi
call   1030 <FillBit@plt>
mov    %al,-0x69(%rbp)
mov    -0x70(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0x80(%rbp)
lea    -0x50(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x80(%rbp),%eax
cmp    %ecx,%eax
jle    137d <Duckfile+0x1ad>
movl   $0x0,-0x74(%rbp)
jmp    1382 <Duckfile+0x1b2>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    12e1 <Duckfile+0x111>
mov    -0x69(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1080 <fputc@plt>
jmp    1293 <Duckfile+0xc3>
lea    0xd26(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x64(%rbp),%esi
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Duckfile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %edi,%edi
call   10c0 <time@plt>
mov    %eax,%edi
call   10b0 <srand@plt>
mov    %rbp,0x28(%rsp)
mov    %rbp,%rdi
call   1100 <FileIsDucked@plt>
test   %eax,%eax
je     124b <Duckfile+0x5b>
xor    %eax,%eax
mov    %rax,0x10(%rsp)
lea    0xe15(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe49(%rip),%rdi
lea    0x30(%rsp),%rsi
call   10f0 <scanf@plt>
jmp    127c <Duckfile+0x8c>
lea    0xdae(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe28(%rip),%rdi
lea    0x30(%rsp),%rsi
call   10f0 <scanf@plt>
mov    %rbx,%rdi
call   10e0 <MarkFileAsDucked@plt>
mov    $0x1,%eax
mov    %rax,0x10(%rsp)
lea    0xe1b(%rip),%rdi
call   1040 <puts@plt>
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
call   1060 <strlen@plt>
lea    0x0(,%rax,4),%edi
call   10d0 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %rbp,%rsi
call   1080 <PopulateKeyholeArray@plt>
xor    %ebp,%ebp
mov    0x2d30(%rip),%r14
lea    0xc(%r12),%rax
mov    %rax,0x18(%rsp)
mov    %rbx,0x20(%rsp)
nopw   0x0(%rax,%rax,1)
mov    0x28(%rsp),%rdi
call   1090 <fgetc@plt>
cmp    (%r14),%eax
je     14ff <Duckfile+0x30f>
mov    %eax,%r15d
mov    $0x1,%edi
mov    %eax,%esi
call   1110 <getBitFromByte@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
cmpl   $0x0,(%r12)
cmove  %eax,%esi
xor    %edi,%edi
mov    $0x1,%edx
call   1050 <FillBit@plt>
mov    %ebp,0xc(%rsp)
mov    %r14,%rbp
mov    %eax,%r14d
lea    0x30(%rsp),%r13
mov    %r13,%rdi
call   1060 <strlen@plt>
xor    %ebx,%ebx
test   %eax,%eax
setg   %bl
mov    $0x2,%edi
mov    %r15d,%esi
call   1110 <getBitFromByte@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
cmpl   $0x0,(%r12,%rbx,4)
cmove  %eax,%esi
movzbl %r14b,%edi
mov    %rbp,%r14
mov    $0x2,%edx
call   1050 <FillBit@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1060 <strlen@plt>
xor    %ebp,%ebp
cmp    $0x2,%eax
setge  %bpl
mov    $0x3,%edi
mov    %r15d,%esi
call   1110 <getBitFromByte@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
cmpl   $0x0,(%r12,%rbp,8)
cmove  %eax,%esi
movzbl %bl,%edi
mov    $0x3,%edx
call   1050 <FillBit@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
mov    $0x4,%edi
mov    %r15d,%esi
call   1110 <getBitFromByte@plt>
cmp    $0x3,%ebp
mov    0x18(%rsp),%rcx
cmovl  %r12,%rcx
xor    %esi,%esi
test   %eax,%eax
sete   %sil
cmpl   $0x0,(%rcx)
cmove  %eax,%esi
movzbl %bl,%edi
mov    $0x4,%edx
call   1050 <FillBit@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1060 <strlen@plt>
xor    %ebp,%ebp
cmp    $0x4,%eax
setge  %bpl
shl    $0x4,%rbp
mov    $0x5,%edi
mov    %r15d,%esi
call   1110 <getBitFromByte@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
cmpl   $0x0,(%r12,%rbp,1)
cmove  %eax,%esi
movzbl %bl,%edi
mov    $0x5,%edx
call   1050 <FillBit@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
mov    $0x6,%edi
mov    %r15d,%esi
call   1110 <getBitFromByte@plt>
lea    0x14(%r12),%rcx
cmp    $0x5,%ebp
cmovl  %r12,%rcx
xor    %esi,%esi
test   %eax,%eax
sete   %sil
cmpl   $0x0,(%rcx)
cmove  %eax,%esi
movzbl %bl,%edi
mov    $0x6,%edx
call   1050 <FillBit@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
mov    $0x7,%edi
mov    %r15d,%esi
call   1110 <getBitFromByte@plt>
lea    0x18(%r12),%rcx
cmp    $0x6,%ebp
cmovl  %r12,%rcx
xor    %esi,%esi
test   %eax,%eax
sete   %sil
cmpl   $0x0,(%rcx)
cmove  %eax,%esi
movzbl %bl,%edi
mov    $0x7,%edx
call   1050 <FillBit@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
mov    $0x8,%edi
mov    %r15d,%esi
call   1110 <getBitFromByte@plt>
lea    0x1c(%r12),%rcx
cmp    $0x7,%ebp
mov    0xc(%rsp),%ebp
cmovl  %r12,%rcx
xor    %esi,%esi
test   %eax,%eax
sete   %sil
cmpl   $0x0,(%rcx)
cmove  %eax,%esi
movzbl %bl,%edi
mov    $0x8,%edx
call   1050 <FillBit@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1060 <strlen@plt>
add    $0x8,%ebp
movzbl %bl,%edi
mov    0x20(%rsp),%rsi
call   10a0 <fputc@plt>
cmp    (%r14),%r15d
jne    12d0 <Duckfile+0xe0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xb7b(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x10(%rsp),%rax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [70 x i8] c"\0A[ENCRYPTING] Please specify the Ducking Key (do not lose this key): \00"
@.str.1 = [66 x i8] c"\0A[REVERSING] Please specify the Ducking Key to unduck this file: \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [53 x i8] c"\0A[ PROCESSING ] Ducking file right here right now..\0A\00"
@EOF = global i32 0
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [19 x i8] c"%d Bytes Can Fly!\0A\00"
define i32 @Duckfile(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [64 x i8]
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%15 = call i32 @time(i32* null)
%16 = call i32 @srand(i32 %15)
store i32 0, i32* %6
%17 = load i32*, i32** %3
%18 = call i32 @FileIsDucked(i32* %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %6
br label %24
22: ; preds = %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
%25 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %25)
%27 = load i32, i32* %6
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %24
%30 = load i32*, i32** %4
%31 = call i32 @MarkFileAsDucked(i32* %30)
br label %32
32: ; preds = %29, %24
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%34 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%35 = call i32 @strlen(i8* %34)
%36 = sext i32 %35 to i64
%37 = mul i64 4, %36
%38 = trunc i64 %37 to i32
%39 = call i32* @malloc(i32 %38)
store i32* %39, i32** %7
%40 = load i32*, i32** %7
%41 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%42 = call i32 @PopulateKeyholeArray(i32* %40, i8* %41)
store i32 0, i32* %8
br label %43
43: ; preds = %95, %32
%44 = load i32, i32* %9
%45 = load i32, i32* @EOF
%46 = icmp ne i32 %44, %45
br i1 %46, label %47, label %99
47: ; preds = %43
store i8 0, i8* %10
%48 = load i32*, i32** %3
%49 = call i32 @fgetc(i32* %48)
store i32 %49, i32* %9
%50 = load i32, i32* %9
%51 = load i32, i32* @EOF
%52 = icmp eq i32 %50, %51
br i1 %52, label %53, label %54
53: ; preds = %47
br label %99
54: ; preds = %47
store i32 0, i32* %11
store i32 0, i32* %12
store i32 1, i32* %11
br label %55
55: ; preds = %92, %54
%56 = load i32, i32* %11
%57 = icmp sle i32 %56, 8
br i1 %57, label %58, label %95
58: ; preds = %55
%59 = load i32, i32* %8
%60 = add nsw i32 %59, 1
store i32 %60, i32* %8
%61 = load i32, i32* %11
%62 = load i32, i32* %9
%63 = call i32 @getBitFromByte(i32 %61, i32 %62)
store i32 %63, i32* %13
%64 = load i32*, i32** %7
%65 = load i32, i32* %12
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i32, i32* %64, i64 %66
%68 = load i32, i32* %67
store i32 %68, i32* %14
%69 = load i32, i32* %14
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %79
71: ; preds = %58
%72 = load i8, i8* %10
%73 = load i32, i32* %13
%74 = icmp eq i32 %73, 0
%75 = zext i1 %74 to i64
%76 = select i1 %74, i32 1, i32 0
%77 = load i32, i32* %11
%78 = call zeroext i8 @FillBit(i8 zeroext %72, i32 %76, i32 %77)
store i8 %78, i8* %10
br label %84
79: ; preds = %58
%80 = load i8, i8* %10
%81 = load i32, i32* %13
%82 = load i32, i32* %11
%83 = call zeroext i8 @FillBit(i8 zeroext %80, i32 %81, i32 %82)
store i8 %83, i8* %10
br label %84
84: ; preds = %79, %71
%85 = load i32, i32* %11
store i32 %85, i32* %12
%86 = load i32, i32* %12
%87 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%88 = call i32 @strlen(i8* %87)
%89 = icmp sgt i32 %86, %88
br i1 %89, label %90, label %91
90: ; preds = %84
store i32 0, i32* %12
br label %91
91: ; preds = %90, %84
br label %92
92: ; preds = %91
%93 = load i32, i32* %11
%94 = add nsw i32 %93, 1
store i32 %94, i32* %11
br label %55
95: ; preds = %55
%96 = load i8, i8* %10
%97 = load i32*, i32** %4
%98 = call i32 @fputc(i8 zeroext %96, i32* %97)
br label %43
99: ; preds = %53, %43
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%101 = load i32, i32* %8
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %101)
%103 = load i32, i32* %6
ret i32 %103
}

LLVM IR (-O2):
@.str = [70 x i8] c"\0A[ENCRYPTING] Please specify the Ducking Key (do not lose this key): \00"
@.str.1 = [66 x i8] c"\0A[REVERSING] Please specify the Ducking Key to unduck this file: \00"
@.str.2 = [3 x i8] c"%s\00"
@EOF = global i32 0
@.str.5 = [19 x i8] c"%d Bytes Can Fly!\0A\00"
@str = [52 x i8] c"\0A[ PROCESSING ] Ducking file right here right now..\00"
define i32 @Duckfile(i32* %0, i32* %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @time(i32* null)
%6 = tail call i32 @srand(i32 %5)
%7 = tail call i32 @FileIsDucked(i32* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
br label %16
12: ; preds = %2
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%15 = call i32 @MarkFileAsDucked(i32* %1)
br label %16
16: ; preds = %12, %9
%17 = phi i32 [ 1, %12 ], [ 0, %9 ]
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%19 = call i32 @strlen(i8* %4)
%20 = shl i32 %19, 2
%21 = call i32* @malloc(i32 %20)
%22 = call i32 @PopulateKeyholeArray(i32* %21, i8* %4)
br label %23
23: ; preds = %16, %28
%24 = phi i32 [ %114, %28 ], [ 0, %16 ]
%25 = call i32 @fgetc(i32* %0)
%26 = load i32, i32* @EOF
%27 = icmp eq i32 %25, %26
br i1 %27, label %118, label %28
28: ; preds = %23
%29 = call i32 @getBitFromByte(i32 1, i32 %25)
%30 = load i32, i32* %21
%31 = icmp eq i32 %30, 0
%32 = icmp eq i32 %29, 0
%33 = zext i1 %32 to i32
%34 = select i1 %31, i32 %29, i32 %33
%35 = call zeroext i8 @FillBit(i8 zeroext 0, i32 %34, i32 1)
%36 = call i32 @strlen(i8* %4)
%37 = icmp sgt i32 %36, 0
%38 = call i32 @getBitFromByte(i32 2, i32 %25)
%39 = zext i1 %37 to i64
%40 = getelementptr inbounds i32, i32* %21, i64 %39
%41 = load i32, i32* %40
%42 = icmp eq i32 %41, 0
%43 = icmp eq i32 %38, 0
%44 = zext i1 %43 to i32
%45 = select i1 %42, i32 %38, i32 %44
%46 = call zeroext i8 @FillBit(i8 zeroext %35, i32 %45, i32 2)
%47 = call i32 @strlen(i8* %4)
%48 = icmp slt i32 %47, 2
%49 = select i1 %48, i64 0, i64 2
%50 = call i32 @getBitFromByte(i32 3, i32 %25)
%51 = getelementptr inbounds i32, i32* %21, i64 %49
%52 = load i32, i32* %51
%53 = icmp eq i32 %52, 0
%54 = icmp eq i32 %50, 0
%55 = zext i1 %54 to i32
%56 = select i1 %53, i32 %50, i32 %55
%57 = call zeroext i8 @FillBit(i8 zeroext %46, i32 %56, i32 3)
%58 = call i32 @strlen(i8* %4)
%59 = icmp slt i32 %58, 3
%60 = select i1 %59, i64 0, i64 3
%61 = call i32 @getBitFromByte(i32 4, i32 %25)
%62 = getelementptr inbounds i32, i32* %21, i64 %60
%63 = load i32, i32* %62
%64 = icmp eq i32 %63, 0
%65 = icmp eq i32 %61, 0
%66 = zext i1 %65 to i32
%67 = select i1 %64, i32 %61, i32 %66
%68 = call zeroext i8 @FillBit(i8 zeroext %57, i32 %67, i32 4)
%69 = call i32 @strlen(i8* %4)
%70 = icmp slt i32 %69, 4
%71 = select i1 %70, i64 0, i64 4
%72 = call i32 @getBitFromByte(i32 5, i32 %25)
%73 = getelementptr inbounds i32, i32* %21, i64 %71
%74 = load i32, i32* %73
%75 = icmp eq i32 %74, 0
%76 = icmp eq i32 %72, 0
%77 = zext i1 %76 to i32
%78 = select i1 %75, i32 %72, i32 %77
%79 = call zeroext i8 @FillBit(i8 zeroext %68, i32 %78, i32 5)
%80 = call i32 @strlen(i8* %4)
%81 = icmp slt i32 %80, 5
%82 = select i1 %81, i64 0, i64 5
%83 = call i32 @getBitFromByte(i32 6, i32 %25)
%84 = getelementptr inbounds i32, i32* %21, i64 %82
%85 = load i32, i32* %84
%86 = icmp eq i32 %85, 0
%87 = icmp eq i32 %83, 0
%88 = zext i1 %87 to i32
%89 = select i1 %86, i32 %83, i32 %88
%90 = call zeroext i8 @FillBit(i8 zeroext %79, i32 %89, i32 6)
%91 = call i32 @strlen(i8* %4)
%92 = icmp slt i32 %91, 6
%93 = select i1 %92, i64 0, i64 6
%94 = call i32 @getBitFromByte(i32 7, i32 %25)
%95 = getelementptr inbounds i32, i32* %21, i64 %93
%96 = load i32, i32* %95
%97 = icmp eq i32 %96, 0
%98 = icmp eq i32 %94, 0
%99 = zext i1 %98 to i32
%100 = select i1 %97, i32 %94, i32 %99
%101 = call zeroext i8 @FillBit(i8 zeroext %90, i32 %100, i32 7)
%102 = call i32 @strlen(i8* %4)
%103 = icmp slt i32 %102, 7
%104 = select i1 %103, i64 0, i64 7
%105 = call i32 @getBitFromByte(i32 8, i32 %25)
%106 = getelementptr inbounds i32, i32* %21, i64 %104
%107 = load i32, i32* %106
%108 = icmp eq i32 %107, 0
%109 = icmp eq i32 %105, 0
%110 = zext i1 %109 to i32
%111 = select i1 %108, i32 %105, i32 %110
%112 = call zeroext i8 @FillBit(i8 zeroext %101, i32 %111, i32 8)
%113 = call i32 @strlen(i8* %4)
%114 = add i32 %24, 8
%115 = call i32 @fputc(i8 zeroext %112, i32* %1)
%116 = load i32, i32* @EOF
%117 = icmp eq i32 %25, %116
br i1 %117, label %118, label %23
118: ; preds = %28, %23
%119 = phi i32 [ %114, %28 ], [ %24, %23 ]
%120 = call i32 @putchar(i32 10)
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %119)
ret i32 %17
}