int main() {
  char s[10];
  char *str = "abcdef";
  unsigned int len = strlen(str) + 1;
  int a = 6;
  int b = 1;
  send_beer_moe(s, str, len);
  while (!!*str != *str) {
    putchar(*(str++));
  }
  printf("%c.\n",
         *((((a ^= b, b ^= a, a ^= b), len % strlen(s) > -b ? b : a) - 1) + s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
mov    %eax,-0x1c(%rbp)
movl   $0x6,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x0,%al
call   1060 <send_beer_moe@plt>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11ca <main+0x8a>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    118a <main+0x4a>
mov    -0x24(%rbp),%eax
xor    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
xor    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
xor    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rax,-0x30(%rbp)
lea    -0xe(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
xor    %edx,%edx
div    %rcx
xor    %eax,%eax
sub    -0x24(%rbp),%eax
cltq
cmp    %rax,%rdx
jbe    121c <main+0xdc>
mov    -0x24(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1222 <main+0xe2>
mov    -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0xe(%rbp,%rax,1),%esi
lea    0xdd1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rsi
lea    0xe(%rsp),%rdi
mov    $0x7,%edx
xor    %eax,%eax
call   1050 <send_beer_moe@plt>
mov    $0x61,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    $0x62,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    $0x63,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    $0x64,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    $0x65,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    $0x66,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
movsbl 0xe(%rsp),%esi
lea    0xe67(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"abcdef\00"
@.str.1 = [5 x i8] c"%c.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = add i64 %8, 1
%10 = trunc i64 %9 to i32
store i32 %10, i32* %4
store i32 6, i32* %5
store i32 1, i32* %6
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @send_beer_moe to i32 (i8*, i8*, i32, ...)*)(i8* %11, i8* %12, i32 %13)
br label %15
15: ; preds = %26, %0
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = icmp ne i8 %17, 0
%19 = xor i1 %18, true
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
%22 = load i8*, i8** %3
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %21, %24
br i1 %25, label %26, label %32
26: ; preds = %15
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
%29 = load i8, i8* %27
%30 = sext i8 %29 to i32
%31 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %30)
br label %15
32: ; preds = %15
%33 = load i32, i32* %6
%34 = load i32, i32* %5
%35 = xor i32 %34, %33
store i32 %35, i32* %5
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = xor i32 %37, %36
store i32 %38, i32* %6
%39 = load i32, i32* %6
%40 = load i32, i32* %5
%41 = xor i32 %40, %39
store i32 %41, i32* %5
%42 = load i32, i32* %4
%43 = zext i32 %42 to i64
%44 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%45 = call i64 @strlen(i8* %44)
%46 = urem i64 %43, %45
%47 = load i32, i32* %6
%48 = sub nsw i32 0, %47
%49 = sext i32 %48 to i64
%50 = icmp ugt i64 %46, %49
br i1 %50, label %51, label %53
51: ; preds = %32
%52 = load i32, i32* %6
br label %55
53: ; preds = %32
%54 = load i32, i32* %5
br label %55
55: ; preds = %53, %51
%56 = phi i32 [ %52, %51 ], [ %54, %53 ]
%57 = sub nsw i32 %56, 1
%58 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%59 = sext i32 %57 to i64
%60 = getelementptr inbounds i8, i8* %58, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %62)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"abcdef\00"
@.str.1 = [5 x i8] c"%c.\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @send_beer_moe to i32 (i8*, i8*, i32, ...)*)(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 7)
%4 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 97)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 98)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 99)
%7 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 100)
%8 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 101)
%9 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 102)
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}