#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 arccaesar(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, int *);
void aft_treat() {
  FILE *fp_worked;
  FILE *fp_source;
  int source_c, source_c1, source_c2;
  fp_worked = fopen("worked.txt", "r");
  fp_source = fopen("source.txt", "w");
  while (fscanf(fp_worked, "%d", &source_c) > 0) {
    source_c1 = source_c / 100;
    source_c2 = source_c % 100;
    fprintf(fp_source, "%c", arccaesar(source_c1));
    fprintf(fp_source, "%c", arccaesar(source_c2));
  }
  fclose(fp_source);
  fclose(fp_worked);
  fp_source = NULL;
  fp_worked = NULL;
}


x86 assembly (clang, -O0):
<aft_treat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xea1(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x8(%rbp)
lea    0xe97(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <fscanf@plt>
cmp    $0x0,%rax
jle    1209 <aft_treat+0xb9>
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%edi
call   1050 <arccaesar@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%edx
lea    0xe40(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
call   1050 <arccaesar@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%edx
lea    0xe1e(%rip),%rsi
call   1060 <fprintf@plt>
jmp    1186 <aft_treat+0x36>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aft_treat>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xe9c(%rip),%rdi
lea    0xea0(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r14
lea    0xe93(%rip),%rdi
lea    0xe97(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r13
lea    0xe8a(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
call   1040 <fscanf@plt>
test   %rax,%rax
jle    1201 <aft_treat+0xb1>
lea    0xe71(%rip),%r15
lea    0xc(%rsp),%r12
xchg   %ax,%ax
movslq 0xc(%rsp),%rbx
imul   $0x51eb851f,%rbx,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x25,%rdi
add    %eax,%edi
imul   $0x64,%edi,%eax
sub    %eax,%ebx
call   1060 <arccaesar@plt>
mov    %eax,%edi
mov    %r13,%rsi
call   1050 <fputc@plt>
mov    %ebx,%edi
call   1060 <arccaesar@plt>
mov    %eax,%edi
mov    %r13,%rsi
call   1050 <fputc@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <fscanf@plt>
test   %rax,%rax
jg     11b0 <aft_treat+0x60>
mov    %r13,%rdi
call   1030 <fclose@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"worked.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"source.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [3 x i8] c"%c\00"
define void @aft_treat() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %1
%7 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %7, i32** %2
br label %8
8: ; preds = %12, %0
%9 = load i32*, i32** %1
%10 = call i64 @fscanf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%11 = icmp sgt i64 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = load i32, i32* %3
%14 = sdiv i32 %13, 100
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = srem i32 %15, 100
store i32 %16, i32* %5
%17 = load i32*, i32** %2
%18 = load i32, i32* %4
%19 = call i32 @arccaesar(i32 %18)
%20 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %19)
%21 = load i32*, i32** %2
%22 = load i32, i32* %5
%23 = call i32 @arccaesar(i32 %22)
%24 = call i32 @fprintf(i32* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %23)
br label %8
25: ; preds = %8
%26 = load i32*, i32** %2
%27 = call i32 @fclose(i32* %26)
%28 = load i32*, i32** %1
%29 = call i32 @fclose(i32* %28)
store i32* null, i32** %2
store i32* null, i32** %1
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"worked.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"source.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [3 x i8] c"%d\00"
define void @aft_treat() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%5 = call i64 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %0, %7
%8 = load i32, i32* %1
%9 = sdiv i32 %8, 100
%10 = srem i32 %8, 100
%11 = call i32 @arccaesar(i32 %9)
%12 = call i32 @fputc(i32 %11, i32* %4)
%13 = call i32 @arccaesar(i32 %10)
%14 = call i32 @fputc(i32 %13, i32* %4)
%15 = call i64 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%16 = icmp sgt i64 %15, 0
br i1 %16, label %7, label %17
17: ; preds = %7, %0
%18 = call i32 @fclose(i32* %4)
%19 = call i32 @fclose(i32* %3)
ret void
}