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

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, char *, char *);
int /*<<< orphan*/ stdin;
void main() {
  char Line[256];
  char LabelName[256], Address[256];
  while (!feof(stdin)) {
    fgets(Line, 256, stdin);
    if (Line[0] != ';') {
      if (Line[2] == ':') {
        sscanf(&Line[3], "%s %s", Address, LabelName);
        printf("%s: equa %s\n\r", &LabelName[1], Address);
      }
    }
  }
  printf("fixlabels\n\r");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x300,%rsp
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    116e <main+0x2e>
jmp    11f7 <main+0xb7>
lea    -0x100(%rbp),%rdi
mov    0x2e6c(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1040 <fgets@plt>
movsbl -0x100(%rbp),%eax
cmp    $0x3b,%eax
je     11f2 <main+0xb2>
movsbl -0xfe(%rbp),%eax
cmp    $0x3a,%eax
jne    11ed <main+0xad>
lea    -0x100(%rbp),%rdi
add    $0x3,%rdi
lea    -0x300(%rbp),%rdx
lea    -0x200(%rbp),%rcx
lea    0xe38(%rip),%rsi
call   1060 <sscanf@plt>
lea    -0x200(%rbp),%rsi
add    $0x1,%rsi
lea    -0x300(%rbp),%rdx
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f2 <main+0xb2>
jmp    114b <main+0xb>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x300,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x308,%rsp
mov    0x2e90(%rip),%r15
mov    (%r15),%edi
call   1050 <feof@plt>
test   %eax,%eax
je     1184 <main+0x44>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x308,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsp,%r13
lea    0xe72(%rip),%r12
lea    0x200(%rsp),%rbx
lea    0x100(%rsp),%rbp
lea    0xe61(%rip),%r14
jmp    11bc <main+0x7c>
nopw   0x0(%rax,%rax,1)
mov    (%r15),%edi
call   1050 <feof@plt>
test   %eax,%eax
jne    1164 <main+0x24>
mov    (%r15),%edx
mov    %r13,%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
cmpb   $0x3b,(%rsp)
je     11b0 <main+0x70>
cmpb   $0x3a,0x2(%rsp)
jne    11b0 <main+0x70>
lea    0x3(%rsp),%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
call   1060 <sscanf@plt>
mov    %r14,%rdi
lea    0x101(%rsp),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11b0 <main+0x70>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [14 x i8] c"%s: equa %s\0A\0D\00"
@.str.2 = [12 x i8] c"fixlabels\0A\0D\00"
define void @main() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
br label %4
4: ; preds = %31, %0
%5 = load i32, i32* @stdin
%6 = call i32 @feof(i32 %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %32
9: ; preds = %4
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%11 = load i32, i32* @stdin
%12 = call i32 @fgets(i8* %10, i32 256, i32 %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 59
br i1 %16, label %17, label %31
17: ; preds = %9
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 2
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 58
br i1 %21, label %22, label %30
22: ; preds = %17
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 3
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%26 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %24, i8* %25)
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 1
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %27, i8* %28)
br label %30
30: ; preds = %22, %17
br label %31
31: ; preds = %30, %9
br label %4
32: ; preds = %4
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [14 x i8] c"%s: equa %s\0A\0D\00"
@.str.2 = [12 x i8] c"fixlabels\0A\0D\00"
define void @main() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @feof(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %0
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 2
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 3
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 1
br label %14
14: ; preds = %10, %25
%15 = load i32, i32* @stdin
%16 = call i32 @fgets(i8* %4, i32 256, i32 %15)
%17 = load i8, i8* %4
%18 = icmp ne i8 %17, 59
%19 = load i8, i8* %11
%20 = icmp eq i8 %19, 58
%21 = select i1 %18, i1 %20, i1 false
br i1 %21, label %22, label %25
22: ; preds = %14
%23 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %5)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8* %6)
br label %25
25: ; preds = %22, %14
%26 = load i32, i32* @stdin
%27 = call i32 @feof(i32 %26)
%28 = icmp eq i32 %27, 0
br i1 %28, label %14, label %29
29: ; preds = %25, %0
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}