#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 sscanf(char const *, char *, int *, int *, int *, char *);
int date_parse(const char *str, int *a1, int *a2, int *a3, char sep,
               char *rest) {
  char frmDate[] = " %d/%d/%d%[^\0]";
  frmDate[3] = frmDate[6] = sep;
  return sscanf(str, frmDate, a1, a2, a3, rest);
}


x86 assembly (clang, -O0):
<date_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %al,-0x21(%rbp)
mov    %r9,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x3f(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x37(%rbp)
mov    0xebf(%rip),%ax
mov    %ax,-0x33(%rbp)
mov    0xeb7(%rip),%al
mov    %al,-0x31(%rbp)
mov    -0x21(%rbp),%al
mov    %al,-0x39(%rbp)
mov    %al,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x3f(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <sscanf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_parse>:
sub    $0x18,%rsp
mov    %rcx,%rax
mov    %rdx,%rcx
mov    %rsi,%rdx
movabs $0x252f64252f642520,%rsi
64 2f 25
mov    %rsi,0x8(%rsp)
movabs $0x5d005e5b256425,%rsi
mov    %rsi,0xf(%rsp)
mov    %r8b,0xe(%rsp)
mov    %r8b,0xb(%rsp)
lea    0x8(%rsp),%rsi
mov    %rax,%r8
call   1030 <sscanf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.date_parse.frmDate = [15 x i8] c" %d/%d/%d%[^\00]\00"
define i32 @date_parse(i8* %0, i32* %1, i32* %2, i32* %3, i8 signext %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8
%12 = alloca i8*
%13 = alloca [15 x i8]
store i8* %0, i8** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i8 %4, i8* %11
store i8* %5, i8** %12
%14 = bitcast [15 x i8]* %13 to i8*
%15 = load i8, i8* %11
%16 = getelementptr inbounds [15 x i8], [15 x i8]* %13, i64 0, i64 6
store i8 %15, i8* %16
%17 = getelementptr inbounds [15 x i8], [15 x i8]* %13, i64 0, i64 3
store i8 %15, i8* %17
%18 = load i8*, i8** %7
%19 = getelementptr inbounds [15 x i8], [15 x i8]* %13, i64 0, i64 0
%20 = load i32*, i32** %8
%21 = load i32*, i32** %9
%22 = load i32*, i32** %10
%23 = load i8*, i8** %12
%24 = call i32 @sscanf(i8* %18, i8* %19, i32* %20, i32* %21, i32* %22, i8* %23)
ret i32 %24
}

LLVM IR (-O2):
@__const.date_parse.frmDate = [15 x i8] c" %d/%d/%d%[^\00]\00"
define i32 @date_parse(i8* nocapture %0, i32* %1, i32* %2, i32* %3, i8 signext %4, i8* %5) {
%7 = alloca [15 x i8]
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %7, i64 0, i64 0
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %7, i64 0, i64 6
store i8 %4, i8* %9
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %7, i64 0, i64 3
store i8 %4, i8* %10
%11 = call i32 @sscanf(i8* %0, i8* %8, i32* %1, i32* %2, i32* %3, i8* %5)
ret i32 %11
}