#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*/ fprintf(int /*<<< orphan*/, char *, char *, int, double);
int /*<<< orphan*/ sscanf(char *, char *, char *, int *, double *);
int /*<<< orphan*/ stdout;
int main(void) {
  char buf[] = "lilei 123|45.3";
  int i;
  double d;
  char name[10] = {};
  sscanf(buf, "%s%d|%lf", name, &i, &d);
  fprintf(stdout, "name=%s,i=%d,d=%f\n", name, i, d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xeb9(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb1(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x2a(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    -0xf(%rbp),%rdi
lea    -0x2a(%rbp),%rdx
lea    0xe90(%rip),%rsi
lea    -0x14(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1050 <sscanf@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
lea    -0x2a(%rbp),%rdx
mov    -0x14(%rbp),%ecx
movsd  -0x20(%rbp),%xmm0
lea    0xe70(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movabs $0x332e35347c3332,%rax
mov    %rax,0x27(%rsp)
movabs $0x32312069656c696c,%rax
20 31 32
mov    %rax,0x20(%rsp)
movw   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xeb5(%rip),%rsi
lea    0x20(%rsp),%rdi
lea    0x8(%rsp),%rbx
lea    0x4(%rsp),%rcx
lea    0x18(%rsp),%r8
mov    %rbx,%rdx
call   1040 <sscanf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
mov    0x4(%rsp),%ecx
movsd  0x18(%rsp),%xmm0
lea    0xe88(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.buf = [15 x i8] c"lilei 123|45.3\00"
@.str = [9 x i8] c"%s%d|%lf\00"
@stdout = global i32 0
@.str.1 = [19 x i8] c"name=%s,i=%d,d=%f\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca i32
%3 = alloca double
%4 = alloca [10 x i8]
%5 = bitcast [15 x i8]* %1 to i8*
%6 = bitcast [10 x i8]* %4 to i8*
%7 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%9 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %8, i32* %2, double* %3)
%10 = load i32, i32* @stdout
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%12 = load i32, i32* %2
%13 = load double, double* %3
%14 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %12, double %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.buf = [15 x i8] c"lilei 123|45.3\00"
@.str = [9 x i8] c"%s%d|%lf\00"
@stdout = global i32 0
@.str.1 = [19 x i8] c"name=%s,i=%d,d=%f\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca i32
%3 = alloca double
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%6 = bitcast i32* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%9 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %8, i32* %2, double* %3)
%10 = load i32, i32* @stdout
%11 = load i32, i32* %2
%12 = load double, double* %3
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 %11, double %12)
ret i32 0
}