#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 atoi(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strtok(char *, char *);
void get_coordinates(int *x, int *y) {
  char input[80] = "";
  printf("%s", "Coordinates (x, y)? ");
  (void)fgets(input, 80, stdin);
  *x = atoi(strtok(input, ", "));
  *y = atoi(strtok(NULL, " \n"));
}


x86 assembly (clang, -O0):
<get_coordinates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1040 <memset@plt>
lea    0xe89(%rip),%rdi
lea    0xe85(%rip),%rsi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    0x2e5a(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    -0x60(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1060 <strtok@plt>
mov    %eax,%edi
call   1070 <atoi@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe57(%rip),%rsi
call   1060 <strtok@plt>
mov    %eax,%edi
call   1070 <atoi@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_coordinates>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xe8f(%rip),%rdi
lea    0xe8b(%rip),%rsi
call   1030 <printf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1040 <fgets@plt>
lea    0xe7b(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strtok@plt>
mov    %eax,%edi
call   1060 <atoi@plt>
mov    %eax,(%r15)
lea    0xe65(%rip),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
mov    %eax,%edi
call   1060 <atoi@plt>
mov    %eax,(%r14)
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [21 x i8] c"Coordinates (x, y)? \00"
@stdin = global i32 0
@.str.2 = [3 x i8] c", \00"
@.str.3 = [3 x i8] c" \0A\00"
define void @get_coordinates(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [80 x i8]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = bitcast [80 x i8]* %5 to i8*
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 80, i32 %9)
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%12 = call i32 @strtok(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @atoi(i32 %12)
%14 = load i32*, i32** %3
store i32 %13, i32* %14
%15 = call i32 @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @atoi(i32 %15)
%17 = load i32*, i32** %4
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [21 x i8] c"Coordinates (x, y)? \00"
@stdin = global i32 0
@.str.2 = [3 x i8] c", \00"
@.str.3 = [3 x i8] c" \0A\00"
define void @get_coordinates(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %4, i32 80, i32 %6)
%8 = call i32 @strtok(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @atoi(i32 %8)
store i32 %9, i32* %0
%10 = call i32 @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @atoi(i32 %10)
store i32 %11, i32* %1
ret void
}