#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*/ find_two_number_in_array(int *, int, int, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int array[7] = {1, 3, 4, 5, 6, 7, 8};
  int array_add[10] = {};
  int i;
  int num;
  printf("input the number c (a+b)\n");
  scanf("%d", &num);
  find_two_number_in_array(array, 7, num, array_add);
  for (i = 0; i < 10; i = i + 2) {
    if (array_add[i] != 0) {
      printf("%d+%d=%d\n", array_add[i], array_add[i + 1], num);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xea2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
lea    -0x58(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x58(%rbp),%edx
lea    -0x50(%rbp),%rcx
mov    $0x7,%esi
call   1060 <find_two_number_in_array@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0xa,-0x54(%rbp)
jge    1214 <main+0xd4>
movslq -0x54(%rbp),%rax
cmpl   $0x0,-0x50(%rbp,%rax,4)
je     1201 <main+0xc1>
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
mov    -0x54(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x50(%rbp,%rax,4),%edx
mov    -0x58(%rbp),%ecx
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1206 <main+0xc6>
mov    -0x54(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x54(%rbp)
jmp    11c3 <main+0x83>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
movups 0xec1(%rip),%xmm0
movups %xmm0,0x4c(%rsp)
movaps 0xea9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x30(%rsp)
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
lea    0xe97(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edx
lea    0x40(%rsp),%rdi
lea    0x10(%rsp),%rcx
mov    $0x7,%esi
call   1060 <find_two_number_in_array@plt>
mov    0x10(%rsp),%esi
test   %esi,%esi
je     11c5 <main+0x85>
mov    0x14(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe61(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
test   %esi,%esi
je     11e3 <main+0xa3>
mov    0x1c(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe43(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
test   %esi,%esi
je     1201 <main+0xc1>
mov    0x24(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe25(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%rsp),%esi
test   %esi,%esi
je     121f <main+0xdf>
mov    0x2c(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe07(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x30(%rsp),%esi
test   %esi,%esi
je     123d <main+0xfd>
mov    0x34(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xde9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [7 x i32] [i32 1, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8]
@.str = [26 x i8] c"input the number c (a+b)\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"%d+%d=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [7 x i32]* %2 to i8*
%7 = bitcast [10 x i32]* %3 to i8*
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%11 = load i32, i32* %5
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%13 = call i32 @find_two_number_in_array(i32* %10, i32 7, i32 %11, i32* %12)
store i32 0, i32* %4
br label %14
14: ; preds = %36, %0
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 10
br i1 %16, label %17, label %39
17: ; preds = %14
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %35
23: ; preds = %17
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = load i32, i32* %5
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %27, i32 %32, i32 %33)
br label %35
35: ; preds = %23, %17
br label %36
36: ; preds = %35
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 2
store i32 %38, i32* %4
br label %14
39: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [7 x i32] [i32 1, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8]
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"%d+%d=%d\0A\00"
@str = [25 x i8] c"input the number c (a+b)\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = bitcast [7 x i32]* %1 to i8*
%5 = bitcast [10 x i32]* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%10 = load i32, i32* %3
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%12 = call i32 @find_two_number_in_array(i32* %9, i32 7, i32 %10, i32* %11)
%13 = load i32, i32* %11
%14 = icmp eq i32 %13, 0
br i1 %14, label %20, label %15
15: ; preds = %0
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%17 = load i32, i32* %16
%18 = load i32, i32* %3
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %17, i32 %18)
br label %20
20: ; preds = %0, %15
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 0
br i1 %23, label %29, label %24
24: ; preds = %20
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%26 = load i32, i32* %25
%27 = load i32, i32* %3
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %22, i32 %26, i32 %27)
br label %29
29: ; preds = %24, %20
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%31 = load i32, i32* %30
%32 = icmp eq i32 %31, 0
br i1 %32, label %38, label %33
33: ; preds = %29
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%35 = load i32, i32* %34
%36 = load i32, i32* %3
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %31, i32 %35, i32 %36)
br label %38
38: ; preds = %33, %29
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%40 = load i32, i32* %39
%41 = icmp eq i32 %40, 0
br i1 %41, label %47, label %42
42: ; preds = %38
%43 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%44 = load i32, i32* %43
%45 = load i32, i32* %3
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %40, i32 %44, i32 %45)
br label %47
47: ; preds = %42, %38
%48 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
%49 = load i32, i32* %48
%50 = icmp eq i32 %49, 0
br i1 %50, label %56, label %51
51: ; preds = %47
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%53 = load i32, i32* %52
%54 = load i32, i32* %3
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %49, i32 %53, i32 %54)
br label %56
56: ; preds = %51, %47
ret i32 0
}