xunge/DecIR huggingface dataset:
void __attribute__((no, noclone)) test3(int x) {
  if ((3 << x) == 4 || (1 << x) == 12 || (40 << x) == 1024 || (2 << x) == 84 ||
      (3 << x) == 16384 || (10 << x) == 6144)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x3,%eax
shl    %cl,%eax
cmp    $0x4,%eax
je     1193 <test3+0x83>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    $0xc,%eax
je     1193 <test3+0x83>
mov    -0x4(%rbp),%ecx
mov    $0x28,%eax
shl    %cl,%eax
cmp    $0x400,%eax
je     1193 <test3+0x83>
mov    -0x4(%rbp),%ecx
mov    $0x2,%eax
shl    %cl,%eax
cmp    $0x54,%eax
je     1193 <test3+0x83>
mov    -0x4(%rbp),%ecx
mov    $0x3,%eax
shl    %cl,%eax
cmp    $0x4000,%eax
je     1193 <test3+0x83>
mov    -0x4(%rbp),%ecx
mov    $0xa,%eax
shl    %cl,%eax
cmp    $0x1800,%eax
jne    1198 <test3+0x88>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
ret

LLVM IR (-O0):
define void @test3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 3, %3
%5 = icmp eq i32 %4, 4
br i1 %5, label %26, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = shl i32 1, %7
%9 = icmp eq i32 %8, 12
br i1 %9, label %26, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = shl i32 40, %11
%13 = icmp eq i32 %12, 1024
br i1 %13, label %26, label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = shl i32 2, %15
%17 = icmp eq i32 %16, 84
br i1 %17, label %26, label %18
18: ; preds = %14
%19 = load i32, i32* %2
%20 = shl i32 3, %19
%21 = icmp eq i32 %20, 16384
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load i32, i32* %2
%24 = shl i32 10, %23
%25 = icmp eq i32 %24, 6144
br i1 %25, label %26, label %27
26: ; preds = %22, %18, %14, %10, %6, %1
unreachable
27: ; preds = %22
ret void
}

LLVM IR (-O2):
define void @test3(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
extern void print_char(char c) { putchar(c); }


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @print_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @putchar(i8 signext %3)
ret void
}

LLVM IR (-O2):
define void @print_char(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
ret void
}
char *get_funct_token() {
  char *token;
  return token;
}


x86 assembly (clang, -O0):
<get_funct_token>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_funct_token>:
ret

LLVM IR (-O0):
define i8* @get_funct_token() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @get_funct_token() {
ret i8* undef
}
/* Variables and functions */
scalar_t__ is_number(char);
int is_word(char c) {
  return (is_number(c) || (((int)c >= (int)'A') && ((int)c <= (int)'z')));
}


