xunge/DecIR huggingface dataset:
/* Type definitions */
struct user_regs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exec_by_all_variants(int, int *);
void sys_rest(int variant_count, int *child, struct user_regs_struct *regs) {
  exec_by_all_variants(variant_count, child);
}


x86 assembly (clang, -O0):
<sys_rest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <exec_by_all_variants@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_rest>:
jmp    1030 <exec_by_all_variants@plt>

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
define void @sys_rest(i32 %0, i32* %1, %struct.user_regs_struct* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.user_regs_struct*
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.user_regs_struct* %2, %struct.user_regs_struct** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = call i32 @exec_by_all_variants(i32 %7, i32* %8)
ret void
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @sys_rest(i32 %0, i32* %1, %struct.user_regs_struct* nocapture readnone %2) {
%4 = tail call i32 @exec_by_all_variants(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int f(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", f(2, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <f@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <f@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @f(i32 2, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ verify_sorted(int *, int);
void confirm_array_is_sorted(int *array, int size) {
  if (verify_sorted(array, size)) {
    printf("array sort verified\n");
  } else {
    printf("WARNING: array not sorted properly!\n");
  }
}


x86 assembly (clang, -O0):
<confirm_array_is_sorted>:
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   1040 <verify_sorted@plt>
cmp    $0x0,%rax
je     1156 <confirm_array_is_sorted+0x36>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1162 <confirm_array_is_sorted+0x42>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confirm_array_is_sorted>:
push   %rax
call   1040 <verify_sorted@plt>
test   %rax,%rax
lea    0xed0(%rip),%rax
lea    0xeed(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"array sort verified\0A\00"
@.str.1 = [37 x i8] c"WARNING: array not sorted properly!\0A\00"
define void @confirm_array_is_sorted(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 i64 @verify_sorted(i32* %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"WARNING: array not sorted properly!\00"
@str.2 = [20 x i8] c"array sort verified\00"
define void @confirm_array_is_sorted(i32* %0, i32 %1) {
%3 = tail call i64 @verify_sorted(i32* %0, i32 %1)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret void
}
void INT_Excep_TPU7_TGI7B(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU7_TGI7B() {
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
unsigned long long square(int, int);
scalar_t__ validCoordinate(int, int);
void setSquare(uint64_t *bb, int rank, int file) {
  if (validCoordinate(rank, file))
    *bb |= 1ull << square(rank, file);
}


x86 assembly (clang, -O0):
<setSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <validCoordinate@plt>
cmp    $0x0,%rax
je     116a <setSquare+0x4a>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <square@plt>
mov    %rax,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSquare>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
mov    %edx,%esi
call   1040 <validCoordinate@plt>
test   %rax,%rax
je     114f <setSquare+0x2f>
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <square@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%rdx
or     %rdx,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @setSquare(i64* %0, i32 %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i32
store i64* %0, i64** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i64 @validCoordinate(i32 %7, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i64 @square(i32 %12, i32 %13)
%15 = shl i64 1, %14
%16 = load i64*, i64** %4
%17 = load i64, i64* %16
%18 = or i64 %17, %15
store i64 %18, i64* %16
br label %19
19: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @setSquare(i64* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i64 @validCoordinate(i32 %1, i32 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i64 @square(i32 %1, i32 %2)
%8 = shl nuw i64 1, %7
%9 = load i64, i64* %0
%10 = or i64 %9, %8
store i64 %10, i64* %0
br label %11
11: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int errprint(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Start test\n");
  assert(errprint("test") == 5);
  printf("Test finished\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
call   1050 <errprint@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec2(%rip),%rdi
call   1050 <errprint@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Start test\0A\00"
@.str.1 = [5 x i8] c"test\00"
@.str.2 = [15 x i8] c"Test finished\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @errprint(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 5
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"test\00"
@str = [11 x i8] c"Start test\00"
@str.3 = [14 x i8] c"Test finished\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @errprint(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 5
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int charCount;
  scanf("%d", &charCount);
  for (; charCount > 0; charCount--) {
    printf("*");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1163 <main+0x43>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <main+0x1f>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    115a <main+0x3a>
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
cmp    $0x1,%eax
jg     1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0, %6
%7 = call i32 @putchar(i32 42)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp sgt i32 %8, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %0
%12 = call i32 @putchar(i32 10)
ret i32 0
}
int is_ws_first_fragment(unsigned char flags) {
  return (flags & 0x80) == 0 && (flags & 0x0f) != 0;
}


x86 assembly (clang, -O0):
<is_ws_first_fragment>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x80,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    1132 <is_ws_first_fragment+0x32>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ws_first_fragment>:
test   $0x80,%dil
sete   %al
test   $0xf,%dil
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_ws_first_fragment(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 128
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_ws_first_fragment(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
%5 = and i32 %2, 15
%6 = icmp ne i32 %5, 0
%7 = and i1 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ INT_MIN;
unsigned int test8u(unsigned int x) {
  unsigned int y = 0x1234;
  unsigned int z = (unsigned int)INT_MIN;
  return (x ^ y) ^ z;
}


x86 assembly (clang, -O0):
<test8u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1234,-0x8(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test8u>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
xor    (%rcx),%eax
xor    $0x1234,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
define i32 @test8u(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 4660, i32* %3
%5 = load i64, i64* @INT_MIN
%6 = trunc i64 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = xor i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
@INT_MIN = global i64 0
define i32 @test8u(i32 %0) {
%2 = load i64, i64* @INT_MIN
%3 = trunc i64 %2 to i32
%4 = xor i32 %3, %0
%5 = xor i32 %4, 4660
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _basic_tests();
int /*<<< orphan*/ _lex_next_tests();
int /*<<< orphan*/ _prime_tests();
int /*<<< orphan*/ _read_after_0_tests();
int /*<<< orphan*/ _walk_tests();
int main(void) {
  _basic_tests();
  _prime_tests();
  _lex_next_tests();
  _walk_tests();
  _read_after_0_tests();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <_basic_tests@plt>
mov    $0x0,%al
call   1050 <_prime_tests@plt>
mov    $0x0,%al
call   1040 <_lex_next_tests@plt>
mov    $0x0,%al
call   1070 <_walk_tests@plt>
mov    $0x0,%al
call   1060 <_read_after_0_tests@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <_basic_tests@plt>
xor    %eax,%eax
call   1050 <_prime_tests@plt>
xor    %eax,%eax
call   1040 <_lex_next_tests@plt>
xor    %eax,%eax
call   1070 <_walk_tests@plt>
xor    %eax,%eax
call   1060 <_read_after_0_tests@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @_basic_tests()
%3 = call i32 (...) @_prime_tests()
%4 = call i32 (...) @_lex_next_tests()
%5 = call i32 (...) @_walk_tests()
%6 = call i32 (...) @_read_after_0_tests()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @_basic_tests()
%2 = tail call i32 (...) @_prime_tests()
%3 = tail call i32 (...) @_lex_next_tests()
%4 = tail call i32 (...) @_walk_tests()
%5 = tail call i32 (...) @_read_after_0_tests()
ret i32 0
}
void NotifyBmsChgEnd(struct work_struct *work) {}


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

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

LLVM IR (-O0):
%struct.work_struct = type opaque
define void @NotifyBmsChgEnd(%struct.work_struct* %0) {
%2 = alloca %struct.work_struct*
store %struct.work_struct* %0, %struct.work_struct** %2
ret void
}

LLVM IR (-O2):
%struct.work_struct = type opaque
define void @NotifyBmsChgEnd(%struct.work_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int ano, resto;
  printf("Insira o ano: \n");
  scanf("%i", &ano);
  resto = ano % 4;
  if (resto == 0)
    printf("Ano bissexto\n");
  else
    printf("Não é bissexto\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1174 <main+0x54>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x60>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x3,0x4(%rsp)
lea    0xed9(%rip),%rax
lea    0xec1(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Insira o ano: \0A\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [14 x i8] c"Ano bissexto\0A\00"
@.str.3 = [18 x i8] c"N\C3\A3o \C3\A9 bissexto\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = srem i32 %6, 4
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@str = [15 x i8] c"Insira o ano: \00"
@str.4 = [17 x i8] c"N\C3\A3o \C3\A9 bissexto\00"
@str.5 = [13 x i8] c"Ano bissexto\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 3
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void poolFreeC(void *s) { free(s); }


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

x86 assembly (clang, -O2):
<poolFreeC>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @poolFreeC(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double ceil(double);
double floor(double);
double round(double x) {
  double fx = floor(x);
  double cx = ceil(x);
  if ((x - fx) <= (cx - x))
    return fx;
  else
    return cx;
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1178 <round+0x58>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1182 <round+0x62>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
sub    $0x28,%rsp
movaps %xmm0,(%rsp)
call   1040 <floor@plt>
movaps %xmm0,0x10(%rsp)
movapd (%rsp),%xmm0
call   1030 <ceil@plt>
movapd %xmm0,%xmm1
movapd (%rsp),%xmm2
subsd  %xmm2,%xmm1
movapd 0x10(%rsp),%xmm3
subsd  %xmm3,%xmm2
cmpnlesd %xmm1,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm3,%xmm2
orpd   %xmm2,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = call double @llvm.floor.f64(double %6)
store double %7, double* %4
%8 = load double, double* %3
%9 = call double @llvm.ceil.f64(double %8)
store double %9, double* %5
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fsub double %10, %11
%13 = load double, double* %5
%14 = load double, double* %3
%15 = fsub double %13, %14
%16 = fcmp ole double %12, %15
br i1 %16, label %17, label %19
17: ; preds = %1
%18 = load double, double* %4
store double %18, double* %2
br label %21
19: ; preds = %1
%20 = load double, double* %5
store double %20, double* %2
br label %21
21: ; preds = %19, %17
%22 = load double, double* %2
ret double %22
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = tail call double @llvm.ceil.f64(double %0)
%4 = fsub double %0, %2
%5 = fsub double %3, %0
%6 = fcmp ugt double %4, %5
%7 = select i1 %6, double %3, double %2
ret double %7
}
void gtk_icon_theme_get_example_icon_name() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_theme_get_example_icon_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __execve(const char *path, char *const argv[], char *const envp[]) {
  if (path == NULL || argv == NULL || envp == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <__execve+0x35>
cmpq   $0x0,-0x18(%rbp)
je     1145 <__execve+0x35>
cmpq   $0x0,-0x20(%rbp)
jne    115f <__execve+0x4f>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <__execve+0x64>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__execve>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    %rax,%rcx
test   %rdx,%rdx
je     1127 <__execve+0x17>
mov    0x2ec1(%rip),%rcx
test   %rsi,%rsi
cmove  %rax,%rcx
test   %rdi,%rdi
cmove  %rax,%rcx
mov    (%rcx),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8**
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %16, label %10
10: ; preds = %3
%11 = load i8**, i8*** %6
%12 = icmp eq i8** %11, null
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i8**, i8*** %7
%15 = icmp eq i8** %14, null
br i1 %15, label %16, label %19
16: ; preds = %13, %10, %3
%17 = load i32, i32* @EINVAL
%18 = call i32 @__set_errno(i32 %17)
store i32 -1, i32* %4
br label %22
19: ; preds = %13
%20 = load i32, i32* @ENOSYS
%21 = call i32 @__set_errno(i32 %20)
store i32 -1, i32* %4
br label %22
22: ; preds = %19, %16
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__execve(i8* readnone %0, i8** readnone %1, i8** readnone %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i8** %1, null
%6 = or i1 %4, %5
%7 = icmp eq i8** %2, null
%8 = or i1 %6, %7
%9 = load i32, i32* @EINVAL
%10 = load i32, i32* @ENOSYS
%11 = select i1 %8, i32 %9, i32 %10
%12 = tail call i32 @__set_errno(i32 %11)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ dec_instr(int /*<<< orphan*/);
int exec_instr(int /*<<< orphan*/);
int process_instr(uint32_t instr) { return exec_instr(dec_instr(instr)); }


x86 assembly (clang, -O0):
<process_instr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <dec_instr@plt>
mov    %eax,%edi
call   1030 <exec_instr@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @process_instr(i32 %0) {
%2 = tail call i32 @dec_instr(i32 %0)
%3 = tail call i32 @exec_instr(i32 %2)
ret i32 %3
}
int yamil_parse_string(void *ast, char *input) {
  int status = 0;
  return status;
}


x86 assembly (clang, -O0):
<yamil_parse_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yamil_parse_string>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @yamil_parse_string(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *ctime_r(const time_t *t, char *dst) {
  char *p = ctime(t);
  if (p == NULL)
    return NULL;
  memcpy(dst, p, 26);
  return dst;
}


x86 assembly (clang, -O0):
<ctime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1155 <ctime_r+0x35>
movq   $0x0,-0x8(%rbp)
jmp    116f <ctime_r+0x4f>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x1a,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <ctime@plt>
test   %rax,%rax
je     1140 <ctime_r+0x20>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x1a,%edx
call   1040 <memcpy@plt>
jmp    1142 <ctime_r+0x22>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ctime_r(i32* %0, i8* %1) {
%3 = tail call i8* @ctime(i32* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %1, i8* %3, i32 26)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %1, %5 ], [ null, %2 ]
ret i8* %8
}
unsigned int even(int numeroInserito) {
  if (numeroInserito % 2 == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<even>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <even+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <even+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<even>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @even(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @even(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Type definitions */
struct fs_dirent {
  int dummy;
};
struct fs_dir {
  int dummy;
};

/* Variables and functions */
struct fs_dirent *fs_http_readdir(struct fs_dir *d) {
  return NULL;
}


x86 assembly (clang, -O0):
<fs_http_readdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_http_readdir>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.fs_dirent = type { i32 }
%struct.fs_dir = type { i32 }
define %struct.fs_dirent* @fs_http_readdir(%struct.fs_dir* %0) {
%2 = alloca %struct.fs_dir*
store %struct.fs_dir* %0, %struct.fs_dir** %2
ret %struct.fs_dirent* null
}

LLVM IR (-O2):
%struct.fs_dirent = type { i32 }
%struct.fs_dir = type { i32 }
define noalias %struct.fs_dirent* @fs_http_readdir(%struct.fs_dir* nocapture readnone %0) {
ret %struct.fs_dirent* null
}
void set_svga_mode(void) {
  int status;
  __asm__ __volatile__("int $0x10\n"
                       : "=a"(status)
                       : "0"(0x4F02), "b"(0x4000 | (0x0117)));
  status &= 0x004F;
  if (status == 0) {
    __asm__ __volatile__("hlt");
  }
}


x86 assembly (clang, -O0):
<set_svga_mode>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x4f02,%eax
mov    $0x4117,%ebx
int    $0x10
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x4f,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1128 <set_svga_mode+0x28>
hlt
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_svga_mode>:
push   %rbx
mov    $0x4117,%ebx
mov    $0x4f02,%eax
int    $0x10
test   $0x4f,%al
je     1113 <set_svga_mode+0x13>
pop    %rbx
ret
hlt
pop    %rbx
ret

LLVM IR (-O0):
define void @set_svga_mode() {
%1 = alloca i32
%2 = call i32 asm sideeffect "int $$0x10\0A", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i32 20226, i32 16663)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 79
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
br label %8
8: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @set_svga_mode() {
%1 = tail call i32 asm sideeffect "int $$0x10\0A", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i32 20226, i32 16663)
%2 = and i32 %1, 79
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %5
5: ; preds = %4, %0
ret void
}
/* Variables and functions */
size_t strnlen(const char *s, size_t n) {
  size_t i;
  for (i = 0; i < n && s[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    113c <strnlen+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <strnlen+0x4c>
jmp    1162 <strnlen+0x62>
jmp    1151 <strnlen+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
int test_imm_FAuint8_mem(unsigned char *val) {
  return ((*val) & (-0xFA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FAuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff06,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FAuint8_mem>:
testb  $0x6,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FAuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -250
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_FAuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 6
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int f1(int a, int b) { return a + b + 1; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    (%rdi,%rsi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f1(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 = add nsw i32 %5, %6
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = add i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Reserved143_DriverIRQHandler();
__attribute__((weak)) void Reserved143_IRQHandler(void) {
  Reserved143_DriverIRQHandler();
}


x86 assembly (clang, -O0):
<Reserved143_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Reserved143_DriverIRQHandler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reserved143_IRQHandler>:
xor    %eax,%eax
jmp    1030 <Reserved143_DriverIRQHandler@plt>

LLVM IR (-O0):
define weak void @Reserved143_IRQHandler() {
%1 = call i32 (...) @Reserved143_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved143_IRQHandler() {
%1 = tail call i32 (...) @Reserved143_DriverIRQHandler()
ret void
}
/* Type definitions */
struct completion {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
bool try_wait_for_completion(struct completion *c) { assert(0); }


x86 assembly (clang, -O0):
<try_wait_for_completion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_wait_for_completion>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.completion = type { i32 }
define i32 @try_wait_for_completion(%struct.completion* %0) {
%2 = alloca i32
%3 = alloca %struct.completion*
store %struct.completion* %0, %struct.completion** %3
%4 = call i32 @assert(i32 0)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
%struct.completion = type { i32 }
define i32 @try_wait_for_completion(%struct.completion* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
char toupper(int /*<<< orphan*/);
char *strupr(char *dst, const char *src) {
  char *p = dst;
  while ((*dst++ = toupper(*src++))) {
  }
  return p;
}


x86 assembly (clang, -O0):
<strupr>:
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,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115d <strupr+0x4d>
jmp    1128 <strupr+0x18>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   (%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
test   %al,%al
jne    1120 <strupr+0x10>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strupr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %16, %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call signext i8 @toupper(i32 %11)
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
store i8 %12, i8* %13
%15 = icmp ne i8 %12, 0
br i1 %15, label %16, label %17
16: ; preds = %7
br label %7
17: ; preds = %7
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @strupr(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %10, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = tail call signext i8 @toupper(i32 %8)
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %9, i8* %5
%11 = icmp eq i8 %9, 0
br i1 %11, label %12, label %3
12: ; preds = %3
ret i8* %0
}
unsigned long decreasing(unsigned long key) { return (key); }


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

x86 assembly (clang, -O2):
<decreasing>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @decreasing(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @decreasing(i64 returned %0) {
ret i64 %0
}
int test_imm_AAint8_mem(signed char *val) {
  return ((*val) & (0xAA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AAint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xaa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_AAint8_mem>:
testb  $0xaa,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_AAint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 170
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_AAint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -86
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
ne(float a, float b) { return a != b; }


x86 assembly (clang, -O0):
<ne>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne>:
cmpneqss %xmm1,%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ne(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp une float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ne(float %0, float %1) {
%3 = fcmp une float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int strlen(char const *);
int /*<<< orphan*/ write(int const, char *, int);
void send_command(const int fd, const char *str) {
  char buf[256];
  int len = strlen(str);
  sprintf(buf, "%s\r\n", str);
  write(fd, buf, len + 2);
  return;
}


x86 assembly (clang, -O0):
<send_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x114(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe9d(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    -0x114(%rbp),%edx
add    $0x2,%edx
call   1030 <write@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_command>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
lea    0xeac(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
add    $0x2,%ebp
mov    %r14d,%edi
mov    %r15,%rsi
mov    %ebp,%edx
call   1030 <write@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s\0D\0A\00"
define void @send_command(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [256 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %6
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* %3
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 2
%16 = call i32 @write(i32 %12, i8* %13, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0D\0A\00"
define void @send_command(i32 %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @strlen(i8* %1)
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = add nsw i32 %5, 2
%8 = call i32 @write(i32 %0, i8* %4, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_array(int *, int);
int main(void) {
  int arr[] = {1, 1, 2, 5, 8, 13};
  print_array(arr, 6);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [6 x i32] [i32 1, i32 1, i32 2, i32 5, i32 8, i32 13]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_array(i32* %3, i32 6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [6 x i32] [i32 1, i32 1, i32 2, i32 5, i32 8, i32 13]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_array(i32* %3, i32 6)
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("Difference = %d\n", (atoi(argv[1]) - atoi(argv[2])));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    -0x14(%rbp),%esi
sub    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
sub    %eax,%ebp
lea    0xebd(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Difference = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @atoi(i8* %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 2
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
%13 = sub nsw i32 %8, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Difference = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = sub nsw i32 %5, %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
void node_builder_end_element(void *data) {}


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

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

LLVM IR (-O0):
define void @node_builder_end_element(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @node_builder_end_element(i8* nocapture %0) {
ret void
}
/* Variables and functions */
size_t write_FD_BE(int, double const *, int);
size_t float64WriteToFD(int fd, const double *data) {
  return write_FD_BE(fd, data, sizeof(double));
}


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

x86 assembly (clang, -O2):
<float64WriteToFD>:
mov    $0x8,%edx
jmp    1030 <write_FD_BE@plt>

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

LLVM IR (-O2):
define i64 @float64WriteToFD(i32 %0, double* %1) {
%3 = tail call i64 @write_FD_BE(i32 %0, double* %1, i32 8)
ret i64 %3
}