#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 run_test(int, char const **, int, int *, char const **);
int test_short_with_arg(void) {
  int argc = 3;
  const char *argv[] = {"/some/path/tr-getopt-test", "-o", "/tmp/outfile"};
  int expected_n = 1;
  int expected_c[] = {'o'};
  const char *expected_optarg[] = {"/tmp/outfile"};
  return run_test(argc, argv, expected_n, expected_c, expected_optarg);
}


x86 assembly (clang, -O0):
<test_short_with_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x3,-0x4(%rbp)
mov    0x2cda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cd7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cd4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x24(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x28(%rbp)
mov    0x2cc1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
lea    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%r8
call   1030 <run_test@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_short_with_arg>:
sub    $0x28,%rsp
mov    0x2cf5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x6f,0x4(%rsp)
lea    0xee2(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rsi
lea    0x4(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0x3,%edi
mov    $0x1,%edx
call   1030 <run_test@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"/some/path/tr-getopt-test\00"
@.str.1 = [3 x i8] c"-o\00"
@.str.2 = [13 x i8] c"/tmp/outfile\00"
@__const.test_short_with_arg.argv = [3 x i8*] [i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i32 0, i32 0)]
@__const.test_short_with_arg.expected_c = [1 x i32] [i32 111]
@__const.test_short_with_arg.expected_optarg = [1 x i8*] [i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i32 0, i32 0)]
define i32 @test_short_with_arg() {
%1 = alloca i32
%2 = alloca [3 x i8*]
%3 = alloca i32
%4 = alloca [1 x i32]
%5 = alloca [1 x i8*]
store i32 3, i32* %1
%6 = bitcast [3 x i8*]* %2 to i8*
store i32 1, i32* %3
%7 = bitcast [1 x i32]* %4 to i8*
%8 = bitcast [1 x i8*]* %5 to i8*
%9 = load i32, i32* %1
%10 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 0
%11 = load i32, i32* %3
%12 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
%13 = getelementptr inbounds [1 x i8*], [1 x i8*]* %5, i64 0, i64 0
%14 = call i32 @run_test(i32 %9, i8** %10, i32 %11, i32* %12, i8** %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [26 x i8] c"/some/path/tr-getopt-test\00"
@.str.1 = [3 x i8] c"-o\00"
@.str.2 = [13 x i8] c"/tmp/outfile\00"
@__const.test_short_with_arg.argv = [3 x i8*] [i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i32 0, i32 0)]
define i32 @test_short_with_arg() {
%1 = alloca [3 x i8*]
%2 = alloca [1 x i32]
%3 = alloca [1 x i8*]
%4 = bitcast [3 x i8*]* %1 to i8*
%5 = bitcast [1 x i32]* %2 to i8*
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 111, i32* %6
%7 = bitcast [1 x i8*]* %3 to i8*
%8 = bitcast [1 x i8*]* %3 to i64*
store i64 ptrtoint ([13 x i8]* @.str.2 to i64), i64* %8
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%10 = getelementptr inbounds [1 x i8*], [1 x i8*]* %3, i64 0, i64 0
%11 = call i32 @run_test(i32 3, i8** %9, i32 1, i32* %6, i8** %10)
ret i32 %11
}