#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 scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int sscanf(char *, char *, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
int processCandidate(char *candidate, uint32_t *pos, uint32_t *res) {
  char area[50];
  char symbol[10];
  char position[15];
  char result[500];
  int tokenCount;
  tokenCount = sscanf(candidate, "%49[^:]:%9[^:]:%14[^:]:%s", area, symbol,
                      position, result);
  if (tokenCount != 4) {
    fprintf(stderr, "processCandidate: Something went wrong\n");
    exit(42);
  }
  (*pos) = (uint32_t)atoi(position);
  (*res) = (uint32_t)atoi(result);
  return (0);
}


x86 assembly (clang, -O0):
<processCandidate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    -0x5a(%rbp),%rcx
lea    -0x69(%rbp),%r8
lea    -0x260(%rbp),%r9
lea    0xe8b(%rip),%rsi
call   1040 <sscanf@plt>
mov    %eax,-0x264(%rbp)
cmpl   $0x4,-0x264(%rbp)
je     11ac <processCandidate+0x6c>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
lea    0xe7d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2a,%edi
call   1060 <exit@plt>
lea    -0x69(%rbp),%rdi
call   1050 <atoi@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
lea    -0x260(%rbp),%rdi
call   1050 <atoi@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processCandidate>:
push   %r14
push   %rbx
sub    $0x258,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0xea9(%rip),%rsi
lea    0x20(%rsp),%rdx
lea    0x16(%rsp),%rcx
lea    0x7(%rsp),%r8
lea    0x60(%rsp),%r9
call   1040 <sscanf@plt>
cmp    $0x4,%eax
jne    119c <processCandidate+0x5c>
lea    0x7(%rsp),%rdi
call   1050 <atoi@plt>
mov    %rax,(%rbx)
lea    0x60(%rsp),%rdi
call   1050 <atoi@plt>
mov    %rax,(%r14)
xor    %eax,%eax
add    $0x258,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
lea    0xe6e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2a,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"%49[^:]:%9[^:]:%14[^:]:%s\00"
@stderr = global i32 0
@.str.1 = [40 x i8] c"processCandidate: Something went wrong\0A\00"
define i32 @processCandidate(i8* %0, i64* %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca [50 x i8]
%8 = alloca [10 x i8]
%9 = alloca [15 x i8]
%10 = alloca [500 x i8]
%11 = alloca i32
store i8* %0, i8** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%15 = getelementptr inbounds [15 x i8], [15 x i8]* %9, i64 0, i64 0
%16 = getelementptr inbounds [500 x i8], [500 x i8]* %10, i64 0, i64 0
%17 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14, i8* %15, i8* %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = icmp ne i32 %18, 4
br i1 %19, label %20, label %24
20: ; preds = %3
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 @exit(i32 42)
unreachable
24: ; preds = %3
%25 = getelementptr inbounds [15 x i8], [15 x i8]* %9, i64 0, i64 0
%26 = call i64 @atoi(i8* %25)
%27 = load i64*, i64** %5
store i64 %26, i64* %27
%28 = getelementptr inbounds [500 x i8], [500 x i8]* %10, i64 0, i64 0
%29 = call i64 @atoi(i8* %28)
%30 = load i64*, i64** %6
store i64 %29, i64* %30
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"%49[^:]:%9[^:]:%14[^:]:%s\00"
@stderr = global i32 0
@.str.1 = [40 x i8] c"processCandidate: Something went wrong\0A\00"
define i32 @processCandidate(i8* nocapture %0, i64* nocapture writeonly %1, i64* nocapture writeonly %2) {
%4 = alloca [50 x i8]
%5 = alloca [10 x i8]
%6 = alloca [15 x i8]
%7 = alloca [500 x i8]
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%12 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i8* %10, i8* %11)
%13 = icmp eq i32 %12, 4
br i1 %13, label %18, label %14
14: ; preds = %3
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @exit(i32 42)
unreachable
18: ; preds = %3
%19 = call i64 @atoi(i8* %10)
store i64 %19, i64* %1
%20 = call i64 @atoi(i8* %11)
store i64 %20, i64* %2
ret i32 0
}