x86 assembly (clang, -O0):
<is_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <is_number@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115e <is_word+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1158 <is_word+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_word>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_number@plt>
test   %rax,%rax
setne  %al
lea    -0x41(%rbx),%ecx
cmp    $0x3a,%cl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_word(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_number(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 65
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 122
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_word(i8 signext %0) {
%2 = tail call i64 @is_number(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 58
%6 = or i1 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) { printf("%s", "git push"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [9 x i8] c"git push\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [9 x i8] c"git push\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ display(int *, int);
int /*<<< orphan*/ split(int *, int /*<<< orphan*/, int, char *);
int main(int argc, char const *argv[]) {
  int arr[] = {7, 3, 2, 1, 8, 9, 4};
  split(arr, 0, 6, "Initial Call");
  display(arr, 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
lea    0xeaa(%rip),%rcx
call   1040 <split@plt>
lea    -0x30(%rbp),%rdi
mov    $0x6,%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed9(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1040 <split@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [7 x i32] [i32 7, i32 3, i32 2, i32 1, i32 8, i32 9, i32 4]
@.str = [13 x i8] c"Initial Call\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [7 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [7 x i32]* %6 to i8*
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%9 = call i32 @split(i32* %8, i32 0, i32 6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%11 = call i32 @display(i32* %10, i32 6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [7 x i32] [i32 7, i32 3, i32 2, i32 1, i32 8, i32 9, i32 4]
@.str = [13 x i8] c"Initial Call\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i32]
%4 = bitcast [7 x i32]* %3 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%6 = call i32 @split(i32* %5, i32 0, i32 6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @display(i32* %5, i32 6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int pc_getnameinfo(void const *, int /*<<< orphan*/, char *, int /*<<< orphan*/,
                   char *, int /*<<< orphan*/, int);
int getnameinfo(const void *sa, socklen_t salen, char *host, socklen_t hostlen,
                char *serv, socklen_t servlen, int flags) {
  return pc_getnameinfo(sa, salen, host, hostlen, serv, servlen, flags);
}


x86 assembly (clang, -O0):
<getnameinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <pc_getnameinfo@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnameinfo>:
jmp    1030 <pc_getnameinfo@plt>

LLVM IR (-O0):
define i32 @getnameinfo(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i8*, i8** %10
%18 = load i32, i32* %11
%19 = load i8*, i8** %12
%20 = load i32, i32* %13
%21 = load i32, i32* %14
%22 = call i32 @pc_getnameinfo(i8* %15, i32 %16, i8* %17, i32 %18, i8* %19, i32 %20, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @getnameinfo(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5, i32 %6) {
%8 = tail call i32 @pc_getnameinfo(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5, i32 %6)
ret i32 %8
}
int timeout_v_rel(void) { return 0x20160226; }


x86 assembly (clang, -O0):
<timeout_v_rel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20160226,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeout_v_rel>:
mov    $0x20160226,%eax
ret

LLVM IR (-O0):
define i32 @timeout_v_rel() {
ret i32 538313254
}

LLVM IR (-O2):
define i32 @timeout_v_rel() {
ret i32 538313254
}
int main() {
  int i = 0;
  while (1) {
    *((volatile int *)0x8000) = i;
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x8000,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,0x8000
add    $0x1,%eax
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %2
store volatile i32 %4, i32* inttoptr (i64 32768 to i32*)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
store volatile i32 %2, i32* inttoptr (i64 32768 to i32*)
%3 = add nuw nsw i32 %2, 1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void Fatal(const char *err) {
  fprintf(stderr, "\n\tERROR: %s\n", err);
  exit(1);
}


x86 assembly (clang, -O0):
<Fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"\0A\09ERROR: %s\0A\00"
define void @Fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"\0A\09ERROR: %s\0A\00"
define void @Fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ print_ocb_test_vectors();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Some OCB test vectors\n\n");
  print_ocb_test_vectors();
  printf("\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <print_ocb_test_vectors@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <print_ocb_test_vectors@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Some OCB test vectors\0A\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @print_ocb_test_vectors()
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Some OCB test vectors\0A\00"
@str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @print_ocb_test_vectors()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int fun(int a) { printf("%d\n", a); }


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @fun(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @fun(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("any(\"baloon\", \"dog\") -> %d\n", any("baloon", "dog"));
  printf("any(\"abc\", \"def\") -> %d\n", any("abc", "def"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee6(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1040 <any@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1040 <any@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef4(%rip),%rdi
lea    0xef4(%rip),%rsi
call   1040 <any@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
lea    0xef4(%rip),%rsi
call   1040 <any@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"any(\22baloon\22, \22dog\22) -> %d\0A\00"
@.str.1 = [7 x i8] c"baloon\00"
@.str.2 = [4 x i8] c"dog\00"
@.str.3 = [25 x i8] c"any(\22abc\22, \22def\22) -> %d\0A\00"
@.str.4 = [4 x i8] c"abc\00"
@.str.5 = [4 x i8] c"def\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @any(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @any(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"any(\22baloon\22, \22dog\22) -> %d\0A\00"
@.str.1 = [7 x i8] c"baloon\00"
@.str.2 = [4 x i8] c"dog\00"
@.str.3 = [25 x i8] c"any(\22abc\22, \22def\22) -> %d\0A\00"
@.str.4 = [4 x i8] c"abc\00"
@.str.5 = [4 x i8] c"def\00"
define i32 @main() {
%1 = tail call i32 @any(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @any(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int USHRT_MAX;
int __syscall_ret(int /*<<< orphan*/);
int syscall(int, int /*<<< orphan*/, int, int);
int semget(key_t key, int n, int fl) {
  if (n > USHRT_MAX)
    return __syscall_ret(-EINVAL);
  return syscall(299, key, n, fl);
}


x86 assembly (clang, -O0):
<semget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ead(%rip),%rcx
cmp    (%rcx),%eax
jle    115b <semget+0x3b>
xor    %edi,%edi
mov    0x2e8c(%rip),%rax
sub    (%rax),%edi
call   1040 <__syscall_ret@plt>
mov    %eax,-0x4(%rbp)
jmp    1171 <semget+0x51>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x12b,%edi
call   1030 <syscall@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semget>:
mov    %edx,%ecx
mov    %esi,%edx
mov    0x2ebd(%rip),%rax
cmp    %esi,(%rax)
jge    113f <semget+0x1f>
mov    0x2ea2(%rip),%rax
xor    %edi,%edi
sub    (%rax),%edi
jmp    1040 <__syscall_ret@plt>
mov    %edi,%esi
mov    $0x12b,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@USHRT_MAX = global i32 0
@EINVAL = global i32 0
define i32 @semget(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* @USHRT_MAX
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32, i32* @EINVAL
%13 = sub nsw i32 0, %12
%14 = call i32 @__syscall_ret(i32 %13)
store i32 %14, i32* %4
br label %20
15: ; preds = %3
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = call i32 @syscall(i32 299, i32 %16, i32 %17, i32 %18)
store i32 %19, i32* %4
br label %20
20: ; preds = %15, %11
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
@USHRT_MAX = global i32 0
@EINVAL = global i32 0
define i32 @semget(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @USHRT_MAX
%5 = icmp slt i32 %4, %1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
%9 = tail call i32 @__syscall_ret(i32 %8)
br label %12
10: ; preds = %3
%11 = tail call i32 @syscall(i32 299, i32 %0, i32 %1, i32 %2)
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ out_of_memory();
char *strdup(char const *);
char *create_string(const char *str) {
  char *p;
  if (!str) {
    return (NULL);
  }
  if (!(p = strdup(str))) {
    out_of_memory();
  }
  return (p);
}


x86 assembly (clang, -O0):
<create_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <create_string+0x24>
movq   $0x0,-0x8(%rbp)
jmp    116a <create_string+0x4a>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1162 <create_string+0x42>
mov    $0x0,%al
call   1030 <out_of_memory@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_string>:
push   %rbx
test   %rdi,%rdi
je     113e <create_string+0x1e>
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <create_string+0x20>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <out_of_memory@plt>
jmp    1140 <create_string+0x20>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @create_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %16
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = call i32 (...) @out_of_memory()
br label %14
14: ; preds = %12, %8
%15 = load i8*, i8** %4
store i8* %15, i8** %2
br label %16
16: ; preds = %14, %7
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @create_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @out_of_memory()
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ null, %1 ], [ null, %6 ], [ %4, %3 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ schedule_ra(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ send_multicast_ra(int /*<<< orphan*/ *, int);
int ra_routing_change(int router) {
  send_multicast_ra(NULL, router);
  schedule_ra(NULL, 1, 1);
  return 1;
}


x86 assembly (clang, -O0):
<ra_routing_change>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <send_multicast_ra@plt>
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <schedule_ra@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ra_routing_change>:
push   %rax
mov    %edi,%esi
xor    %edi,%edi
call   1030 <send_multicast_ra@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <schedule_ra@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ra_routing_change(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @send_multicast_ra(i32* null, i32 %3)
%5 = call i32 @schedule_ra(i32* null, i32 1, i32 1)
ret i32 1
}

LLVM IR (-O2):
define i32 @ra_routing_change(i32 %0) {
%2 = tail call i32 @send_multicast_ra(i32* null, i32 %0)
%3 = tail call i32 @schedule_ra(i32* null, i32 1, i32 1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void INThandler(int sig) {
  printf("\nERROR: please use /quit or /exit or /part to quit\n");
}


x86 assembly (clang, -O0):
<INThandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INThandler>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"\0AERROR: please use /quit or /exit or /part to quit\0A\00"
define void @INThandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"\0AERROR: please use /quit or /exit or /part to quit\00"
define void @INThandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct vec4 {
  int dummy;
};

/* Variables and functions */
int vec4_is_near_zero(float *, float);
__attribute__((always_)) bool psvec4_is_near_zero(struct vec4 *a,
                                                  float epsilon) {
  return vec4_is_near_zero((float *)a, epsilon);
}


x86 assembly (clang, -O0):
<psvec4_is_near_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
call   1030 <vec4_is_near_zero@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec4_is_near_zero>:
jmp    1030 <vec4_is_near_zero@plt>

LLVM IR (-O0):
%struct.vec4 = type { i32 }
define i32 @psvec4_is_near_zero(%struct.vec4* %0, float %1) {
%3 = alloca %struct.vec4*
%4 = alloca float
store %struct.vec4* %0, %struct.vec4** %3
store float %1, float* %4
%5 = load %struct.vec4*, %struct.vec4** %3
%6 = bitcast %struct.vec4* %5 to float*
%7 = load float, float* %4
%8 = call i32 @vec4_is_near_zero(float* %6, float %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.vec4 = type { i32 }
define i32 @psvec4_is_near_zero(%struct.vec4* %0, float %1) {
%3 = bitcast %struct.vec4* %0 to float*
%4 = tail call i32 @vec4_is_near_zero(float* %3, float %1)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printResult(time_t beginning, time_t end) {
  printf("%d\n", (int)(end - beginning));
}


x86 assembly (clang, -O0):
<printResult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printResult>:
sub    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @printResult(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub nsw i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printResult(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
void main(void) {
  int x;
  int y;
  int m;
  while (x == 5) {
    y = 7;
    y = x / m;
    while (x < 2) {
      int w;
      w = x;
    }
  }
  while (m < 2) {
    m = 8 + m;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x5,-0x4(%rbp)
jne    1139 <main+0x39>
movl   $0x7,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1134 <main+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    111f <main+0x1f>
jmp    1104 <main+0x4>
jmp    113e <main+0x3e>
cmpl   $0x2,-0xc(%rbp)
jge    1156 <main+0x56>
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <main+0x3e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 5
br i1 %7, label %8, label %18
8: ; preds = %5
store i32 7, i32* %2
%9 = load i32, i32* %1
%10 = load i32, i32* %3
%11 = sdiv i32 %9, %10
store i32 %11, i32* %2
br label %12
12: ; preds = %15, %8
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = load i32, i32* %1
store i32 %16, i32* %4
br label %12
17: ; preds = %12
br label %5
18: ; preds = %5
br label %19
19: ; preds = %22, %18
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 2
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32, i32* %3
%24 = add nsw i32 8, %23
store i32 %24, i32* %3
br label %19
25: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ lirc_t;

/* Variables and functions */
int /*<<< orphan*/ is_pulse(int /*<<< orphan*/);
int is_space(lirc_t data) { return (!is_pulse(data)); }


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_pulse@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
push   %rax
call   1030 <is_pulse@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_space(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @is_pulse(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_space(i32 %0) {
%2 = tail call i32 @is_pulse(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void error_handler(FILE *client_write) {
  fputs("sth. error happened", client_write);
  fputc('\n', client_write);
}


x86 assembly (clang, -O0):
<error_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_handler>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"sth. error happened\00"
define void @error_handler(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fputc(i8 signext 10, i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"sth. error happened\00"
define void @error_handler(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 19, i64 1, i32* %0)
%3 = tail call i32 @fputc(i8 signext 10, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cos(double);
double sin(double);
double sincos_sin(double x) {
  (void)cos(x);
  return sin(x);
}


x86 assembly (clang, -O0):
<sincos_sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincos_sin>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <cos@plt>
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @sincos_sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @cos(double %3)
%5 = load double, double* %2
%6 = call double @sin(double %5)
ret double %6
}

LLVM IR (-O2):
define double @sincos_sin(double %0) {
%2 = tail call i32 @cos(double %0)
%3 = tail call double @sin(double %0)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_sub_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_sub_epi64(__m128i A, __m128i B) { return _mm_sub_epi64(A, B); }


x86 assembly (clang, -O0):
<test_mm_sub_epi64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_sub_epi64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_sub_epi64>:
jmp    1030 <_mm_sub_epi64@plt>

LLVM IR (-O0):
define i32 @test_mm_sub_epi64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_sub_epi64(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_sub_epi64(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sub_epi64(i32 %0, i32 %1)
ret i32 %3
}
int f1(enum {AA, BB} E) {
  int arr1[(AA == 0) ? 1 : -1] = {};
  int arr2[(BB == 1) ? 1 : -1] = {};
  return BB;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x i32]
%4 = alloca [1 x i32]
store i32 %0, i32* %2
%5 = bitcast [1 x i32]* %3 to i8*
%6 = bitcast [1 x i32]* %4 to i8*
ret i32 1
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ scale8_video(int /*<<< orphan*/, int /*<<< orphan*/);
uint8_t dim8_video(uint8_t x) { return scale8_video(x, x); }


x86 assembly (clang, -O0):
<dim8_video>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <scale8_video@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dim8_video>:
mov    %edi,%esi
jmp    1030 <scale8_video@plt>

LLVM IR (-O0):
define i32 @dim8_video(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @scale8_video(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @dim8_video(i32 %0) {
%2 = tail call i32 @scale8_video(i32 %0, i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool checkbutton() {
  static int downcount = 0;
  bool ret = false;
  if ((*(volatile uint8_t *)((0x5005 + 1)) & (1 << 4)) == 0) {
    downcount++;
    if (downcount == 1024) {
      ret = true;
    }
  } else
    downcount = 0;
  return ret;
}


x86 assembly (clang, -O0):
<checkbutton>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x5006,%eax
mov    (%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
jne    1149 <checkbutton+0x49>
mov    0x2f00(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef7(%rip)
cmpl   $0x400,0x2eed(%rip)
jne    1144 <checkbutton+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1153 <checkbutton+0x53>
movl   $0x0,0x2ed1(%rip)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkbutton>:
testl  $0x10,0x5006
jne    1128 <checkbutton+0x28>
mov    0x2f11(%rip),%ecx
add    $0x1,%ecx
mov    %ecx,0x2f08(%rip)
xor    %eax,%eax
cmp    $0x400,%ecx
sete   %al
ret
movl   $0x0,0x2ef2(%rip)
xor    %eax,%eax
ret

LLVM IR (-O0):
@checkbutton.downcount = internal global i32 0
define i32 @checkbutton() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load volatile i32, i32* inttoptr (i64 20486 to i32*)
%3 = and i32 %2, 16
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i32, i32* @checkbutton.downcount
%7 = add nsw i32 %6, 1
store i32 %7, i32* @checkbutton.downcount
%8 = load i32, i32* @checkbutton.downcount
%9 = icmp eq i32 %8, 1024
br i1 %9, label %10, label %11
10: ; preds = %5
store i32 1, i32* %1
br label %11
11: ; preds = %10, %5
br label %13
12: ; preds = %0
store i32 0, i32* @checkbutton.downcount
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@checkbutton.downcount = internal unnamed_addr global i32 0
define i32 @checkbutton() {
%1 = load volatile i32, i32* inttoptr (i64 20486 to i32*)
%2 = and i32 %1, 16
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = load i32, i32* @checkbutton.downcount
%6 = add nsw i32 %5, 1
store i32 %6, i32* @checkbutton.downcount
%7 = icmp eq i32 %6, 1024
%8 = zext i1 %7 to i32
br label %10
9: ; preds = %0
store i32 0, i32* @checkbutton.downcount
br label %10
10: ; preds = %4, %9
%11 = phi i32 [ 0, %9 ], [ %8, %4 ]
ret i32 %11
}
int score(int score, char map[5][5]) {
  int i;
  i = 0;
  while (i < 5) {
    if (map[i][0] == 'H') {
      score++;
    }
    i++;
  }
  return (score);
}


x86 assembly (clang, -O0):
<score>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    114e <score+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x5,%rcx,%rcx
add    %rcx,%rax
movsbl (%rax),%eax
cmp    $0x48,%eax
jne    1140 <score+0x40>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <score+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<score>:
xor    %eax,%eax
cmpb   $0x48,(%rsi)
sete   %al
add    %edi,%eax
xor    %ecx,%ecx
cmpb   $0x48,0x5(%rsi)
sete   %cl
add    %eax,%ecx
xor    %eax,%eax
cmpb   $0x48,0xa(%rsi)
sete   %al
add    %ecx,%eax
xor    %ecx,%ecx
cmpb   $0x48,0xf(%rsi)
sete   %cl
add    %eax,%ecx
xor    %eax,%eax
cmpb   $0x48,0x14(%rsi)
sete   %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @score(i32 %0, [5 x i8]* %1) {
%3 = alloca i32
%4 = alloca [5 x i8]*
%5 = alloca i32
store i32 %0, i32* %3
store [5 x i8]* %1, [5 x i8]** %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load [5 x i8]*, [5 x i8]** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %10, i64 %12
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %13, i64 0, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 72
br i1 %17, label %18, label %21
18: ; preds = %9
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %21
21: ; preds = %18, %9
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @score(i32 %0, [5 x i8]* nocapture %1) {
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 72
%6 = zext i1 %5 to i32
%7 = add nsw i32 %6, %0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 1, i64 0
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 72
%11 = zext i1 %10 to i32
%12 = add nsw i32 %7, %11
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 2, i64 0
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 72
%16 = zext i1 %15 to i32
%17 = add nsw i32 %12, %16
%18 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 3, i64 0
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 72
%21 = zext i1 %20 to i32
%22 = add nsw i32 %17, %21
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 4, i64 0
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 72
%26 = zext i1 %25 to i32
%27 = add nsw i32 %22, %26
ret i32 %27
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strlen(char *);
int main() {
  char str[] = {'h', 'i', '\0', 'h', 'i', '\0'};
  printf("%s\n", str);
  printf("%zu\n", strlen(str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    -0xa(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x69,0xc(%rsp)
movl   $0x68006968,0x8(%rsp)
68
lea    0xecb(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xeb3(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [6 x i8] c"hi\00hi\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"%zu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i8* @strlen(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [6 x i8] c"hi\00hi\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"%zu\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @strlen(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
void gtk_image_set_from_icon_set() {}


x86 assembly (clang, -O0):
<gtk_image_set_from_icon_set>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_image_set_from_icon_set>:
ret

LLVM IR (-O0):
define void @gtk_image_set_from_icon_set() {
ret void
}

LLVM IR (-O2):
define void @gtk_image_set_from_icon_set() {
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int my_compare_string(const void *objeto1, const void *objeto2) {
  const char *f1 = (const char *)objeto1;
  const char *f2 = (const char *)objeto2;
  return strcmp(f1, f2);
}


x86 assembly (clang, -O0):
<my_compare_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_compare_string>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @my_compare_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @strcmp(i8* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @my_compare_string(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int __compare(const void *a, const void *b) {
  return (*(int64_t *)a - *(int64_t *)b);
}


x86 assembly (clang, -O0):
<__compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__compare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @__compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @__compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
float sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ vector_length2(float const *, int);
float vector_length(const float vec[], int n) {
  return sqrt(vector_length2(vec, n));
}


x86 assembly (clang, -O0):
<vector_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vector_length2@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_length>:
push   %rax
call   1030 <vector_length2@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define float @vector_length(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%5 = load float*, float** %3
%6 = load i32, i32* %4
%7 = call i32 @vector_length2(float* %5, i32 %6)
%8 = call float @sqrt(i32 %7)
ret float %8
}

LLVM IR (-O2):
define float @vector_length(float* %0, i32 %1) {
%3 = tail call i32 @vector_length2(float* %0, i32 %1)
%4 = tail call float @sqrt(i32 %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, ...);
void print_intp_data(void *data, const char *key) {
  if (data == NULL)
    printf("data for '%s': NULL\n", key);
  else
    printf("data for '%s': %d\n", key, *(int *)data);
}


x86 assembly (clang, -O0):
<print_intp_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1142 <print_intp_data+0x32>
mov    -0x10(%rbp),%rsi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115a <print_intp_data+0x4a>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_intp_data>:
test   %rdi,%rdi
je     1125 <print_intp_data+0x15>
mov    (%rdi),%edx
lea    0xef7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"data for '%s': NULL\0A\00"
@.str.1 = [19 x i8] c"data for '%s': %d\0A\00"
define void @print_intp_data(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %16
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8*, i8** %3
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %14)
br label %16
16: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"data for '%s': NULL\0A\00"
@.str.1 = [19 x i8] c"data for '%s': %d\0A\00"
define void @print_intp_data(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %10
6: ; preds = %2
%7 = bitcast i8* %0 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %8)
br label %10
10: ; preds = %6, %4
ret void
}