xunge/DecIR huggingface dataset:
__attribute__((__no__)) void
do_nothing_packed_assigned_copy(struct test_packed *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_packed_assigned_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_packed_assigned_copy+0x1b>
jmp    1120 <do_nothing_packed_assigned_copy+0x20>
jmp    1120 <do_nothing_packed_assigned_copy+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_packed = type opaque
define void @do_nothing_packed_assigned_copy(%struct.test_packed* %0) {
%2 = alloca %struct.test_packed*
store %struct.test_packed* %0, %struct.test_packed** %2
%3 = load %struct.test_packed*, %struct.test_packed** %2
%4 = ptrtoint %struct.test_packed* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_packed = type opaque
define void @do_nothing_packed_assigned_copy(%struct.test_packed* nocapture %0) {
ret void
}
void anetTcpNonBlockBindConnect(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               45, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<anetTcpNonBlockBindConnect>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2d,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<anetTcpNonBlockBindConnect>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x2d,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.anetTcpNonBlockBindConnect = [27 x i8] c"anetTcpNonBlockBindConnect\00"
define void @anetTcpNonBlockBindConnect() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.anetTcpNonBlockBindConnect, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.anetTcpNonBlockBindConnect = [27 x i8] c"anetTcpNonBlockBindConnect\00"
define void @anetTcpNonBlockBindConnect() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.anetTcpNonBlockBindConnect, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ConvertFromFloat(float, unsigned char *);
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int ConvertFwriteFloat(FILE *fp, float val) {
  unsigned char tmp[4];
  ConvertFromFloat(val, tmp);
  if (fwrite(tmp, 4, 1, fp) != 1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<ConvertFwriteFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
call   1030 <ConvertFromFloat@plt>
lea    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
cmp    $0x1,%eax
je     116b <ConvertFwriteFloat+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1172 <ConvertFwriteFloat+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertFwriteFloat>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <ConvertFromFloat@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @ConvertFwriteFloat(i32* %0, float %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca float
%6 = alloca [4 x i8]
store i32* %0, i32** %4
store float %1, float* %5
%7 = load float, float* %5
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%9 = call i32 @ConvertFromFloat(float %7, i8* %8)
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%11 = load i32*, i32** %4
%12 = call i32 @fwrite(i8* %10, i32 4, i32 1, i32* %11)
%13 = icmp ne i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @ConvertFwriteFloat(i32* nocapture %0, float %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 @ConvertFromFloat(float %1, i8* %4)
%6 = call i32 @fwrite(i8* %4, i32 4, i32 1, i32* %0)
%7 = icmp ne i32 %6, 1
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int fileExists(const char *file_name) {
  struct stat s = {0};
  return stat(file_name, &s) == 0;
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rax
movl   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fileExists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = bitcast %struct.stat* %3 to i8*
%5 = load i8*, i8** %2
%6 = call i64 @stat(i8* %5, %struct.stat* %3)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fileExists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = call i64 @stat(i8* %0, %struct.stat* %2)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int cos(float);
float circleCoordsX(int a, int radius, float t) { return a + radius * cos(t); }


x86 assembly (clang, -O0):
<circleCoordsX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <cos@plt>
mov    -0x14(%rbp),%ecx
mov    %eax,%edx
mov    -0x10(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circleCoordsX>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <cos@plt>
imul   %ebx,%eax
add    %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @circleCoordsX(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load float, float* %6
%10 = call i32 @cos(float %9)
%11 = mul nsw i32 %8, %10
%12 = add nsw i32 %7, %11
%13 = sitofp i32 %12 to float
ret float %13
}

LLVM IR (-O2):
define float @circleCoordsX(i32 %0, i32 %1, float %2) {
%4 = tail call i32 @cos(float %2)
%5 = mul nsw i32 %4, %1
%6 = add nsw i32 %5, %0
%7 = sitofp i32 %6 to float
ret float %7
}
void dead_state_recv_msg(void *msg) {}


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

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

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

LLVM IR (-O2):
define void @dead_state_recv_msg(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct uio_info_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ uio_single_mmap_test(struct uio_info_t *, int);
void uio_mmap_test(struct uio_info_t *info) {
  int map_num;
  for (map_num = 0; map_num < 5; map_num++)
    uio_single_mmap_test(info, map_num);
}


x86 assembly (clang, -O0):
<uio_mmap_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1147 <uio_mmap_test+0x37>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <uio_single_mmap_test@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <uio_mmap_test+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uio_mmap_test>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <uio_single_mmap_test@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <uio_single_mmap_test@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <uio_single_mmap_test@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <uio_single_mmap_test@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
pop    %rbx
jmp    1030 <uio_single_mmap_test@plt>

LLVM IR (-O0):
%struct.uio_info_t = type { i32 }
define void @uio_mmap_test(%struct.uio_info_t* %0) {
%2 = alloca %struct.uio_info_t*
%3 = alloca i32
store %struct.uio_info_t* %0, %struct.uio_info_t** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load %struct.uio_info_t*, %struct.uio_info_t** %2
%9 = load i32, i32* %3
%10 = call i32 @uio_single_mmap_test(%struct.uio_info_t* %8, i32 %9)
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.uio_info_t = type { i32 }
define void @uio_mmap_test(%struct.uio_info_t* %0) {
%2 = tail call i32 @uio_single_mmap_test(%struct.uio_info_t* %0, i32 0)
%3 = tail call i32 @uio_single_mmap_test(%struct.uio_info_t* %0, i32 1)
%4 = tail call i32 @uio_single_mmap_test(%struct.uio_info_t* %0, i32 2)
%5 = tail call i32 @uio_single_mmap_test(%struct.uio_info_t* %0, i32 3)
%6 = tail call i32 @uio_single_mmap_test(%struct.uio_info_t* %0, i32 4)
ret void
}
/* Variables and functions */
scalar_t__ isalpha(int);
int is_first_letter_of_word(int character, int preceding_character) {
  return isalpha(character) &&
                 ((preceding_character == ' ') || (preceding_character == '-'))
             ? 1
             : 0;
}


x86 assembly (clang, -O0):
<is_first_letter_of_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1157 <is_first_letter_of_word+0x47>
mov    $0x1,%al
cmpl   $0x20,-0x8(%rbp)
mov    %al,-0xa(%rbp)
je     1151 <is_first_letter_of_word+0x41>
cmpl   $0x2d,-0x8(%rbp)
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_first_letter_of_word>:
push   %rbx
mov    %esi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x20,%ebx
sete   %cl
cmp    $0x2d,%ebx
sete   %dl
or     %cl,%dl
and    %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_first_letter_of_word(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 = call i64 @isalpha(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 32
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 45
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ true, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %2
%17 = phi i1 [ false, %2 ], [ %15, %14 ]
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_first_letter_of_word(i32 %0, i32 %1) {
%3 = tail call i64 @isalpha(i32 %0)
%4 = icmp ne i64 %3, 0
%5 = icmp eq i32 %1, 32
%6 = icmp eq i32 %1, 45
%7 = or i1 %5, %6
%8 = and i1 %7, %4
%9 = zext i1 %8 to i32
ret i32 %9
}
void genldr() {}


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

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

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

LLVM IR (-O2):
define void @genldr() {
ret void
}
int jam_isdigit(char ch) { return ((ch >= '0') && (ch <= '9')); }


x86 assembly (clang, -O0):
<jam_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <jam_isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jam_isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @jam_isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @jam_isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int wr_hashcmp_str(const char *s1, const char *s2) {
  return strcmp(s1, s2) == 0;
}


x86 assembly (clang, -O0):
<wr_hashcmp_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @wr_hashcmp_str(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 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @wr_hashcmp_str(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int f(int (*arr[][2])[][3]) { return 0; }


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

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

LLVM IR (-O0):
define i32 @f([2 x [0 x [3 x i32]]*]* %0) {
%2 = alloca [2 x [0 x [3 x i32]]*]*
store [2 x [0 x [3 x i32]]*]* %0, [2 x [0 x [3 x i32]]*]** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @f([2 x [0 x [3 x i32]]*]* nocapture readnone %0) {
ret i32 0
}
float Sleef_expf_u10(float x) { return __builtin_expf(x); }


x86 assembly (clang, -O0):
<Sleef_expf_u10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <expf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_expf_u10>:
jmp    1030 <expf@plt>

LLVM IR (-O0):
define float @Sleef_expf_u10(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @expf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @Sleef_expf_u10(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void stm32w_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<stm32w_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @stm32w_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
unsigned int adler32_rolling_checksum(unsigned int csum, int len, char c1,
                                      char c2) {
  unsigned int s1, s2;
  s1 = csum & 0xffff;
  s2 = csum >> 16;
  s1 -= (c1 - c2);
  s2 -= (len * (c1 + 0) - s1);
  return (s1 & 0xffff) | (s2 << 16);
}


x86 assembly (clang, -O0):
<adler32_rolling_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    %eax,-0x14(%rbp)
movsbl -0x9(%rbp),%ecx
movsbl -0xa(%rbp),%eax
sub    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
movsbl -0x9(%rbp),%eax
add    $0x0,%eax
imul   %eax,%ecx
sub    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
and    $0xffff,%eax
mov    -0x14(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adler32_rolling_checksum>:
movzwl %di,%eax
sub    %edx,%ecx
add    %eax,%ecx
imul   %edx,%esi
movzwl %cx,%edx
mov    %ecx,%eax
sub    %esi,%eax
shl    $0x10,%eax
add    %edi,%eax
and    $0xffff0000,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @adler32_rolling_checksum(i32 %0, i32 %1, i8 signext %2, i8 signext %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%11 = load i32, i32* %5
%12 = and i32 %11, 65535
store i32 %12, i32* %9
%13 = load i32, i32* %5
%14 = lshr i32 %13, 16
store i32 %14, i32* %10
%15 = load i8, i8* %7
%16 = sext i8 %15 to i32
%17 = load i8, i8* %8
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %16, %18
%20 = load i32, i32* %9
%21 = sub i32 %20, %19
store i32 %21, i32* %9
%22 = load i32, i32* %6
%23 = load i8, i8* %7
%24 = sext i8 %23 to i32
%25 = add nsw i32 %24, 0
%26 = mul nsw i32 %22, %25
%27 = load i32, i32* %9
%28 = sub i32 %26, %27
%29 = load i32, i32* %10
%30 = sub i32 %29, %28
store i32 %30, i32* %10
%31 = load i32, i32* %9
%32 = and i32 %31, 65535
%33 = load i32, i32* %10
%34 = shl i32 %33, 16
%35 = or i32 %32, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @adler32_rolling_checksum(i32 %0, i32 %1, i8 signext %2, i8 signext %3) {
%5 = and i32 %0, 65535
%6 = sext i8 %2 to i32
%7 = sext i8 %3 to i32
%8 = sub nsw i32 %7, %6
%9 = add nsw i32 %8, %5
%10 = mul nsw i32 %6, %1
%11 = sub i32 %9, %10
%12 = and i32 %9, 65535
%13 = shl i32 %11, 16
%14 = add i32 %13, %0
%15 = and i32 %14, -65536
%16 = or i32 %15, %12
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ GLXFBConfig;
typedef int /*<<< orphan*/ GLXContext;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
GLXContext create_context_flags(Display *dpy, GLXFBConfig fbconfig, int major,
                                int minor, int contextFlags, int profileMask,
                                Bool direct) {
  return 0;
}


x86 assembly (clang, -O0):
<create_context_flags>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @create_context_flags(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
ret i32 0
}

LLVM IR (-O2):
define i32 @create_context_flags(i32* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
ret i32 0
}
double tandg(x)
double x;
{ return (tancot(x, 0)); }


x86 assembly (clang, -O0):
<tandg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
mov    $0x1,%al
call   1030 <tancot@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tandg>:
push   %rax
xor    %edi,%edi
mov    $0x1,%al
call   1030 <tancot@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tandg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 (double, i32, ...) bitcast (i32 (...)* @tancot to i32 (double, i32, ...)*)(double %3, i32 0)
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @tandg(double %0) {
%2 = tail call i32 (double, i32, ...) bitcast (i32 (...)* @tancot to i32 (double, i32, ...)*)(double %0, i32 0)
%3 = sitofp i32 %2 to double
ret double %3
}
int isc_setostype(int arg1) { return 0; }


x86 assembly (clang, -O0):
<isc_setostype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isc_setostype(i32 %0) {
ret i32 0
}
/* Variables and functions */
double log10(double);
void exponent(void *number) {
  double *value = (double *)number;
  *value = log10(*value);
}


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

x86 assembly (clang, -O2):
<exponent>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
call   1030 <log10@plt>
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @exponent(i8* %0) {
%2 = alloca i8*
%3 = alloca double*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to double*
store double* %5, double** %3
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = call double @log10(double %7)
%9 = load double*, double** %3
store double %8, double* %9
ret void
}

LLVM IR (-O2):
define void @exponent(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
%4 = tail call double @log10(double %3)
store double %4, double* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_random(int);
int /*<<< orphan*/ print_random();
int main(void) {
  gen_random(10);
  print_random();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <gen_random@plt>
mov    $0x0,%al
call   1040 <print_random@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <gen_random@plt>
xor    %eax,%eax
call   1040 <print_random@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @gen_random(i32 10)
%3 = call i32 (...) @print_random()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @gen_random(i32 10)
%2 = tail call i32 (...) @print_random()
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *imalloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<imalloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @imalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @imalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void inNbr2inNbrUnit() {}


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

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

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

LLVM IR (-O2):
define void @inNbr2inNbrUnit() {
ret void
}
/* Variables and functions */
scalar_t__ CallBack1(int, void *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
int ActualToResourceMenuID(int menuID) {
  if (!CheckRunningInMainThread("ActualToResourceMenuID"))
    return 0;
  return (int)CallBack1(62, (void *)menuID);
}


x86 assembly (clang, -O0):
<ActualToResourceMenuID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xece(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    114c <ActualToResourceMenuID+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    115d <ActualToResourceMenuID+0x3d>
movslq -0x8(%rbp),%rsi
mov    $0x3e,%edi
call   1030 <CallBack1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ActualToResourceMenuID>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1142 <ActualToResourceMenuID+0x22>
movslq %ebx,%rsi
mov    $0x3e,%edi
call   1030 <CallBack1@plt>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"ActualToResourceMenuID\00"
define i32 @ActualToResourceMenuID(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i64 @CallBack1(i32 62, i8* %10)
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [23 x i8] c"ActualToResourceMenuID\00"
define i32 @ActualToResourceMenuID(i32 %0) {
%2 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = sext i32 %0 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @CallBack1(i32 62, i8* %6)
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 0, %1 ]
ret i32 %10
}
/* Type definitions */
struct pmd_part {
  int dummy;
};
struct fmdriver_work {
  int dummy;
};
struct driver_pmd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pmd_cmdf2_lfo(struct fmdriver_work *, struct driver_pmd *,
                                 struct pmd_part *);
int /*<<< orphan*/ pmd_part_lfo_flip(struct pmd_part *);
void pmd_cmdbf_lfo2(struct fmdriver_work *work, struct driver_pmd *pmd,
                    struct pmd_part *part) {
  pmd_part_lfo_flip(part);
  pmd_cmdf2_lfo(work, pmd, part);
  pmd_part_lfo_flip(part);
}


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

x86 assembly (clang, -O2):
<pmd_cmdbf_lfo2>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <pmd_part_lfo_flip@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <pmd_cmdf2_lfo@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <pmd_part_lfo_flip@plt>

LLVM IR (-O0):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmdbf_lfo2(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = alloca %struct.fmdriver_work*
%5 = alloca %struct.driver_pmd*
%6 = alloca %struct.pmd_part*
store %struct.fmdriver_work* %0, %struct.fmdriver_work** %4
store %struct.driver_pmd* %1, %struct.driver_pmd** %5
store %struct.pmd_part* %2, %struct.pmd_part** %6
%7 = load %struct.pmd_part*, %struct.pmd_part** %6
%8 = call i32 @pmd_part_lfo_flip(%struct.pmd_part* %7)
%9 = load %struct.fmdriver_work*, %struct.fmdriver_work** %4
%10 = load %struct.driver_pmd*, %struct.driver_pmd** %5
%11 = load %struct.pmd_part*, %struct.pmd_part** %6
%12 = call i32 @pmd_cmdf2_lfo(%struct.fmdriver_work* %9, %struct.driver_pmd* %10, %struct.pmd_part* %11)
%13 = load %struct.pmd_part*, %struct.pmd_part** %6
%14 = call i32 @pmd_part_lfo_flip(%struct.pmd_part* %13)
ret void
}

LLVM IR (-O2):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmdbf_lfo2(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = tail call i32 @pmd_part_lfo_flip(%struct.pmd_part* %2)
%5 = tail call i32 @pmd_cmdf2_lfo(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2)
%6 = tail call i32 @pmd_part_lfo_flip(%struct.pmd_part* %2)
ret void
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
char *strrchr(char *, char);
int filter(const struct dirent *dir) {
  char *p = (char *)&dir->d_name;
  p = strrchr(p, '.');
  return p && !strcmp(p, ".desktop");
}


x86 assembly (clang, -O0):
<filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1171 <filter+0x51>
mov    -0x10(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     114a <filter+0x2a>
lea    0xec9(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [9 x i8] c".desktop\00"
define i32 @filter(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
%3 = alloca i8*
store %struct.dirent* %0, %struct.dirent** %2
%4 = load %struct.dirent*, %struct.dirent** %2
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = bitcast i32* %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @strrchr(i8* %7, i8 signext 46)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i32 @strcmp(i8* %12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br label %16
16: ; preds = %11, %1
%17 = phi i1 [ false, %1 ], [ %15, %11 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [9 x i8] c".desktop\00"
define i32 @filter(%struct.dirent* %0) {
%2 = bitcast %struct.dirent* %0 to i8*
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %2, i8 signext 46)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ Lower(int);
int getchar();
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int main() {
  int c;
  while ((c = getchar()) != EOF) {
    putchar(Lower(c));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     116c <main+0x3c>
mov    -0x8(%rbp),%edi
call   1050 <Lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea9(%rip),%rbx
cmp    (%rbx),%eax
je     1169 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1050 <Lower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @Lower(i32 %8)
%10 = call i32 @putchar(i32 %9)
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 @Lower(i32 %5)
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ _copysign(int, float);
int signbit(float f) { return _copysign(1, f) < 0; }


x86 assembly (clang, -O0):
<signbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <_copysign@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signbit>:
push   %rax
mov    $0x1,%edi
call   1030 <_copysign@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @signbit(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @_copysign(i32 1, float %3)
%5 = icmp slt i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @signbit(float %0) {
%2 = tail call i64 @_copysign(i32 1, float %0)
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void h264sps_set_level(uint8_t *p_h264sps, uint8_t i_level) {
  p_h264sps[6] = i_level;
}


x86 assembly (clang, -O0):
<h264sps_set_level>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264sps_set_level>:
mov    %esi,0x18(%rdi)
ret

LLVM IR (-O0):
define void @h264sps_set_level(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 6
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @h264sps_set_level(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %1, i32* %3
ret void
}
int intCmp(int *a, int *b) {
  if (*a > *b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<intCmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <intCmp+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <intCmp+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intCmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setg   %al
ret

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

LLVM IR (-O2):
define i32 @intCmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ matrix_get_translation(float *, float const, float const,
                                          float const);
int /*<<< orphan*/ matrix_multiply(float *, float *);
float *matrix_translate(float matrix[4 * 4], const float x, const float y,
                        const float z) {
  float matrix_tmp[4 * 4];
  matrix_get_translation(matrix_tmp, x, y, z);
  matrix_multiply(matrix, matrix_tmp);
  return matrix;
}


x86 assembly (clang, -O0):
<matrix_translate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1040 <matrix_get_translation@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <matrix_multiply@plt>
mov    -0x8(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_translate>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <matrix_get_translation@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <matrix_multiply@plt>
mov    %rbx,%rax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float* @matrix_translate(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca [16 x float]
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%11 = load float, float* %6
%12 = load float, float* %7
%13 = load float, float* %8
%14 = call i32 @matrix_get_translation(float* %10, float %11, float %12, float %13)
%15 = load float*, float** %5
%16 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%17 = call i32 @matrix_multiply(float* %15, float* %16)
%18 = load float*, float** %5
ret float* %18
}

LLVM IR (-O2):
define float* @matrix_translate(float* returned %0, float %1, float %2, float %3) {
%5 = alloca [16 x float]
%6 = bitcast [16 x float]* %5 to i8*
%7 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%8 = call i32 @matrix_get_translation(float* %7, float %1, float %2, float %3)
%9 = call i32 @matrix_multiply(float* %0, float* %7)
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ usart3_putc(char);
void task2(void) {
  while (1) {
    usart3_putc('B');
  }
}


x86 assembly (clang, -O0):
<task2>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <task2+0x9>
mov    $0x42,%edi
call   1030 <usart3_putc@plt>
jmp    1119 <task2+0x9>

x86 assembly (clang, -O2):
<task2>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x42,%edi
call   1030 <usart3_putc@plt>
jmp    1120 <task2+0x10>

LLVM IR (-O0):
define void @task2() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @usart3_putc(i8 signext 66)
br label %1
}

LLVM IR (-O2):
define void @task2() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @usart3_putc(i8 signext 66)
br label %1
}
/* Variables and functions */
double drand48();
int check_percent(int percent) {
  double tmp;
  double __cil_tmp3;
  double __cil_tmp4;
  {
    { tmp = drand48(); }
    {
      __cil_tmp3 = (double)percent;
      __cil_tmp4 = __cil_tmp3 / 100.0;
      return (tmp < __cil_tmp4);
    }
  }
}


x86 assembly (clang, -O0):
<check_percent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <drand48@plt>
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_percent>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <drand48@plt>
cvtsi2sd %ebx,%xmm1
divsd  0xeda(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @check_percent(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %2
%6 = call double (...) @drand48()
store double %6, double* %3
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to double
store double %8, double* %4
%9 = load double, double* %4
%10 = fdiv double %9, 1.000000e+02
store double %10, double* %5
%11 = load double, double* %3
%12 = load double, double* %5
%13 = fcmp olt double %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @check_percent(i32 %0) {
%2 = tail call double (...) @drand48()
%3 = sitofp i32 %0 to double
%4 = fdiv double %3, 1.000000e+02
%5 = fcmp olt double %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned short);
__attribute__((no, noclone)) unsigned short f15(unsigned short x,
                                                unsigned short y) {
  unsigned short r = x - y;
  if (y <= r)
    foo(r);
  return r;
}


x86 assembly (clang, -O0):
<f15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
movzwl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jg     114d <f15+0x3d>
movzwl -0x6(%rbp),%edi
call   1030 <foo@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f15>:
push   %rbx
mov    %edi,%ebx
sub    %esi,%ebx
cmp    %si,%bx
jb     1122 <f15+0x12>
movzwl %bx,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @f15(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = sub nsw i32 %7, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = load i16, i16* %5
%15 = zext i16 %14 to i32
%16 = icmp sle i32 %13, %15
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i16, i16* %5
%19 = call i32 @foo(i16 zeroext %18)
br label %20
20: ; preds = %17, %2
%21 = load i16, i16* %5
ret i16 %21
}

LLVM IR (-O2):
define zeroext i16 @f15(i16 zeroext %0, i16 zeroext %1) {
%3 = sub i16 %0, %1
%4 = icmp ult i16 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i16 zeroext %3)
br label %7
7: ; preds = %5, %2
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int fd = open("/dev/crcdev", O_RDWR);
  write(fd, argv[1], strlen(argv[1]));
  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    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    0xeba(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/dev/crcdev\00"
@O_RDWR = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @O_RDWR
%8 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @strlen(i8* %15)
%17 = call i32 @write(i32 %9, i8* %12, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/crcdev\00"
@O_RDWR = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strlen(i8* %6)
%8 = tail call i32 @write(i32 %4, i8* %6, i32 %7)
ret i32 0
}
/* Variables and functions */
int whisperPuts(char const *);
int puts(const char *s) { return whisperPuts(s); }


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

x86 assembly (clang, -O2):
<puts>:
jmp    1030 <whisperPuts@plt>

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

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @whisperPuts(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void snail_cnt_start(void) {
  mbus_remote_register_write(0x3, 0x01,
                             ((0 << 13) | (20 << 5) | (1 << 4) | (9)));
}


x86 assembly (clang, -O0):
<snail_cnt_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x299,%edx
call   1030 <mbus_remote_register_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<snail_cnt_start>:
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x299,%edx
jmp    1030 <mbus_remote_register_write@plt>

LLVM IR (-O0):
define void @snail_cnt_start() {
%1 = call i32 @mbus_remote_register_write(i32 3, i32 1, i32 665)
ret void
}

LLVM IR (-O2):
define void @snail_cnt_start() {
%1 = tail call i32 @mbus_remote_register_write(i32 3, i32 1, i32 665)
ret void
}