#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 */
int /*<<< orphan*/ fwrite(char *, int, int /*<<< orphan*/,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char *);
void setInvalidResult(int invalids, FILE *expectedResultInvalidFile) {
  int i;
  char invalidString[] = "invalid query...\n";
  for (i = 0; i < invalids; i++)
    fwrite(invalidString, sizeof(char), strlen(invalidString),
           expectedResultInvalidFile);
}


x86 assembly (clang, -O0):
<setInvalidResult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%ax
mov    %ax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1196 <setInvalidResult+0x76>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <setInvalidResult+0x37>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setInvalidResult>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0xa,0x10(%rsp)
test   %edi,%edi
jle    116f <setInvalidResult+0x4f>
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1040 <fwrite@plt>
add    $0xffffffff,%ebp
jne    1150 <setInvalidResult+0x30>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.setInvalidResult.invalidString = [18 x i8] c"invalid query...\0A\00"
define void @setInvalidResult(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca [18 x i8]
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = bitcast [18 x i8]* %6 to i8*
store i32 0, i32* %5
br label %8
8: ; preds = %18, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 0
%14 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
%16 = load i32*, i32** %4
%17 = call i32 @fwrite(i8* %13, i32 1, i32 %15, i32* %16)
br label %18
18: ; preds = %12
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %8
21: ; preds = %8
ret void
}

LLVM IR (-O2):
@__const.setInvalidResult.invalidString = [18 x i8] c"invalid query...\0A\00"
define void @setInvalidResult(i32 %0, i32* nocapture %1) {
%3 = alloca [18 x i8]
%4 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %12
6: ; preds = %2, %6
%7 = phi i32 [ %10, %6 ], [ 0, %2 ]
%8 = call i32 @strlen(i8* %4)
%9 = call i32 @fwrite(i8* %4, i32 1, i32 %8, i32* %1)
%10 = add nuw nsw i32 %7, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}