#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*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vuln();
int main(int argc, char **argv) {
  setvbuf(stdout, NULL, _IONBF, 0);
  setvbuf(stdin, NULL, _IONBF, 0);
  setvbuf(stderr, NULL, _IONBF, 0);
  vuln();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
mov    0x2e60(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    $0x0,%al
call   1030 <vuln@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rbx
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
xor    %eax,%eax
call   1030 <vuln@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
@stdin = global i32 0
@stderr = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stdout
%7 = load i32, i32* @_IONBF
%8 = call i32 @setvbuf(i32 %6, i32* null, i32 %7, i32 0)
%9 = load i32, i32* @stdin
%10 = load i32, i32* @_IONBF
%11 = call i32 @setvbuf(i32 %9, i32* null, i32 %10, i32 0)
%12 = load i32, i32* @stderr
%13 = load i32, i32* @_IONBF
%14 = call i32 @setvbuf(i32 %12, i32* null, i32 %13, i32 0)
%15 = call i32 (...) @vuln()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
@stdin = global i32 0
@stderr = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = load i32, i32* @_IONBF
%5 = tail call i32 @setvbuf(i32 %3, i32* null, i32 %4, i32 0)
%6 = load i32, i32* @stdin
%7 = load i32, i32* @_IONBF
%8 = tail call i32 @setvbuf(i32 %6, i32* null, i32 %7, i32 0)
%9 = load i32, i32* @stderr
%10 = load i32, i32* @_IONBF
%11 = tail call i32 @setvbuf(i32 %9, i32* null, i32 %10, i32 0)
%12 = tail call i32 (...) @vuln()
ret i32 0
}