#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*/ add_translation(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int sscanf(char const *, char *, char *, char *);
int process_translation(const char *line) {
  char key[100];
  char value[100];
  int matches = sscanf(line, "%*s %s %s", key, value);
  if (2 != matches)
    return -1;
  add_translation(key, value);
  printf("Translation %s -> %s\n", key, value);
  return 0;
}


x86 assembly (clang, -O0):
<process_translation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rdx
lea    -0xf0(%rbp),%rcx
lea    0xeab(%rip),%rsi
call   1050 <sscanf@plt>
mov    %eax,-0xf4(%rbp)
mov    $0x2,%eax
cmp    -0xf4(%rbp),%eax
je     117d <process_translation+0x4d>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ab <process_translation+0x7b>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1030 <add_translation@plt>
lea    -0x80(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_translation>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xebf(%rip),%rsi
lea    0x70(%rsp),%rdx
mov    %rsp,%rcx
call   1050 <sscanf@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x2,%ecx
jne    1181 <process_translation+0x51>
lea    0x70(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <add_translation@plt>
lea    0xe96(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%*s %s %s\00"
@.str.1 = [22 x i8] c"Translation %s -> %s\0A\00"
define i32 @process_translation(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = alloca i32
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%10 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp ne i32 2, %11
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %21
14: ; preds = %1
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%17 = call i32 @add_translation(i8* %15, i8* %16)
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %18, i8* %19)
store i32 0, i32* %2
br label %21
21: ; preds = %14, %13
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@.str = [10 x i8] c"%*s %s %s\00"
@.str.1 = [22 x i8] c"Translation %s -> %s\0A\00"
define i32 @process_translation(i8* nocapture %0) {
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @add_translation(i8* %4, i8* %5)
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* %5)
br label %11
11: ; preds = %1, %8
%12 = phi i32 [ 0, %8 ], [ -1, %1 ]
ret i32 %12
}