#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*/ nums;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int *twosum(int *, int, int, int *);
int main(void) {
  int nums[] = {3, 2, 3};
  int size = sizeof(nums) / sizeof(*nums);
  int target = 6;
  int count = 0;
  int *indexes = twosum(nums, size, target, &count);
  if (indexes != NULL) {
    printf("%d %d\n", indexes[0], indexes[1]);
  } else {
    printf("Not found\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0x14(%rbp)
movl   $0x6,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    -0x1c(%rbp),%rcx
call   1040 <twosum@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     119a <main+0x7a>
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a8 <main+0x88>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xece(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xebb(%rip),%rax
mov    %rax,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rcx
mov    $0x3,%esi
mov    $0x6,%edx
call   1050 <twosum@plt>
test   %rax,%rax
je     1185 <main+0x55>
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1191 <main+0x61>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [3 x i32] [i32 3, i32 2, i32 3]
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [11 x i8] c"Not found\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 0, i32* %1
%7 = bitcast [3 x i32]* %2 to i8*
store i32 3, i32* %3
store i32 6, i32* %4
store i32 0, i32* %5
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32* @twosum(i32* %8, i32 %9, i32 %10, i32* %5)
store i32* %11, i32** %6
%12 = load i32*, i32** %6
%13 = icmp ne i32* %12, null
br i1 %13, label %14, label %22
14: ; preds = %0
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i64 0
%17 = load i32, i32* %16
%18 = load i32*, i32** %6
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %20)
br label %24
22: ; preds = %0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22, %14
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [3 x i32] [i32 3, i32 2, i32 3]
@.str = [7 x i8] c"%d %d\0A\00"
@str = [10 x i8] c"Not found\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca i32
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = call i32* @twosum(i32* %5, i32 3, i32 6, i32* %2)
%7 = icmp eq i32* %6, null
br i1 %7, label %13, label %8
8: ; preds = %0
%9 = load i32, i32* %6
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = load i32, i32* %10
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11)
br label %15
13: ; preds = %0
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
ret i32 0
}