xunge/DecIR huggingface dataset:
/* Type definitions */
typedef unsigned int uint8_t;
typedef unsigned int const uint32_t;

/* Variables and functions */
uint32_t be32toh_ptr(const uint8_t *p) {
  return p[3] | (p[2] << 8U) | (p[1] << 16U) | (p[0] << 24U);
}


x86 assembly (clang, -O0):
<be32toh_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32toh_ptr>:
mov    0x8(%rdi),%ecx
shl    $0x8,%ecx
or     0xc(%rdi),%ecx
mov    (%rdi),%eax
mov    0x4(%rdi),%edx
shl    $0x10,%edx
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @be32toh_ptr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = shl i32 %13, 16
%15 = or i32 %10, %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = shl i32 %18, 24
%20 = or i32 %15, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @be32toh_ptr(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %7, %10
%12 = load i32, i32* %0
%13 = shl i32 %12, 24
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int sprintf(char *, char *, unsigned int);
char *print_syscall(unsigned int syscall, char *output) {
  int len;
  len = sprintf(output, "0x%X", syscall);
  return output + len;
}


x86 assembly (clang, -O0):
<print_syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_syscall>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"0x%X\00"
define i8* @print_syscall(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i32, i32* %3
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
ret i8* %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"0x%X\00"
define i8* @print_syscall(i32 %0, i8* writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ uart_write(unsigned char);
void putchar(unsigned char c) { uart_write(c); }


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

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

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

LLVM IR (-O2):
define void @putchar(i8 zeroext %0) {
%2 = tail call i32 @uart_write(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ url_exit();
void quit_confirm_cb(void *opaque, char *reply) {
  if (!reply)
    return;
  if (reply[0] == 'y' || reply[0] == 'Y')
    url_exit();
  free(reply);
}


x86 assembly (clang, -O0):
<quit_confirm_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1140 <quit_confirm_cb+0x20>
jmp    1170 <quit_confirm_cb+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x79,%eax
je     1160 <quit_confirm_cb+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x59,%eax
jne    1167 <quit_confirm_cb+0x47>
mov    $0x0,%al
call   1040 <url_exit@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quit_confirm_cb>:
test   %rsi,%rsi
je     1141 <quit_confirm_cb+0x21>
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%al
or     $0x20,%al
cmp    $0x79,%al
jne    1138 <quit_confirm_cb+0x18>
xor    %eax,%eax
call   1040 <url_exit@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @quit_confirm_cb(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
br label %25
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 121
br i1 %13, label %20, label %14
14: ; preds = %8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 89
br i1 %19, label %20, label %22
20: ; preds = %14, %8
%21 = call i32 (...) @url_exit()
br label %22
22: ; preds = %20, %14
%23 = load i8*, i8** %4
%24 = call i32 @free(i8* %23)
br label %25
25: ; preds = %22, %7
ret void
}

LLVM IR (-O2):
define void @quit_confirm_cb(i8* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = load i8, i8* %1
switch i8 %5, label %8 [
i8 121, label %6
i8 89, label %6
]
6: ; preds = %4, %4
%7 = tail call i32 (...) @url_exit()
br label %8
8: ; preds = %4, %6
%9 = tail call i32 @free(i8* %1)
br label %10
10: ; preds = %2, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ stderr;
void ArrayFreeElement(void *element) {
  char **_element = (char **)element;
  {
    if (*_element != NULL) {
      free(*_element);
    } else {
      {
        fprintf(stderr, "error: free()\n");
        exit(1);
      };
    }
  };
}


x86 assembly (clang, -O0):
<ArrayFreeElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1163 <ArrayFreeElement+0x33>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
jmp    1182 <ArrayFreeElement+0x52>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ArrayFreeElement>:
push   %rax
mov    (%rdi),%rdi
test   %rdi,%rdi
je     113f <ArrayFreeElement+0xf>
pop    %rax
jmp    1030 <free@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"error: free()\0A\00"
define void @ArrayFreeElement(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
store i8** %5, i8*** %3
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = call i32 @free(i8* %11)
br label %17
13: ; preds = %1
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %9
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"error: free()\0A\00"
define void @ArrayFreeElement(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(i8* %3)
ret void
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int draw_block4x4_bptc_float_shared(unsigned char const *, unsigned int *,
                                    int /*<<< orphan*/, int);
int draw_block4x4_bptc_float(const unsigned char *bitstring,
                             unsigned int *image_buffer, int flags) {
  return draw_block4x4_bptc_float_shared(bitstring, image_buffer, 0, flags);
}


x86 assembly (clang, -O0):
<draw_block4x4_bptc_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
xor    %edx,%edx
call   1030 <draw_block4x4_bptc_float_shared@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_block4x4_bptc_float>:
mov    %edx,%ecx
xor    %edx,%edx
jmp    1030 <draw_block4x4_bptc_float_shared@plt>

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

LLVM IR (-O2):
define i32 @draw_block4x4_bptc_float(i8* %0, i32* %1, i32 %2) {
%4 = tail call i32 @draw_block4x4_bptc_float_shared(i8* %0, i32* %1, i32 0, i32 %2)
ret i32 %4
}
int sys$lkwset(struct _va_range *inadr, struct _va_range *retadr,
               unsigned int acmode) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(acmode);
    register long int _a2 asm("rsi") = (long)(retadr);
    register long int _a1 asm("rdi") = (long)(inadr);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(58), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$lkwset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x3a,%rax
int    $0x81
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$lkwset>:
mov    %edx,%edx
mov    $0x3a,%rax
int    $0x81
ret

LLVM IR (-O0):
%struct._va_range = type opaque
define i32 @"sys$lkwset"(%struct._va_range* %0, %struct._va_range* %1, i32 %2) {
%4 = alloca %struct._va_range*
%5 = alloca %struct._va_range*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._va_range* %0, %struct._va_range** %4
store %struct._va_range* %1, %struct._va_range** %5
store i32 %2, i32* %6
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
store i64 %13, i64* %8
%14 = load %struct._va_range*, %struct._va_range** %5
%15 = ptrtoint %struct._va_range* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._va_range*, %struct._va_range** %4
%17 = ptrtoint %struct._va_range* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 58, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._va_range = type opaque
define i32 @"sys$lkwset"(%struct._va_range* %0, %struct._va_range* %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = ptrtoint %struct._va_range* %1 to i64
%6 = ptrtoint %struct._va_range* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 58, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int mem_read_raml(int, void *);
uint32_t ps2_read_shadow_raml(uint32_t addr, void *priv) {
  addr = (addr & 0x1ffff) + 0xe0000;
  return mem_read_raml(addr, priv);
}


x86 assembly (clang, -O0):
<ps2_read_shadow_raml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1ffff,%eax
add    $0xe0000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <mem_read_raml@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps2_read_shadow_raml>:
and    $0x1ffff,%edi
or     $0xe0000,%edi
jmp    1030 <mem_read_raml@plt>

LLVM IR (-O0):
define i32 @ps2_read_shadow_raml(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 131071
%7 = add nsw i32 %6, 917504
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i32 @mem_read_raml(i32 %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ps2_read_shadow_raml(i32 %0, i8* %1) {
%3 = and i32 %0, 131071
%4 = or i32 %3, 917504
%5 = tail call i32 @mem_read_raml(i32 %4, i8* %1)
ret i32 %5
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *createFilename(char *d, char *f) {
  char *result = malloc(strlen(d) + strlen(f) + 1);
  strcpy(result, d);
  strcat(result, f);
  return result;
}


x86 assembly (clang, -O0):
<createFilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createFilename>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @createFilename(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
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @createFilename(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
int fun(int n) {
  if (n == 1)
    return 1;
  return (fun(n - 1) + 1) * 2;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <fun+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1145 <fun+0x35>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fun@plt>
add    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     112c <fun+0x1c>
push   %rax
add    $0xffffffff,%edi
call   1030 <fun@plt>
add    %eax,%eax
add    $0x2,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @fun(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %9, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @fun(i32 %6)
%8 = shl i32 %7, 1
%9 = add i32 %8, 2
br label %3
}
int test_imm_87uint8_reg(unsigned char val) {
  return ((val) & (-0x87 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_87uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff79,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_87uint8_reg>:
test   $0x79,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_87uint8_reg(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, -135
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_87uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 121
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *special_textcat_Init(char const *, char *);
extern void *textcat_Init(const char *conffile) {
  return special_textcat_Init(conffile, "");
}


x86 assembly (clang, -O0):
<textcat_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <special_textcat_Init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textcat_Init>:
lea    0xee9(%rip),%rsi
jmp    1030 <special_textcat_Init@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @textcat_Init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @special_textcat_Init(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @textcat_Init(i8* %0) {
%2 = tail call i8* @special_textcat_Init(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void familia(void) {
  printf("\nMeus bits...digo, minha familia vai bem!\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"\0AMeus bits...digo, minha familia vai bem!\0A\00"
define void @familia() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"\0AMeus bits...digo, minha familia vai bem!\00"
define void @familia() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned char uint16_t;

/* Variables and functions */
int extract_uint16(unsigned char *p, int halfwordid) {
  uint16_t r;
  unsigned char *b = p;
  b += (halfwordid - 1) * 2;
  r = (b[0] << 8) + b[1];
  return ((int)r);
}


x86 assembly (clang, -O0):
<extract_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_uint16>:
lea    (%rsi,%rsi,1),%eax
add    $0xfffffffe,%eax
cltq
movzbl 0x1(%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @extract_uint16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %6
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = mul nsw i32 %9, 2
%11 = load i8*, i8** %6
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8*, i8** %6
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = add nsw i32 %18, %22
%24 = trunc i32 %23 to i8
store i8 %24, i8* %5
%25 = load i8, i8* %5
%26 = zext i8 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @extract_uint16(i8* nocapture %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = add i32 %3, -2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
ret i32 %9
}
int smsdvb_debugfs_create(struct smsdvb_client_t *client) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.smsdvb_client_t = type opaque
define i32 @smsdvb_debugfs_create(%struct.smsdvb_client_t* nocapture readnone %0) {
ret i32 0
}
void FSMC_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @FSMC_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
void freelist(char **list) {
  char **cp = list;
  while (*cp) {
    free(*cp++);
  }
  free(list);
}


x86 assembly (clang, -O0):
<freelist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114e <freelist+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rdi
call   1030 <free@plt>
jmp    1124 <freelist+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freelist>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <freelist+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <freelist+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freelist(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %10, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = bitcast i8* %5 to i8**
%9 = tail call i32 @free(i8** %8)
%10 = load i8*, i8** %7
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @free(i8** %0)
ret void
}
void I2CSlaveIntClearEx(unsigned int baseAdd, unsigned int intFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x28)))) = intFlag;
}


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

x86 assembly (clang, -O2):
<I2CSlaveIntClearEx>:
add    $0x28,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @I2CSlaveIntClearEx(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 = add i32 %6, 40
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntClearEx(i32 %0, i32 %1) {
%3 = add i32 %0, 40
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ timestamp_seconds(int /*<<< orphan*/);
int /*<<< orphan*/ timestamp_useconds(int /*<<< orphan*/);
void timestamp_to_timeval(int64_t v, struct timeval *tv) {
  tv->tv_sec = timestamp_seconds(v);
  tv->tv_usec = timestamp_useconds(v);
}


x86 assembly (clang, -O0):
<timestamp_to_timeval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <timestamp_seconds@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%edi
call   1030 <timestamp_useconds@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp_to_timeval>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <timestamp_seconds@plt>
mov    %eax,0x4(%rbx)
mov    %ebp,%edi
call   1030 <timestamp_useconds@plt>
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @timestamp_to_timeval(i32 %0, %struct.timeval* %1) {
%3 = alloca i32
%4 = alloca %struct.timeval*
store i32 %0, i32* %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i32, i32* %3
%6 = call i32 @timestamp_seconds(i32 %5)
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = call i32 @timestamp_useconds(i32 %9)
%11 = load %struct.timeval*, %struct.timeval** %4
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 0
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @timestamp_to_timeval(i32 %0, %struct.timeval* nocapture writeonly %1) {
%3 = tail call i32 @timestamp_seconds(i32 %0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
store i32 %3, i32* %4
%5 = tail call i32 @timestamp_useconds(i32 %0)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
store i32 %5, i32* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
scalar_t__ sg_get_unaligned_le16(int /*<<< orphan*/ const *);
int sg_get_unaligned_le32(void const *);
uint64_t sg_get_unaligned_le48(const void *p) {
  return (uint64_t)sg_get_unaligned_le16((const uint8_t *)p + 4) << 32 |
         sg_get_unaligned_le32(p);
}


x86 assembly (clang, -O0):
<sg_get_unaligned_le48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1040 <sg_get_unaligned_le16@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sg_get_unaligned_le32@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_get_unaligned_le48>:
push   %rbx
mov    %rdi,%rbx
add    $0x10,%rdi
call   1040 <sg_get_unaligned_le16@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <sg_get_unaligned_le32@plt>

LLVM IR (-O0):
define i32 @sg_get_unaligned_le48(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 4
%6 = call i64 @sg_get_unaligned_le16(i32* %5)
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 32
%9 = load i8*, i8** %2
%10 = call i32 @sg_get_unaligned_le32(i8* %9)
%11 = or i32 %8, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @sg_get_unaligned_le48(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 16
%3 = bitcast i8* %2 to i32*
%4 = tail call i64 @sg_get_unaligned_le16(i32* %3)
%5 = tail call i32 @sg_get_unaligned_le32(i8* %0)
ret i32 poison
}
/* Type definitions */
struct b_tonegen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setMIDIDrawBar(struct b_tonegen *, int, unsigned char);
void setDrawbar10(void *d, unsigned char v) {
  setMIDIDrawBar((struct b_tonegen *)d, 10, v);
}


x86 assembly (clang, -O0):
<setDrawbar10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
movzbl -0x9(%rbp),%edx
call   1030 <setMIDIDrawBar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDrawbar10>:
mov    %esi,%edx
mov    $0xa,%esi
jmp    1030 <setMIDIDrawBar@plt>

LLVM IR (-O0):
%struct.b_tonegen = type { i32 }
define void @setDrawbar10(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.b_tonegen*
%7 = load i8, i8* %4
%8 = call i32 @setMIDIDrawBar(%struct.b_tonegen* %6, i32 10, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
%struct.b_tonegen = type { i32 }
define void @setDrawbar10(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_tonegen*
%4 = tail call i32 @setMIDIDrawBar(%struct.b_tonegen* %3, i32 10, i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void foo(int *sp, int cnt) {
  int *p, *top;
  top = sp;
  sp -= cnt;
  for (p = sp; p <= top; p++)
    if (*p < 2)
      exit(0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
ja     1181 <foo+0x71>
mov    -0x18(%rbp),%rax
cmpl   $0x2,(%rax)
jge    116b <foo+0x5b>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1170 <foo+0x60>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    1149 <foo+0x39>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
test   %esi,%esi
js     113e <foo+0x2e>
mov    %esi,%ecx
shl    $0x2,%rcx
mov    %rdi,%rax
sub    %rcx,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpl   $0x1,(%rax)
jle    1140 <foo+0x30>
add    $0x4,%rax
cmp    %rdi,%rax
jbe    1130 <foo+0x20>
pop    %rax
ret
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @foo(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
store i32* %7, i32** %6
%8 = load i32, i32* %4
%9 = load i32*, i32** %3
%10 = sext i32 %8 to i64
%11 = sub i64 0, %10
%12 = getelementptr inbounds i32, i32* %9, i64 %11
store i32* %12, i32** %3
%13 = load i32*, i32** %3
store i32* %13, i32** %5
br label %14
14: ; preds = %25, %2
%15 = load i32*, i32** %5
%16 = load i32*, i32** %6
%17 = icmp ule i32* %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = icmp slt i32 %20, 2
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @exit(i32 0)
unreachable
24: ; preds = %18
br label %25
25: ; preds = %24
%26 = load i32*, i32** %5
%27 = getelementptr inbounds i32, i32* %26, i32 1
store i32* %27, i32** %5
br label %14
28: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @foo(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = sub nsw i64 0, %5
%7 = getelementptr inbounds i32, i32* %0, i64 %6
br label %10
8: ; preds = %10
%9 = icmp ugt i32* %14, %0
br i1 %9, label %17, label %10
10: ; preds = %4, %8
%11 = phi i32* [ %14, %8 ], [ %7, %4 ]
%12 = load i32, i32* %11
%13 = icmp slt i32 %12, 2
%14 = getelementptr inbounds i32, i32* %11, i64 1
br i1 %13, label %15, label %8
15: ; preds = %10
%16 = tail call i32 @exit(i32 0)
unreachable
17: ; preds = %8, %2
ret void
}
int cpt_dump_ubc(struct cpt_context *ctx) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.cpt_context = type opaque
define i32 @cpt_dump_ubc(%struct.cpt_context* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Report(char *);
int astGEBuf(void) {
  Report("astGEBuf");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"astGEBuf\00"
define i32 @astGEBuf() {
%1 = tail call i32 @Report(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int fun1338() { return 1338; }


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

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

LLVM IR (-O0):
define i32 @fun1338() {
ret i32 1338
}

LLVM IR (-O2):
define i32 @fun1338() {
ret i32 1338
}
unsigned int sha1_rol(unsigned int value, unsigned int bits) {
  return ((value) << bits) | (value >> (32 - bits));
}


x86 assembly (clang, -O0):
<sha1_rol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha1_rol>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @sha1_rol(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @sha1_rol(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct vector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vector_remove_range(struct vector *, size_t, size_t);
void vector_remove(struct vector *v, size_t index) {
  vector_remove_range(v, index, index + 1);
}


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

x86 assembly (clang, -O2):
<vector_remove>:
lea    0x1(%rsi),%rdx
jmp    1030 <vector_remove_range@plt>

LLVM IR (-O0):
%struct.vector = type { i32 }
define void @vector_remove(%struct.vector* %0, i64 %1) {
%3 = alloca %struct.vector*
%4 = alloca i64
store %struct.vector* %0, %struct.vector** %3
store i64 %1, i64* %4
%5 = load %struct.vector*, %struct.vector** %3
%6 = load i64, i64* %4
%7 = load i64, i64* %4
%8 = add i64 %7, 1
%9 = call i32 @vector_remove_range(%struct.vector* %5, i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
%struct.vector = type { i32 }
define void @vector_remove(%struct.vector* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i32 @vector_remove_range(%struct.vector* %0, i64 %1, i64 %3)
ret void
}
unsigned int ft_strlcpy(char *dest, char *src, unsigned int size) {
  return (0);
}


x86 assembly (clang, -O0):
<ft_strlcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_strlcpy(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rrotate(uint8_t op1, uint8_t op2) {
  return (op1 >> op2) | (op1 << (8 - op2));
}


x86 assembly (clang, -O0):
<rrotate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrotate>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
mov    $0x8,%dl
sub    %cl,%dl
mov    %edx,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rrotate(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 8, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rrotate(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 8, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
int test_imm_70uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x70 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_70uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x70,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_70uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 112
%7 = icmp ne i64 %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_70uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 481036337152
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = (input[0UL] - 51238316UL) - (unsigned short)47038;
    local1 = 0UL;
    while (local1 < 1UL) {
      local1++;
    }
    output[0UL] = ((state[0UL] << (unsigned short)1) |
                   (state[0UL] >> (unsigned short)15)) ^
                  (unsigned short)57088;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
sub    $0x30dd5ac,%rax
sub    $0xb7be,%rax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x1,%rax
jae    1148 <RandomFunc+0x48>
mov    -0x14(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x14(%rbp)
jmp    1129 <RandomFunc+0x29>
movzwl -0x12(%rbp),%eax
shl    $0x1,%eax
movzwl -0x12(%rbp),%ecx
sar    $0xf,%ecx
or     %ecx,%eax
xor    $0xdf00,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0x7296,%eax
rol    %ax
xor    $0xdf00,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i64
%11 = sub i64 %10, 51238316
%12 = sub i64 %11, 47038
%13 = trunc i64 %12 to i16
%14 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %13, i16* %14
store i16 0, i16* %6
br label %15
15: ; preds = %19, %2
%16 = load i16, i16* %6
%17 = zext i16 %16 to i64
%18 = icmp ult i64 %17, 1
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i16, i16* %6
%21 = add i16 %20, 1
store i16 %21, i16* %6
br label %15
22: ; preds = %15
%23 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%24 = load i16, i16* %23
%25 = zext i16 %24 to i32
%26 = shl i32 %25, 1
%27 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%28 = load i16, i16* %27
%29 = zext i16 %28 to i32
%30 = ashr i32 %29, 15
%31 = or i32 %26, %30
%32 = xor i32 %31, 57088
%33 = trunc i32 %32 to i16
%34 = load i16*, i16** %4
%35 = getelementptr inbounds i16, i16* %34, i64 0
store i16 %33, i16* %35
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, 29334
%5 = tail call i16 @llvm.fshl.i16(i16 %4, i16 %4, i16 1)
%6 = xor i16 %5, -8448
store i16 %6, i16* %1
ret void
}
void modem_probe_init(char *modname, char *runname) { return; }


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

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

LLVM IR (-O0):
define void @modem_probe_init(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @modem_probe_init(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
long roundl(long double);
long lroundl(long double x) { return roundl(x); }


x86 assembly (clang, -O0):
<lroundl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <roundl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lroundl>:
jmp    1030 <roundl@plt>

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

LLVM IR (-O2):
define i64 @lroundl(x86_fp80 %0) {
%2 = tail call i64 @roundl(x86_fp80 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo8(float, double);
void foo7(float a0, double a1) { foo8(a0 + 1.0f, a1 + 2.0); }


x86 assembly (clang, -O0):
<foo7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
movss  0xede(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
call   1030 <foo8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo7>:
addss  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm1
jmp    1030 <foo8@plt>

LLVM IR (-O0):
define void @foo7(float %0, double %1) {
%3 = alloca float
%4 = alloca double
store float %0, float* %3
store double %1, double* %4
%5 = load float, float* %3
%6 = fadd float %5, 1.000000e+00
%7 = load double, double* %4
%8 = fadd double %7, 2.000000e+00
%9 = call i32 @foo8(float %6, double %8)
ret void
}

LLVM IR (-O2):
define void @foo7(float %0, double %1) {
%3 = fadd float %0, 1.000000e+00
%4 = fadd double %1, 2.000000e+00
%5 = tail call i32 @foo8(float %3, double %4)
ret void
}
/* Variables and functions */
double log(scalar_t__);
scalar_t__ sqrt(double);
double genacsch(double num) {
  return (log(1.0 / num + sqrt(1.0 / (num * num) + 1.0)));
}


x86 assembly (clang, -O0):
<genacsch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xeaf(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xea3(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genacsch>:
push   %rax
movsd  0xed7(%rip),%xmm2
movapd %xmm2,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mulsd  %xmm0,%xmm0
movapd %xmm2,%xmm1
divsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @genacsch(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = fdiv double 1.000000e+00, %7
%9 = fadd double %8, 1.000000e+00
%10 = call i64 @sqrt(double %9)
%11 = sitofp i64 %10 to double
%12 = fadd double %4, %11
%13 = fptosi double %12 to i64
%14 = call double @log(i64 %13)
ret double %14
}

LLVM IR (-O2):
define double @genacsch(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fmul double %0, %0
%4 = fdiv double 1.000000e+00, %3
%5 = fadd double %4, 1.000000e+00
%6 = tail call i64 @sqrt(double %5)
%7 = sitofp i64 %6 to double
%8 = fadd double %2, %7
%9 = fptosi double %8 to i64
%10 = tail call double @log(i64 %9)
ret double %10
}