#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*/ printf(char *, int, ...);
int /*<<< orphan*/ rev(char *);
int main() {
  char s[] = "hello abcd world";
  rev(s);
  int x = 2;
  int y = 3;
  x = x++ * ++y;
  y = ++x + ++y;
  printf("\n%d, %d", x, y);
  struct a {
    char s;
    int b;
  };
  printf("%d", sizeof(struct a));
  printf("\n%x", -1 << 4);
  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,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <rev@plt>
movl   $0x2,-0x24(%rbp)
movl   $0x3,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x28(%rbp)
imul   %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x28(%rbp)
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe65(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe55(%rip),%rdi
mov    $0xfffffff0,%esi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <rev@plt>
lea    0xece(%rip),%rdi
mov    $0x9,%esi
mov    $0xe,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeab(%rip),%rdi
mov    $0xfffffff0,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [17 x i8] c"hello abcd world\00"
@.str = [8 x i8] c"\0A%d, %d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"\0A%x\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [17 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [17 x i8]* %2 to i8*
%6 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%7 = call i32 @rev(i8* %6)
store i32 2, i32* %3
store i32 3, i32* %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
%12 = mul nsw i32 %8, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
%17 = add nsw i32 %14, %16
store i32 %17, i32* %4
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19)
%21 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 8)
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 -16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [17 x i8] c"hello abcd world\00"
@.str = [8 x i8] c"\0A%d, %d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"\0A%x\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%3 = call i32 @rev(i8* %2)
%4 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 9, i32 14)
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 8)
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 -16)
ret i32 0
}