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

/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ stdin;
unsigned int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char **argv) {
  char line[1024];
  char *orig;
  char *subst;
  unsigned int i;
  while (fgets(line, sizeof(line), stdin)) {
    line[strlen(line) - 1] = '\0';
    if (strncmp(line, "proxy_passwd=", 13)) {
      printf("%s\n", line);
    } else {
      orig = line + 13;
      for (i = 0; i < strlen(orig); i++) {
        subst = orig + i;
        *subst += 100;
      }
      printf("proxy_passwd=%s%c\n", orig, 0xae);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     126f <main+0x12f>
lea    -0x410(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
mov    %eax,%eax
movb   $0x0,-0x410(%rbp,%rax,1)
lea    -0x410(%rbp),%rdi
lea    0xe5c(%rip),%rsi
mov    $0xd,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     11d2 <main+0x92>
lea    -0x410(%rbp),%rsi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    126a <main+0x12a>
lea    -0x410(%rbp),%rax
add    $0xd,%rax
mov    %rax,-0x418(%rbp)
movl   $0x0,-0x424(%rbp)
mov    -0x424(%rbp),%eax
mov    %eax,-0x428(%rbp)
mov    -0x418(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x428(%rbp),%eax
cmp    %ecx,%eax
jae    1250 <main+0x110>
mov    -0x418(%rbp),%rax
mov    -0x424(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x420(%rbp)
mov    -0x420(%rbp),%rax
movsbl (%rax),%ecx
add    $0x64,%ecx
mov    %cl,(%rax)
mov    -0x424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x424(%rbp)
jmp    11ee <main+0xae>
mov    -0x418(%rbp),%rsi
lea    0xdb4(%rip),%rdi
mov    $0xae,%edx
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1159 <main+0x19>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    0x2e90(%rip),%rbp
mov    0x0(%rbp),%edx
mov    %rsp,%rdi
mov    $0x400,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     1224 <main+0xe4>
lea    0xd(%rsp),%rbx
mov    %rsp,%r14
lea    0xe80(%rip),%r15
lea    0xe87(%rip),%r13
jmp    11b2 <main+0x72>
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%rbp),%edx
mov    %r14,%rdi
mov    $0x400,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     1224 <main+0xe4>
mov    %r14,%rdi
call   1040 <strlen@plt>
add    $0xffffffff,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0xd,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1190 <main+0x50>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
je     1209 <main+0xc9>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
addb   $0x64,0xd(%rsp,%r12,1)
add    $0x1,%r12
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%r12
jb     11f0 <main+0xb0>
lea    0xe02(%rip),%rdi
mov    %rbx,%rsi
mov    $0xae,%edx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    119d <main+0x5d>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [14 x i8] c"proxy_passwd=\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [19 x i8] c"proxy_passwd=%s%c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %10
10: ; preds = %51, %2
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%12 = load i32, i32* @stdin
%13 = call i64 @fgets(i8* %11, i32 1024, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %52
15: ; preds = %10
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%17 = call i32 @strlen(i8* %16)
%18 = sub i32 %17, 1
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 %19
store i8 0, i8* %20
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%22 = call i64 @strncmp(i8* %21, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %15
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%26 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %25)
br label %51
27: ; preds = %15
%28 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%29 = getelementptr inbounds i8, i8* %28, i64 13
store i8* %29, i8** %7
store i32 0, i32* %9
br label %30
30: ; preds = %45, %27
%31 = load i32, i32* %9
%32 = load i8*, i8** %7
%33 = call i32 @strlen(i8* %32)
%34 = icmp ult i32 %31, %33
br i1 %34, label %35, label %48
35: ; preds = %30
%36 = load i8*, i8** %7
%37 = load i32, i32* %9
%38 = zext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
store i8* %39, i8** %8
%40 = load i8*, i8** %8
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = add nsw i32 %42, 100
%44 = trunc i32 %43 to i8
store i8 %44, i8* %40
br label %45
45: ; preds = %35
%46 = load i32, i32* %9
%47 = add i32 %46, 1
store i32 %47, i32* %9
br label %30
48: ; preds = %30
%49 = load i8*, i8** %7
%50 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %49, i32 174)
br label %51
51: ; preds = %48, %24
br label %10
52: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [14 x i8] c"proxy_passwd=\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [19 x i8] c"proxy_passwd=%s%c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i64 @fgets(i8* %4, i32 1024, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %37, label %8
8: ; preds = %2
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 13
br label %10
10: ; preds = %8, %33
%11 = call i32 @strlen(i8* %4)
%12 = add i32 %11, -1
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %13
store i8 0, i8* %14
%15 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%16 = icmp eq i64 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %10
%18 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %33
19: ; preds = %10
%20 = call i32 @strlen(i8* %9)
%21 = icmp eq i32 %20, 0
br i1 %21, label %31, label %22
22: ; preds = %19, %22
%23 = phi i64 [ %27, %22 ], [ 0, %19 ]
%24 = getelementptr inbounds i8, i8* %9, i64 %23
%25 = load i8, i8* %24
%26 = add i8 %25, 100
store i8 %26, i8* %24
%27 = add nuw nsw i64 %23, 1
%28 = call i32 @strlen(i8* %9)
%29 = zext i32 %28 to i64
%30 = icmp ult i64 %27, %29
br i1 %30, label %22, label %31
31: ; preds = %22, %19
%32 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %9, i32 174)
br label %33
33: ; preds = %31, %17
%34 = load i32, i32* @stdin
%35 = call i64 @fgets(i8* %4, i32 1024, i32 %34)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %10
37: ; preds = %33, %2
ret i32 0
}