xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ DebugPrintf(char *, ...);
int /*<<< orphan*/ strerror(int);
int find_globerr(const char *epath, int eerrno) {
  DebugPrintf("file: glob error while searching for \"%s\": %s\n", epath,
              strerror(eerrno));
  DebugPrintf("Trying to continue anyway...\n");
  return 0;
}


x86 assembly (clang, -O0):
<find_globerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <DebugPrintf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <DebugPrintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_globerr>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <strerror@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <DebugPrintf@plt>
lea    0xeea(%rip),%rdi
xor    %eax,%eax
call   1030 <DebugPrintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"file: glob error while searching for \22%s\22: %s\0A\00"
@.str.1 = [30 x i8] c"Trying to continue anyway...\0A\00"
define i32 @find_globerr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @strerror(i32 %6)
%8 = call i32 (i8*, ...) @DebugPrintf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
%9 = call i32 (i8*, ...) @DebugPrintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"file: glob error while searching for \22%s\22: %s\0A\00"
@.str.1 = [30 x i8] c"Trying to continue anyway...\0A\00"
define i32 @find_globerr(i8* %0, i32 %1) {
%3 = tail call i32 @strerror(i32 %1)
%4 = tail call i32 (i8*, ...) @DebugPrintf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
%5 = tail call i32 (i8*, ...) @DebugPrintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mptp_randomize(unsigned short *);
long mptp_nrand48(unsigned short *rstate) {
  mptp_randomize(rstate);
  return ((long)rstate[2] << 15) + ((long)rstate[1] >> 1);
}


x86 assembly (clang, -O0):
<mptp_nrand48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mptp_randomize@plt>
mov    -0x8(%rbp),%rax
movzwl 0x4(%rax),%eax
shl    $0xf,%rax
mov    -0x8(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
sar    $0x1,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mptp_nrand48>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mptp_randomize@plt>
movzwl 0x4(%rbx),%ecx
shl    $0xf,%rcx
movzwl 0x2(%rbx),%eax
shr    %rax
or     %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @mptp_nrand48(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = call i32 @mptp_randomize(i16* %3)
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 2
%7 = load i16, i16* %6
%8 = zext i16 %7 to i64
%9 = shl i64 %8, 15
%10 = load i16*, i16** %2
%11 = getelementptr inbounds i16, i16* %10, i64 1
%12 = load i16, i16* %11
%13 = zext i16 %12 to i64
%14 = ashr i64 %13, 1
%15 = add nsw i64 %9, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @mptp_nrand48(i16* %0) {
%2 = tail call i32 @mptp_randomize(i16* %0)
%3 = getelementptr inbounds i16, i16* %0, i64 2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i64
%6 = shl nuw nsw i64 %5, 15
%7 = getelementptr inbounds i16, i16* %0, i64 1
%8 = load i16, i16* %7
%9 = lshr i16 %8, 1
%10 = zext i16 %9 to i64
%11 = or i64 %6, %10
ret i64 %11
}
int _is_block_algorithm() { return 0; }


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

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

LLVM IR (-O0):
define i32 @_is_block_algorithm() {
ret i32 0
}

LLVM IR (-O2):
define i32 @_is_block_algorithm() {
ret i32 0
}
/* Variables and functions */
int INT_MIN;
int divide_power2(int x, int k) {
  int sign = !!(x & INT_MIN);
  return (x >> k) + sign;
}


x86 assembly (clang, -O0):
<divide_power2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed4(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_power2>:
mov    %esi,%ecx
mov    %edi,%eax
mov    0x2edd(%rip),%rdx
mov    (%rdx),%edx
and    %edi,%edx
sar    %cl,%eax
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @divide_power2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* @INT_MIN
%8 = and i32 %6, %7
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = ashr i32 %13, %14
%16 = load i32, i32* %5
%17 = add nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @divide_power2(i32 %0, i32 %1) {
%3 = load i32, i32* @INT_MIN
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = ashr i32 %0, %1
%8 = add nsw i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "wclarge [-d] in_file\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"wclarge [-d] in_file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"wclarge [-d] in_file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ccpvector_free_(float **ppVector) { free((void *)ppVector); }


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

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

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

LLVM IR (-O2):
define void @ccpvector_free_(float** nocapture %0) {
%2 = bitcast float** %0 to i8*
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dma(void *, void const *, unsigned short, int);
void dmacpy32(void *dest, const void *buf, unsigned short len) {
  dma(dest, buf, len,
      ((1 << 25) | (2 << 6) | (1 << 10) | (1 << 9) | (2 << 11) | (2 << 13) |
       (1 << 4) | (3 << 16)));
}


x86 assembly (clang, -O0):
<dmacpy32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2035690,%ecx
movzwl -0x12(%rbp),%edx
call   1030 <dma@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmacpy32>:
mov    $0x2035690,%ecx
jmp    1030 <dma@plt>

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

LLVM IR (-O2):
define void @dmacpy32(i8* %0, i8* %1, i16 zeroext %2) {
%4 = tail call i32 @dma(i8* %0, i8* %1, i16 zeroext %2, i32 33773200)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void read_uc_flash(uint32_t address, uint8_t *data, uint32_t nb_byte) {}


x86 assembly (clang, -O0):
<read_uc_flash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @read_uc_flash(i32 %0, i32* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aesni_crypt_ecb(int, unsigned char *, int /*<<< orphan*/,
                                   unsigned char const *, unsigned char *);
void aeshw_decrypt_ecb(int nr, unsigned char *rk, const unsigned char input[16],
                       unsigned char output[16]) {
  aesni_crypt_ecb(nr, rk, 0, input, output);
}


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

x86 assembly (clang, -O2):
<aeshw_decrypt_ecb>:
mov    %rcx,%r8
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <aesni_crypt_ecb@plt>

LLVM IR (-O0):
define void @aeshw_decrypt_ecb(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @aesni_crypt_ecb(i32 %9, i8* %10, i32 0, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @aeshw_decrypt_ecb(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @aesni_crypt_ecb(i32 %0, i8* %1, i32 0, i8* %2, i8* %3)
ret void
}
int eb_bcd_to_int(unsigned char src, int *tgt) {
  if ((src & 0x0F) > 0x09 || ((src >> 4) & 0x0F) > 0x09) {
    *tgt = (int)(0xFF);
    return 0;
  } else {
    *tgt = (int)((((src & 0xF0) >> 4) * 10) + (src & 0x0F));
    return 1;
  }
}


x86 assembly (clang, -O0):
<eb_bcd_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x5(%rbp),%eax
and    $0xf,%eax
cmp    $0x9,%eax
jg     1131 <eb_bcd_to_int+0x31>
movzbl -0x5(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
cmp    $0x9,%eax
jle    1147 <eb_bcd_to_int+0x47>
mov    -0x10(%rbp),%rax
movl   $0xff,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    116c <eb_bcd_to_int+0x6c>
movzbl -0x5(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
imul   $0xa,%eax,%ecx
movzbl -0x5(%rbp),%eax
and    $0xf,%eax
add    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb_bcd_to_int>:
mov    %edi,%eax
and    $0xf,%eax
cmp    $0xa,%eax
setae  %cl
cmp    $0xa0,%dil
setae  %dl
or     %cl,%dl
shr    $0x4,%edi
lea    (%rdi,%rdi,4),%ecx
lea    (%rax,%rcx,2),%eax
test   %dl,%dl
mov    $0xff,%ecx
cmove  %eax,%ecx
xor    $0x1,%dl
movzbl %dl,%eax
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define i32 @eb_bcd_to_int(i8 zeroext %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32*
store i8 %0, i8* %4
store i32* %1, i32** %5
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = and i32 %7, 15
%9 = icmp sgt i32 %8, 9
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = ashr i32 %12, 4
%14 = and i32 %13, 15
%15 = icmp sgt i32 %14, 9
br i1 %15, label %16, label %18
16: ; preds = %10, %2
%17 = load i32*, i32** %5
store i32 255, i32* %17
store i32 0, i32* %3
br label %29
18: ; preds = %10
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = and i32 %20, 240
%22 = ashr i32 %21, 4
%23 = mul nsw i32 %22, 10
%24 = load i8, i8* %4
%25 = zext i8 %24 to i32
%26 = and i32 %25, 15
%27 = add nsw i32 %23, %26
%28 = load i32*, i32** %5
store i32 %27, i32* %28
store i32 1, i32* %3
br label %29
29: ; preds = %18, %16
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @eb_bcd_to_int(i8 zeroext %0, i32* nocapture writeonly %1) {
%3 = zext i8 %0 to i32
%4 = and i32 %3, 15
%5 = icmp ugt i32 %4, 9
%6 = icmp ugt i8 %0, -97
%7 = or i1 %6, %5
%8 = lshr i32 %3, 4
%9 = mul nuw nsw i32 %8, 10
%10 = add nuw nsw i32 %9, %4
%11 = select i1 %7, i32 255, i32 %10
%12 = or i1 %6, %5
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
store i32 %11, i32* %1
ret i32 %14
}
/* Variables and functions */
int syscall(int, char const *, void *);
int init_module(const char *name, void *image) {
  return syscall(128, name, image);
}


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

x86 assembly (clang, -O2):
<init_module>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x80,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @init_module(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 i32 @syscall(i32 128, i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @init_module(i8* %0, i8* %1) {
%3 = tail call i32 @syscall(i32 128, i8* %0, i8* %1)
ret i32 %3
}
int mcd(int x, int y) {
  while (x != y) {
    if (x > y) {
      x = x - y;
    } else {
      y = y - x;
    }
  }
  return x;
}


x86 assembly (clang, -O0):
<mcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113e <mcd+0x3e>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1130 <mcd+0x30>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <mcd+0x39>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <mcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcd>:
mov    %edi,%eax
cmp    %esi,%edi
je     1127 <mcd+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %eax,%esi
mov    $0x0,%edx
cmovl  %esi,%edx
mov    %eax,%edi
cmovl  %ecx,%edi
sub    %edx,%eax
sub    %edi,%esi
cmp    %esi,%eax
jne    1110 <mcd+0x10>
ret

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

LLVM IR (-O2):
define i32 @mcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = icmp slt i32 %5, %6
%8 = select i1 %7, i32 %5, i32 0
%9 = sub nsw i32 %6, %8
%10 = select i1 %7, i32 0, i32 %6
%11 = sub nsw i32 %5, %10
%12 = icmp eq i32 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ %0, %2 ], [ %9, %4 ]
ret i32 %14
}
double fdim(double x, double y) {
  double z;
  z = x - y;
  return z;
}


x86 assembly (clang, -O0):
<fdim>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdim>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fdim(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @fdim(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedXX0(int);
int /*<<< orphan*/ LSR16(int /*<<< orphan*/, int);
void Op5EM0X0(void) { LSR16(AbsoluteIndexedXX0(3), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op5EM0X0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <LSR16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op5EM0X0>:
push   %rax
mov    $0x3,%edi
call   1030 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <LSR16@plt>

LLVM IR (-O0):
define void @Op5EM0X0() {
%1 = call i32 @AbsoluteIndexedXX0(i32 3)
%2 = call i32 @LSR16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op5EM0X0() {
%1 = tail call i32 @AbsoluteIndexedXX0(i32 3)
%2 = tail call i32 @LSR16(i32 %1, i32 16777215)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ niceprint(char *);
void rockfall(void) {
  niceprint("Loose rocks fall from the ceiling above. Each character must "
            "succeed on a DC 12 "
            "Dexterity saving throw or be hit by a chunk of falling stone for "
            "2d6 bludgeoning "
            "damage. If the characters are traveling in a boat or raft, their "
            "vessel takes 2d6 "
            "bludgeoning damage for each successful save; in other words, each "
            "rock that "
            "misses a character hits the boat or raft instead. Roll the damage "
            "for each rock "
            "striking a vessel separately to see if it overcomes the vessel's "
            "damage threshold.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [484 x i8] c"Loose rocks fall from the ceiling above. Each character must succeed on a DC 12 Dexterity saving throw or be hit by a chunk of falling stone for 2d6 bludgeoning damage. If the characters are traveling in a boat or raft, their vessel takes 2d6 bludgeoning damage for each successful save; in other words, each rock that misses a character hits the boat or raft instead. Roll the damage for each rock striking a vessel separately to see if it overcomes the vessel's damage threshold.\0A\0A\00"
define void @rockfall() {
%1 = call i32 @niceprint(i8* getelementptr inbounds ([484 x i8], [484 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [484 x i8] c"Loose rocks fall from the ceiling above. Each character must succeed on a DC 12 Dexterity saving throw or be hit by a chunk of falling stone for 2d6 bludgeoning damage. If the characters are traveling in a boat or raft, their vessel takes 2d6 bludgeoning damage for each successful save; in other words, each rock that misses a character hits the boat or raft instead. Roll the damage for each rock striking a vessel separately to see if it overcomes the vessel's damage threshold.\0A\0A\00"
define void @rockfall() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([484 x i8], [484 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR85_get(void) { return U_WMRCORENONE_get("U_WMR85"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR85\00"
define i32 @U_WMR85_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int buffer__aligned_size(int desired_size) {
  int aligned_size = desired_size / (4096);
  aligned_size *= (4096);
  if (aligned_size < desired_size)
    aligned_size += (4096);
  return aligned_size;
}


x86 assembly (clang, -O0):
<buffer__aligned_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1000,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xc,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1135 <buffer__aligned_size+0x35>
mov    -0x8(%rbp),%eax
add    $0x1000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer__aligned_size>:
lea    0xfff(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0xfffff000,%ecx
lea    0x1000(%rcx),%eax
cmp    %edi,%ecx
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @buffer__aligned_size(i32 %0) {
%2 = sdiv i32 %0, 4096
%3 = shl nsw i32 %2, 12
%4 = icmp slt i32 %3, %0
%5 = add nsw i32 %3, 4096
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
void OPLL_close(void) {}


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

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

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

LLVM IR (-O2):
define void @OPLL_close() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f8(long j) {
  if ((j & ((1UL << (8)) - 1)) >= ((1UL << ((8) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
cmp    $0x82,%rax
jb     1139 <f8+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
and    $0xfe,%edi
cmp    $0x82,%edi
jae    111f <f8+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f8(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 255
%5 = icmp uge i64 %4, 130
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f8(i64 %0) {
%2 = and i64 %0, 254
%3 = icmp ugt i64 %2, 129
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
int ncompar(const void *pa, const void *pb) {
  int a, b;
  a = *(int *)pa;
  b = *(int *)pb;
  if (a < b)
    return -1;
  if (a > b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ncompar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <ncompar+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <ncompar+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <ncompar+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <ncompar+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncompar>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ncompar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
char *Settings_GetString(char *KeyName) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @Settings_GetString(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *_free(const void *p) {
  if (p != NULL)
    free((void *)p);
  return NULL;
}


x86 assembly (clang, -O0):
<_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_free>:
test   %rdi,%rdi
je     111f <_free+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret i8* null
}
/* Variables and functions */
void function(int a, int b, int c) {
  char buffer1[5];
  char buffer2[10];
  int *ret;
  ret = buffer1 + 12;
  (*ret) += 8;
}


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

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

LLVM IR (-O0):
define void @function(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [5 x i8]
%8 = alloca [10 x i8]
%9 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%11 = getelementptr inbounds i8, i8* %10, i64 12
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %9
%13 = load i32*, i32** %9
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 8
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @function(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
int _kill(pid_t pid, int sig) {
  (void)pid;
  (void)sig;
  errno = EPERM;
  return -1;
}


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EPERM = global i32 0
@errno = global i32 0
define i32 @_kill(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 = load i32, i32* @EPERM
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EPERM = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EPERM
store i32 %3, i32* @errno
ret i32 -1
}
int test_imm_8Cint16_reg(short val) {
  return ((val) & (0x8C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Cint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x8c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_8Cint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 140
%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_8Cint16_reg(i16 signext %0) {
%2 = and i16 %0, 140
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ get_mixer_value();
int /*<<< orphan*/ set_mixer(scalar_t__);
void adjust_mixer(const int diff) { set_mixer(get_mixer_value() + diff); }


x86 assembly (clang, -O0):
<adjust_mixer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_mixer_value@plt>
mov    %rax,%rdi
movslq -0x4(%rbp),%rax
add    %rax,%rdi
call   1040 <set_mixer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_mixer>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_mixer_value@plt>
movslq %ebx,%rdi
add    %rax,%rdi
pop    %rbx
jmp    1040 <set_mixer@plt>

LLVM IR (-O0):
define void @adjust_mixer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @get_mixer_value()
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %3, %5
%7 = call i32 @set_mixer(i64 %6)
ret void
}

LLVM IR (-O2):
define void @adjust_mixer(i32 %0) {
%2 = tail call i64 (...) @get_mixer_value()
%3 = sext i32 %0 to i64
%4 = add nsw i64 %2, %3
%5 = tail call i32 @set_mixer(i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MD2String(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void makekey(char *cle, char *pass, char *buffer) {
  char source[1024];
  strcpy(source, cle);
  strcat(source, pass);
  MD2String(buffer, source);
}


x86 assembly (clang, -O0):
<makekey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x18(%rbp),%rdi
lea    -0x420(%rbp),%rsi
call   1040 <MD2String@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makekey>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <MD2String@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @makekey(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = call i32 @strcat(i8* %11, i8* %12)
%14 = load i8*, i8** %6
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%16 = call i32 @MD2String(i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @makekey(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @strcpy(i8* %5, i8* %0)
%7 = call i32 @strcat(i8* %5, i8* %1)
%8 = call i32 @MD2String(i8* %2, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void bar_cl(int x) { printf("%d\n", x); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @bar_cl(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Nokia Bluetooth firmware analyzer\n"
         "Usage:\n");
  printf("\tnokfw [options] <file>\n");
  printf("Options:\n"
         "\t-h, --help             Show help options\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Nokia Bluetooth firmware analyzer\0AUsage:\0A\00"
@.str.1 = [25 x i8] c"\09nokfw [options] <file>\0A\00"
@.str.2 = [52 x i8] c"Options:\0A\09-h, --help Show help options\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"Nokia Bluetooth firmware analyzer\0AUsage:\00"
@str.3 = [24 x i8] c"\09nokfw [options] <file>\00"
@str.4 = [51 x i8] c"Options:\0A\09-h, --help Show help options\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char prompt_manual(void) {
  char temp_value = '\0';
  printf("Is the baking manual (y = yes, n = no) ?");
  scanf(" %c", &temp_value);
  return temp_value;
}


x86 assembly (clang, -O0):
<prompt_manual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_manual>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Is the baking manual (y = yes, n = no) ?\00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @prompt_manual() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
@.str = [41 x i8] c"Is the baking manual (y = yes, n = no) ?\00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @prompt_manual() {
%1 = alloca i8
store i8 0, i8* %1
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
ret i8 %4
}
int test_imm_55uint16_mem(unsigned short *val) {
  return ((*val) & (-0x55 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_55uint16_mem>:
movzwl (%rdi),%eax
test   $0xffab,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_55uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -85
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void findVimTags(void) {
  const unsigned char *line;
  line = '\0';
  parseVimFile(line);
}


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

x86 assembly (clang, -O2):
<findVimTags>:
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <parseVimFile@plt>

LLVM IR (-O0):
define void @findVimTags() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @parseVimFile to i32 (i8*, ...)*)(i8* %2)
ret void
}

LLVM IR (-O2):
define void @findVimTags() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @parseVimFile to i32 (i8*, ...)*)(i8* null)
ret void
}
/* Variables and functions */
scalar_t__ ceilf(float);
int _ceil(float n) { return (int)ceilf(n); }


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

x86 assembly (clang, -O2):
<_ceil>:
jmp    1030 <ceilf@plt>

LLVM IR (-O0):
define i32 @_ceil(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @ceilf(float %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @_ceil(float %0) {
%2 = tail call i64 @ceilf(float %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EX_SOFTWARE;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *);
void *malloc(int);
void *do_malloc(int size) {
  void *ptr;
  ptr = malloc(size);
  if (ptr == NULL)
    errx(EX_SOFTWARE, "Could not allocate memory");
  return (ptr);
}


x86 assembly (clang, -O0):
<do_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1157 <do_malloc+0x37>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <do_malloc+0x23>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@EX_SOFTWARE = global i32 0
@.str = [26 x i8] c"Could not allocate memory\00"
define i8* @do_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @EX_SOFTWARE
%10 = call i32 @errx(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@EX_SOFTWARE = global i32 0
@.str = [26 x i8] c"Could not allocate memory\00"
define noalias i8* @do_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EX_SOFTWARE
%6 = tail call i32 @errx(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ send_cmd(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void send_cmd_noarg(int cmd_code) { send_cmd(cmd_code, NULL, 0); }


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

x86 assembly (clang, -O2):
<send_cmd_noarg>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <send_cmd@plt>

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

LLVM IR (-O2):
define void @send_cmd_noarg(i32 %0) {
%2 = tail call i32 @send_cmd(i32 %0, i32* null, i32 0)
ret void
}
void test_3(void) {}


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

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

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

LLVM IR (-O2):
define void @test_3() {
ret void
}
/* Type definitions */
struct bson_kv {
  int dummy;
};
struct bson_info {
  int dummy;
};

/* Variables and functions */
int serialize_element(struct bson_info *, struct bson_kv *);
int bson_serialize(struct bson_info *bson_info, struct bson_kv *value) {
  return serialize_element(bson_info, value);
}


x86 assembly (clang, -O0):
<bson_serialize>:
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 <serialize_element@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bson_serialize>:
jmp    1030 <serialize_element@plt>

LLVM IR (-O0):
%struct.bson_info = type { i32 }
%struct.bson_kv = type { i32 }
define i32 @bson_serialize(%struct.bson_info* %0, %struct.bson_kv* %1) {
%3 = alloca %struct.bson_info*
%4 = alloca %struct.bson_kv*
store %struct.bson_info* %0, %struct.bson_info** %3
store %struct.bson_kv* %1, %struct.bson_kv** %4
%5 = load %struct.bson_info*, %struct.bson_info** %3
%6 = load %struct.bson_kv*, %struct.bson_kv** %4
%7 = call i32 @serialize_element(%struct.bson_info* %5, %struct.bson_kv* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.bson_info = type { i32 }
%struct.bson_kv = type { i32 }
define i32 @bson_serialize(%struct.bson_info* %0, %struct.bson_kv* %1) {
%3 = tail call i32 @serialize_element(%struct.bson_info* %0, %struct.bson_kv* %1)
ret i32 %3
}
int map(int x, int in_min, int in_max, int out_min, int out_max) {
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}


x86 assembly (clang, -O0):
<map>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map>:
mov    %r8d,%eax
mov    %edx,%r8d
sub    %esi,%edi
sub    %ecx,%eax
imul   %edi,%eax
sub    %esi,%r8d
cltd
idiv   %r8d
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @map(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
%14 = load i32, i32* %10
%15 = load i32, i32* %9
%16 = sub nsw i32 %14, %15
%17 = mul nsw i32 %13, %16
%18 = load i32, i32* %8
%19 = load i32, i32* %7
%20 = sub nsw i32 %18, %19
%21 = sdiv i32 %17, %20
%22 = load i32, i32* %9
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @map(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sub nsw i32 %0, %1
%7 = sub nsw i32 %4, %3
%8 = mul nsw i32 %7, %6
%9 = sub nsw i32 %2, %1
%10 = sdiv i32 %8, %9
%11 = add nsw i32 %10, %3
ret i32 %11
}
/* Type definitions */
typedef int fpu_control_t;
typedef int fexcept_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ _FPU_GETCW(int);
int fegetexceptflag(fexcept_t *flagp, int excepts) {
  fpu_control_t temp;
  _FPU_GETCW(temp);
  *flagp = temp & excepts & FE_ALL_EXCEPT;
  return 0;
}


x86 assembly (clang, -O0):
<fegetexceptflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0x10(%rbp),%ecx
and    -0xc(%rbp),%ecx
mov    0x2eac(%rip),%rax
and    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fegetexceptflag>:
push   %rbx
mov    %rdi,%rbx
call   1030 <_FPU_GETCW@plt>
movl   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @fegetexceptflag(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %5
%7 = call i32 @_FPU_GETCW(i32 %6)
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %8, %9
%11 = load i32, i32* @FE_ALL_EXCEPT
%12 = and i32 %10, %11
%13 = load i32*, i32** %3
store i32 %12, i32* %13
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @fegetexceptflag(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @_FPU_GETCW(i32 undef)
store i32 0, i32* %0
ret i32 0
}
__attribute__((always_)) __attribute__((no_instrument_function)) void
rcu_read_lock_sched_notrace(void) {
  do {
  } while (0);
  (void)0;
}


x86 assembly (clang, -O0):
<rcu_read_lock_sched_notrace>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <rcu_read_lock_sched_notrace+0x9>
jmp    110e <rcu_read_lock_sched_notrace+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rcu_read_lock_sched_notrace() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @rcu_read_lock_sched_notrace() {
ret void
}