#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 EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ sub(char *, char *, char *);
int main(int argc, char **argv) {
  FILE *f;
  char *buf, *p;
  int c;
  if (argc != 2) {
    fprintf(stderr, "usage: poconv po-file\n\n");
    return 1;
  }
  f = fopen(argv[1], "r");
  buf = (char *)malloc(500000);
  p = buf;
  for (;;) {
    c = fgetc(f);
    if (c == EOF)
      break;
    *p = (char)c;
    ++p;
  }
  *p = 0;
  fclose(f);
  sub(buf, "\302\200", "#L#");
  sub(buf, "\302\201", "#M#");
  sub(buf, "\302\202", "#S#");
  sub(buf, "\302\203", "#B#");
  sub(buf, "\302\204", "#K#");
  sub(buf, "\200", "#L#");
  sub(buf, "\201", "#M#");
  sub(buf, "\202", "#S#");
  sub(buf, "\203", "#B#");
  sub(buf, "\204", "#K#");
  sub(buf, "bergo@seul.org", "fbergo@gmail.com");
  f = fopen(argv[1], "w");
  for (p = buf; *p != 0; p++)
    fputc(*p, f);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11b1 <main+0x41>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
lea    0xe60(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    138e <main+0x21e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe58(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    $0x7a120,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2df3(%rip),%rcx
cmp    (%rcx),%eax
jne    1202 <main+0x92>
jmp    121e <main+0xae>
mov    -0x2c(%rbp),%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11df <main+0x6f>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
lea    0xde1(%rip),%rsi
lea    0xddd(%rip),%rdx
call   1090 <sub@plt>
mov    -0x20(%rbp),%rdi
lea    0xdd1(%rip),%rsi
lea    0xdcd(%rip),%rdx
call   1090 <sub@plt>
mov    -0x20(%rbp),%rdi
lea    0xdc1(%rip),%rsi
lea    0xdbd(%rip),%rdx
call   1090 <sub@plt>
mov    -0x20(%rbp),%rdi
lea    0xdb1(%rip),%rsi
lea    0xdad(%rip),%rdx
call   1090 <sub@plt>
mov    -0x20(%rbp),%rdi
lea    0xda1(%rip),%rsi
lea    0xd9d(%rip),%rdx
call   1090 <sub@plt>
mov    -0x20(%rbp),%rdi
lea    0xd6f(%rip),%rsi
lea    0xd6a(%rip),%rdx
call   1090 <sub@plt>
mov    -0x20(%rbp),%rdi
lea    0xd5f(%rip),%rsi
lea    0xd5a(%rip),%rdx
call   1090 <sub@plt>
mov    -0x20(%rbp),%rdi
lea    0xd4f(%rip),%rsi
lea    0xd4a(%rip),%rdx
call   1090 <sub@plt>
mov    -0x20(%rbp),%rdi
lea    0xd3f(%rip),%rsi
lea    0xd3a(%rip),%rdx
call   1090 <sub@plt>
mov    -0x20(%rbp),%rdi
lea    0xd2f(%rip),%rsi
lea    0xd2a(%rip),%rdx
call   1090 <sub@plt>
mov    -0x20(%rbp),%rdi
lea    0xd1e(%rip),%rsi
lea    0xd26(%rip),%rdx
call   1090 <sub@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd23(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     137e <main+0x20e>
mov    -0x28(%rbp),%rax
mov    (%rax),%al
mov    -0x18(%rbp),%rsi
movsbl %al,%edi
call   1050 <fputc@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    134b <main+0x1db>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    1324 <main+0x1b4>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
lea    0xe86(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r15
mov    $0x7a120,%edi
call   1070 <malloc@plt>
mov    %rax,%r12
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    0x2e32(%rip),%rbp
mov    %r12,%rbx
cmp    0x0(%rbp),%eax
je     11e3 <main+0x73>
mov    %r12,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %al,(%rbx)
add    $0x1,%rbx
mov    %r15,%rdi
call   1040 <fgetc@plt>
cmp    0x0(%rbp),%eax
jne    11d0 <main+0x60>
movb   $0x0,(%rbx)
mov    %r15,%rdi
call   1030 <fclose@plt>
lea    0xe25(%rip),%rsi
lea    0xe21(%rip),%rdx
mov    %r12,%rdi
call   1090 <sub@plt>
lea    0xe16(%rip),%rsi
lea    0xe12(%rip),%rbx
mov    %r12,%rdi
mov    %rbx,%rdx
call   1090 <sub@plt>
lea    0xe04(%rip),%rsi
lea    0xe00(%rip),%r13
mov    %r12,%rdi
mov    %r13,%rdx
call   1090 <sub@plt>
lea    0xdf2(%rip),%rsi
lea    0xdee(%rip),%rbp
mov    %r12,%rdi
mov    %rbp,%rdx
call   1090 <sub@plt>
lea    0xde0(%rip),%rsi
lea    0xddc(%rip),%r15
mov    %r12,%rdi
mov    %r15,%rdx
call   1090 <sub@plt>
lea    0xdac(%rip),%rsi
mov    %r12,%rdi
lea    0xda4(%rip),%rdx
call   1090 <sub@plt>
lea    0xd9d(%rip),%rsi
mov    %r12,%rdi
mov    %rbx,%rdx
call   1090 <sub@plt>
lea    0xd92(%rip),%rsi
mov    %r12,%rdi
mov    %r13,%rdx
call   1090 <sub@plt>
lea    0xd87(%rip),%rsi
mov    %r12,%rdi
mov    %rbp,%rdx
call   1090 <sub@plt>
lea    0xd7c(%rip),%rsi
mov    %r12,%rdi
mov    %r15,%rdx
call   1090 <sub@plt>
lea    0xd70(%rip),%rsi
lea    0xd78(%rip),%rdx
mov    %r12,%rdi
call   1090 <sub@plt>
mov    0x8(%r14),%rdi
lea    0xd76(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbp
mov    (%r12),%al
test   %al,%al
je     1318 <main+0x1a8>
add    $0x1,%r12
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
mov    %rbp,%rsi
call   1050 <fputc@plt>
movzbl (%r12),%eax
add    $0x1,%r12
test   %al,%al
jne    1300 <main+0x190>
mov    %rbp,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    133e <main+0x1ce>
mov    0x2cad(%rip),%rax
mov    (%rax),%edi
lea    0xccc(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"usage: poconv po-file\0A\0A\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i32 0
@.str.2 = [3 x i8] c"\C2\80\00"
@.str.3 = [4 x i8] c"#L#\00"
@.str.4 = [3 x i8] c"\C2\81\00"
@.str.5 = [4 x i8] c"#M#\00"
@.str.6 = [3 x i8] c"\C2\82\00"
@.str.7 = [4 x i8] c"#S#\00"
@.str.8 = [3 x i8] c"\C2\83\00"
@.str.9 = [4 x i8] c"#B#\00"
@.str.10 = [3 x i8] c"\C2\84\00"
@.str.11 = [4 x i8] c"#K#\00"
@.str.12 = [2 x i8] c"\80\00"
@.str.13 = [2 x i8] c"\81\00"
@.str.14 = [2 x i8] c"\82\00"
@.str.15 = [2 x i8] c"\83\00"
@.str.16 = [2 x i8] c"\84\00"
@.str.17 = [15 x i8] c"bergo@seul.org\00"
@.str.18 = [17 x i8] c"fbergo@gmail.com\00"
@.str.19 = [2 x i8] c"w\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %83
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %19, i32** %6
%20 = call i64 @malloc(i32 500000)
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %7
%22 = load i8*, i8** %7
store i8* %22, i8** %8
br label %23
23: ; preds = %30, %15
%24 = load i32*, i32** %6
%25 = call i32 @fgetc(i32* %24)
store i32 %25, i32* %9
%26 = load i32, i32* %9
%27 = load i32, i32* @EOF
%28 = icmp eq i32 %26, %27
br i1 %28, label %29, label %30
29: ; preds = %23
br label %36
30: ; preds = %23
%31 = load i32, i32* %9
%32 = trunc i32 %31 to i8
%33 = load i8*, i8** %8
store i8 %32, i8* %33
%34 = load i8*, i8** %8
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %8
br label %23
36: ; preds = %29
%37 = load i8*, i8** %8
store i8 0, i8* %37
%38 = load i32*, i32** %6
%39 = call i32 @fclose(i32* %38)
%40 = load i8*, i8** %7
%41 = call i32 @sub(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%42 = load i8*, i8** %7
%43 = call i32 @sub(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%44 = load i8*, i8** %7
%45 = call i32 @sub(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%46 = load i8*, i8** %7
%47 = call i32 @sub(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%48 = load i8*, i8** %7
%49 = call i32 @sub(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%50 = load i8*, i8** %7
%51 = call i32 @sub(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%52 = load i8*, i8** %7
%53 = call i32 @sub(i8* %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%54 = load i8*, i8** %7
%55 = call i32 @sub(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%56 = load i8*, i8** %7
%57 = call i32 @sub(i8* %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%58 = load i8*, i8** %7
%59 = call i32 @sub(i8* %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%60 = load i8*, i8** %7
%61 = call i32 @sub(i8* %60, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0))
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 1
%64 = load i8*, i8** %63
%65 = call i32* @fopen(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
store i32* %65, i32** %6
%66 = load i8*, i8** %7
store i8* %66, i8** %8
br label %67
67: ; preds = %77, %36
%68 = load i8*, i8** %8
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %80
72: ; preds = %67
%73 = load i8*, i8** %8
%74 = load i8, i8* %73
%75 = load i32*, i32** %6
%76 = call i32 @fputc(i8 signext %74, i32* %75)
br label %77
77: ; preds = %72
%78 = load i8*, i8** %8
%79 = getelementptr inbounds i8, i8* %78, i32 1
store i8* %79, i8** %8
br label %67
80: ; preds = %67
%81 = load i32*, i32** %6
%82 = call i32 @fclose(i32* %81)
store i32 0, i32* %3
br label %83
83: ; preds = %80, %12
%84 = load i32, i32* %3
ret i32 %84
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"usage: poconv po-file\0A\0A\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i32 0
@.str.2 = [3 x i8] c"\C2\80\00"
@.str.3 = [4 x i8] c"#L#\00"
@.str.4 = [3 x i8] c"\C2\81\00"
@.str.5 = [4 x i8] c"#M#\00"
@.str.6 = [3 x i8] c"\C2\82\00"
@.str.7 = [4 x i8] c"#S#\00"
@.str.8 = [3 x i8] c"\C2\83\00"
@.str.9 = [4 x i8] c"#B#\00"
@.str.10 = [3 x i8] c"\C2\84\00"
@.str.11 = [4 x i8] c"#K#\00"
@.str.12 = [2 x i8] c"\80\00"
@.str.13 = [2 x i8] c"\81\00"
@.str.14 = [2 x i8] c"\82\00"
@.str.15 = [2 x i8] c"\83\00"
@.str.16 = [2 x i8] c"\84\00"
@.str.17 = [15 x i8] c"bergo@seul.org\00"
@.str.18 = [17 x i8] c"fbergo@gmail.com\00"
@.str.19 = [2 x i8] c"w\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %51
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i64 @malloc(i32 500000)
%12 = inttoptr i64 %11 to i8*
%13 = tail call i32 @fgetc(i32* %10)
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %24, label %16
16: ; preds = %7, %16
%17 = phi i32 [ %21, %16 ], [ %13, %7 ]
%18 = phi i8* [ %20, %16 ], [ %12, %7 ]
%19 = trunc i32 %17 to i8
store i8 %19, i8* %18
%20 = getelementptr inbounds i8, i8* %18, i64 1
%21 = tail call i32 @fgetc(i32* %10)
%22 = load i32, i32* @EOF
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %16
24: ; preds = %16, %7
%25 = phi i8* [ %12, %7 ], [ %20, %16 ]
store i8 0, i8* %25
%26 = tail call i32 @fclose(i32* %10)
%27 = tail call i32 @sub(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%28 = tail call i32 @sub(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%29 = tail call i32 @sub(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%30 = tail call i32 @sub(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%31 = tail call i32 @sub(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%32 = tail call i32 @sub(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%33 = tail call i32 @sub(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%34 = tail call i32 @sub(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%35 = tail call i32 @sub(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%36 = tail call i32 @sub(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%37 = tail call i32 @sub(i8* %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0))
%38 = load i8*, i8** %8
%39 = tail call i32* @fopen(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%40 = load i8, i8* %12
%41 = icmp eq i8 %40, 0
br i1 %41, label %49, label %42
42: ; preds = %24, %42
%43 = phi i8 [ %47, %42 ], [ %40, %24 ]
%44 = phi i8* [ %46, %42 ], [ %12, %24 ]
%45 = tail call i32 @fputc(i8 signext %43, i32* %39)
%46 = getelementptr inbounds i8, i8* %44, i64 1
%47 = load i8, i8* %46
%48 = icmp eq i8 %47, 0
br i1 %48, label %49, label %42
49: ; preds = %42, %24
%50 = tail call i32 @fclose(i32* %39)
br label %51
51: ; preds = %49, %4
%52 = phi i32 [ 1, %4 ], [ 0, %49 ]
ret i32 %52
}