#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 int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ get_line(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
scalar_t__ timlib_strncmp(char *, char *);
void post2dictionary_fetch(char *destination, FILE *input_stream,
                           char *post_key) {
  char input_buffer[131072];
  *destination = '\0';
  while (get_line(input_buffer, input_stream)) {
    if (timlib_strncmp(input_buffer, post_key) == 0)
      break;
    if (!*input_buffer)
      continue;
    if (strcmp(input_buffer, "select") == 0)
      continue;
    destination += sprintf(destination, "%s", input_buffer);
  }
}


x86 assembly (clang, -O0):
<post2dictionary_fetch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20020,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x20020(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <get_line@plt>
cmp    $0x0,%rax
je     11f7 <post2dictionary_fetch+0xb7>
lea    -0x20020(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <timlib_strncmp@plt>
cmp    $0x0,%rax
jne    1197 <post2dictionary_fetch+0x57>
jmp    11f7 <post2dictionary_fetch+0xb7>
cmpb   $0x0,-0x20020(%rbp)
jne    11a9 <post2dictionary_fetch+0x69>
jmp    115e <post2dictionary_fetch+0x1e>
lea    -0x20020(%rbp),%rdi
lea    0xe49(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11cb <post2dictionary_fetch+0x8b>
jmp    115e <post2dictionary_fetch+0x1e>
mov    -0x8(%rbp),%rdi
lea    -0x20020(%rbp),%rdx
lea    0xe2a(%rip),%rsi
call   1060 <sprintf@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    115e <post2dictionary_fetch+0x1e>
add    $0x20020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<post2dictionary_fetch>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20000,%rsp
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
movb   $0x0,(%rdi)
mov    %rsp,%rdi
call   1030 <get_line@plt>
test   %rax,%rax
je     11cb <post2dictionary_fetch+0x8b>
mov    %rsp,%rbx
lea    0xe8d(%rip),%r13
jmp    1190 <post2dictionary_fetch+0x50>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <get_line@plt>
test   %rax,%rax
je     11cb <post2dictionary_fetch+0x8b>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <timlib_strncmp@plt>
test   %rax,%rax
je     11cb <post2dictionary_fetch+0x8b>
cmpb   $0x0,(%rsp)
je     1180 <post2dictionary_fetch+0x40>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1180 <post2dictionary_fetch+0x40>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <stpcpy@plt>
sub    %r15d,%eax
cltq
add    %rax,%r15
jmp    1180 <post2dictionary_fetch+0x40>
add    $0x20000,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"select\00"
@.str.1 = [3 x i8] c"%s\00"
define void @post2dictionary_fetch(i8* %0, i32* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca [131072 x i8]
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
store i8 0, i8* %8
br label %9
9: ; preds = %30, %29, %24, %3
%10 = getelementptr inbounds [131072 x i8], [131072 x i8]* %7, i64 0, i64 0
%11 = load i32*, i32** %5
%12 = call i64 @get_line(i8* %10, i32* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %37
14: ; preds = %9
%15 = getelementptr inbounds [131072 x i8], [131072 x i8]* %7, i64 0, i64 0
%16 = load i8*, i8** %6
%17 = call i64 @timlib_strncmp(i8* %15, i8* %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
br label %37
20: ; preds = %14
%21 = getelementptr inbounds [131072 x i8], [131072 x i8]* %7, i64 0, i64 0
%22 = load i8, i8* %21
%23 = icmp ne i8 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %20
br label %9
25: ; preds = %20
%26 = getelementptr inbounds [131072 x i8], [131072 x i8]* %7, i64 0, i64 0
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %25
br label %9
30: ; preds = %25
%31 = load i8*, i8** %4
%32 = getelementptr inbounds [131072 x i8], [131072 x i8]* %7, i64 0, i64 0
%33 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %32)
%34 = load i8*, i8** %4
%35 = sext i32 %33 to i64
%36 = getelementptr inbounds i8, i8* %34, i64 %35
store i8* %36, i8** %4
br label %9
37: ; preds = %19, %9
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"select\00"
define void @post2dictionary_fetch(i8* %0, i32* %1, i8* %2) {
%4 = alloca [131072 x i8]
%5 = getelementptr inbounds [131072 x i8], [131072 x i8]* %4, i64 0, i64 0
store i8 0, i8* %0
%6 = call i64 @get_line(i8* %5, i32* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %32, label %8
8: ; preds = %3, %22
%9 = phi i8* [ %29, %22 ], [ %0, %3 ]
br label %10
10: ; preds = %8, %16
%11 = call i64 @timlib_strncmp(i8* %5, i8* %2)
%12 = icmp eq i64 %11, 0
br i1 %12, label %32, label %13
13: ; preds = %10
%14 = load i8, i8* %5
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13, %19
%17 = call i64 @get_line(i8* %5, i32* %1)
%18 = icmp eq i64 %17, 0
br i1 %18, label %32, label %10
19: ; preds = %13
%20 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %16, label %22
22: ; preds = %19
%23 = call i8* @stpcpy(i8* %9, i8* %5)
%24 = ptrtoint i8* %23 to i64
%25 = ptrtoint i8* %9 to i64
%26 = sub i64 %24, %25
%27 = shl i64 %26, 32
%28 = ashr exact i64 %27, 32
%29 = getelementptr inbounds i8, i8* %9, i64 %28
%30 = call i64 @get_line(i8* %5, i32* %1)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %8
32: ; preds = %22, %16, %10, %3
ret void
}