xunge/DecIR huggingface dataset:
void UARTSmartCardEnable(unsigned long ulBase) {
  unsigned long ulVal;
  ;

  ;
  ulVal = (*((volatile unsigned long *)(ulBase + 0x0000002C)));
  ulVal &= ~(0x00000080 | 0x00000004 | 0x00000002 | 0x00000060);
  ulVal |= 0x00000060 | 0x00000002 | 0x00000004 | 0x00000008;
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) = ulVal;
  (*((volatile unsigned long *)(ulBase + 0x00000030))) |= 0x00000008;
}


x86 assembly (clang, -O0):
<UARTSmartCardEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffffffffffffff19,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
or     $0x6e,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x2c(%rax)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rcx
or     $0x8,%rcx
mov    %rcx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTSmartCardEnable>:
mov    $0xffffffffffffff11,%rax
and    0x2c(%rdi),%rax
or     $0x6e,%rax
mov    %rax,0x2c(%rdi)
orq    $0x8,0x30(%rdi)
ret

LLVM IR (-O0):
define void @UARTSmartCardEnable(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 44
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = and i64 %8, -231
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = or i64 %10, 110
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = load i64, i64* %2
%14 = add i64 %13, 44
%15 = inttoptr i64 %14 to i64*
store volatile i64 %12, i64* %15
%16 = load i64, i64* %2
%17 = add i64 %16, 48
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = or i64 %19, 8
store volatile i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @UARTSmartCardEnable(i64 %0) {
%2 = add i64 %0, 44
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -239
%6 = or i64 %5, 110
store volatile i64 %6, i64* %3
%7 = add i64 %0, 48
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, 8
store volatile i64 %10, i64* %8
ret void
}
int test_imm_B8uint8_mem(unsigned char *val) {
  return ((*val) & (0xB8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B8uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 184
%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_B8uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -72
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dash();
int /*<<< orphan*/ dot();
void sQ() {
  dash();
  dash();
  dot();
  dash();
  cBreak();
}


x86 assembly (clang, -O0):
<sQ>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1050 <cBreak@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sQ>:
push   %rax
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cBreak@plt>

LLVM IR (-O0):
define void @sQ() {
%1 = call i32 (...) @dash()
%2 = call i32 (...) @dash()
%3 = call i32 (...) @dot()
%4 = call i32 (...) @dash()
%5 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @sQ() {
%1 = tail call i32 (...) @dash()
%2 = tail call i32 (...) @dash()
%3 = tail call i32 (...) @dot()
%4 = tail call i32 (...) @dash()
%5 = tail call i32 (...) @cBreak()
ret void
}
int brightness(const int rgb[3]) {
  return ((rgb[0] * 299) + (rgb[1] * 587) + (rgb[2] * 114)) / 1000;
}


x86 assembly (clang, -O0):
<brightness>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x12b,(%rax),%eax
mov    -0x8(%rbp),%rcx
imul   $0x24b,0x4(%rcx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
imul   $0x72,0x8(%rcx),%ecx
add    %ecx,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<brightness>:
imul   $0x12b,(%rdi),%eax
imul   $0x24b,0x4(%rdi),%ecx
add    %eax,%ecx
imul   $0x72,0x8(%rdi),%eax
add    %ecx,%eax
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @brightness(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 299
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 587
%11 = add nsw i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = mul nsw i32 %14, 114
%16 = add nsw i32 %11, %15
%17 = sdiv i32 %16, 1000
ret i32 %17
}

LLVM IR (-O2):
define i32 @brightness(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 299
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 587
%7 = add nsw i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 114
%11 = add nsw i32 %7, %10
%12 = sdiv i32 %11, 1000
ret i32 %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ADC_Two_In(void) {
  (*((volatile uint32_t *)0x400380A0)) =
      ((*((volatile uint32_t *)0x400380A0)) & 0xFFFFFFF0) + 2;
  uint32_t data;
  (*((volatile uint32_t *)0x40038028)) = 0x0008;
  while (((*((volatile uint32_t *)0x40038004)) & 0x08) == 0) {
  };
  data = (*((volatile uint32_t *)0x400380A8)) & 0xFFF;
  (*((volatile uint32_t *)0x4003800C)) = 0x0008;
  return data;
}


x86 assembly (clang, -O0):
<ADC_Two_In>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400380a0,%eax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
add    $0x2,%ecx
mov    $0x400380a0,%eax
mov    %ecx,(%rax)
mov    $0x40038028,%eax
movl   $0x8,(%rax)
mov    $0x40038004,%eax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    113b <ADC_Two_In+0x3b>
jmp    1123 <ADC_Two_In+0x23>
mov    $0x400380a8,%eax
mov    (%rax),%eax
and    $0xfff,%eax
mov    %eax,-0x4(%rbp)
mov    $0x4003800c,%eax
movl   $0x8,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_Two_In>:
mov    0x400380a0,%eax
and    $0xfffffff0,%eax
or     $0x2,%eax
mov    %eax,0x400380a0
movl   $0x8,0x40038028
nop
testl  $0x8,0x40038004
je     1120 <ADC_Two_In+0x20>
mov    $0xfff,%eax
and    0x400380a8,%eax
movl   $0x8,0x4003800c
ret

LLVM IR (-O0):
define i32 @ADC_Two_In() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1073971360 to i32*)
%3 = and i32 %2, -16
%4 = add i32 %3, 2
store volatile i32 %4, i32* inttoptr (i64 1073971360 to i32*)
store volatile i32 8, i32* inttoptr (i64 1073971240 to i32*)
br label %5
5: ; preds = %9, %0
%6 = load volatile i32, i32* inttoptr (i64 1073971204 to i32*)
%7 = and i32 %6, 8
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load volatile i32, i32* inttoptr (i64 1073971368 to i32*)
%12 = and i32 %11, 4095
store i32 %12, i32* %1
store volatile i32 8, i32* inttoptr (i64 1073971212 to i32*)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @ADC_Two_In() {
%1 = load volatile i32, i32* inttoptr (i64 1073971360 to i32*)
%2 = and i32 %1, -16
%3 = or i32 %2, 2
store volatile i32 %3, i32* inttoptr (i64 1073971360 to i32*)
store volatile i32 8, i32* inttoptr (i64 1073971240 to i32*)
br label %4
4: ; preds = %4, %0
%5 = load volatile i32, i32* inttoptr (i64 1073971204 to i32*)
%6 = and i32 %5, 8
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = load volatile i32, i32* inttoptr (i64 1073971368 to i32*)
%10 = and i32 %9, 4095
store volatile i32 8, i32* inttoptr (i64 1073971212 to i32*)
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int s_isdir(mode_t mode) { return S_ISDIR(mode); }


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

x86 assembly (clang, -O2):
<s_isdir>:
jmp    1030 <S_ISDIR@plt>

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

LLVM IR (-O2):
define i32 @s_isdir(i32 %0) {
%2 = tail call i32 @S_ISDIR(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
scalar_t__ mpz_cmp(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_int64(int /*<<< orphan*/, int /*<<< orphan*/);
bool mpz_eq_int64(mpz_t z, int64_t x) {
  mpz_t aux;
  bool eq;
  mpz_init(aux);
  mpz_set_int64(aux, x);
  eq = (mpz_cmp(z, aux) == 0);
  mpz_clear(aux);
  return eq;
}


x86 assembly (clang, -O0):
<mpz_eq_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <mpz_init@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mpz_set_int64@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <mpz_cmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <mpz_clear@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpz_eq_int64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <mpz_init@plt>
mov    %ebx,%esi
call   1030 <mpz_set_int64@plt>
mov    %ebp,%edi
call   1050 <mpz_cmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
call   1060 <mpz_clear@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mpz_eq_int64(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* %5
%8 = call i32 @mpz_init(i32 %7)
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @mpz_set_int64(i32 %9, i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = call i64 @mpz_cmp(i32 %12, i32 %13)
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = call i32 @mpz_clear(i32 %17)
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
define i32 @mpz_eq_int64(i32 %0, i32 %1) {
%3 = tail call i32 @mpz_init(i32 undef)
%4 = tail call i32 @mpz_set_int64(i32 undef, i32 %1)
%5 = tail call i64 @mpz_cmp(i32 %0, i32 undef)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @mpz_clear(i32 undef)
ret i32 %7
}
/* Variables and functions */
scalar_t__ strtoxl(char const *, char **, int, int /*<<< orphan*/);
long int strtol(const char *p, char **end, int base) {
  return (long)strtoxl(p, end, base, 0);
}


x86 assembly (clang, -O0):
<strtol>:
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),%edx
xor    %ecx,%ecx
call   1030 <strtoxl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtol>:
xor    %ecx,%ecx
jmp    1030 <strtoxl@plt>

LLVM IR (-O0):
define i64 @strtol(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
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i64 @strtoxl(i8* %7, i8** %8, i32 %9, i32 0)
ret i64 %10
}

LLVM IR (-O2):
define i64 @strtol(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @strtoxl(i8* %0, i8** %1, i32 %2, i32 0)
ret i64 %4
}
int machswap(void) {
  char *ctest;
  int itest;
  itest = 1;
  ctest = (char *)&itest;
  if (*ctest)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<machswap>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112c <machswap+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <machswap+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @machswap() {
ret i32 1
}
/* Variables and functions */
void start_firey_return(void) {}


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

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

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

LLVM IR (-O2):
define void @start_firey_return() {
ret void
}
/* Variables and functions */
scalar_t__ chaz_CC_is_msvc();
char *chaz_Util_join(char *, char *, char const *, int /*<<< orphan*/ *);
char *chaz_CC_format_ranlib_command(const char *target) {
  if (chaz_CC_is_msvc()) {
    return NULL;
  }
  return chaz_Util_join(" ", "ranlib", target, NULL);
}


x86 assembly (clang, -O0):
<chaz_CC_format_ranlib_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <chaz_CC_is_msvc@plt>
cmp    $0x0,%rax
je     114a <chaz_CC_format_ranlib_command+0x2a>
movq   $0x0,-0x8(%rbp)
jmp    1169 <chaz_CC_format_ranlib_command+0x49>
mov    -0x10(%rbp),%rdx
lea    0xeab(%rip),%rdi
lea    0xea6(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <chaz_Util_join@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaz_CC_format_ranlib_command>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <chaz_CC_is_msvc@plt>
test   %rax,%rax
je     1134 <chaz_CC_format_ranlib_command+0x14>
xor    %eax,%eax
pop    %rbx
ret
lea    0xec5(%rip),%rdi
lea    0xec0(%rip),%rsi
mov    %rbx,%rdx
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <chaz_Util_join@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [7 x i8] c"ranlib\00"
define i8* @chaz_CC_format_ranlib_command(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @chaz_CC_is_msvc()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @chaz_Util_join(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32* null)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [7 x i8] c"ranlib\00"
define i8* @chaz_CC_format_ranlib_command(i8* %0) {
%2 = tail call i64 (...) @chaz_CC_is_msvc()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @chaz_Util_join(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32* null)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
scalar_t__ munmap(void *, size_t);
int /*<<< orphan*/ unix_error(char *);
void Munmap(void *start, size_t length) {
  if (munmap(start, length) < 0)
    unix_error("munmap error");
}


x86 assembly (clang, -O0):
<Munmap>:
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   1040 <munmap@plt>
cmp    $0x0,%rax
jge    1153 <Munmap+0x33>
lea    0xeb2(%rip),%rdi
call   1030 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Munmap>:
push   %rax
call   1040 <munmap@plt>
test   %rax,%rax
js     112d <Munmap+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <unix_error@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"munmap error\00"
define void @Munmap(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i64 @munmap(i8* %5, i64 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"munmap error\00"
define void @Munmap(i8* %0, i64 %1) {
%3 = tail call i64 @munmap(i8* %0, i64 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t z80_cb_a0_res_4(uint8_t value) { return value & 0xef; }


x86 assembly (clang, -O0):
<z80_cb_a0_res_4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xef,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<z80_cb_a0_res_4>:
mov    %edi,%eax
and    $0xef,%eax
ret

LLVM IR (-O0):
define i32 @z80_cb_a0_res_4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 239
ret i32 %4
}

LLVM IR (-O2):
define i32 @z80_cb_a0_res_4(i32 %0) {
%2 = and i32 %0, 239
ret i32 %2
}
const char *cbm_get_sysfs_path(void) { return "/sys"; }


x86 assembly (clang, -O0):
<cbm_get_sysfs_path>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbm_get_sysfs_path>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"/sys\00"
define i8* @cbm_get_sysfs_path() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"/sys\00"
define i8* @cbm_get_sysfs_path() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ radix(int, int, unsigned int *, unsigned int *);
void radixsort(unsigned int *source, unsigned int *temp, int n) {
  radix(0, n, source, temp);
  radix(1, n, temp, source);
  radix(2, n, source, temp);
  radix(3, n, temp, source);
}


x86 assembly (clang, -O0):
<radixsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %edi,%edi
call   1030 <radix@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%edi
call   1030 <radix@plt>
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x2,%edi
call   1030 <radix@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x3,%edi
call   1030 <radix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radixsort>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
mov    %edx,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <radix@plt>
mov    $0x1,%edi
mov    %ebx,%esi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <radix@plt>
mov    $0x2,%edi
mov    %ebx,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <radix@plt>
mov    $0x3,%edi
mov    %ebx,%esi
mov    %r14,%rdx
mov    %r15,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <radix@plt>

LLVM IR (-O0):
define void @radixsort(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
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32*, i32** %5
%10 = call i32 @radix(i32 0, i32 %7, i32* %8, i32* %9)
%11 = load i32, i32* %6
%12 = load i32*, i32** %5
%13 = load i32*, i32** %4
%14 = call i32 @radix(i32 1, i32 %11, i32* %12, i32* %13)
%15 = load i32, i32* %6
%16 = load i32*, i32** %4
%17 = load i32*, i32** %5
%18 = call i32 @radix(i32 2, i32 %15, i32* %16, i32* %17)
%19 = load i32, i32* %6
%20 = load i32*, i32** %5
%21 = load i32*, i32** %4
%22 = call i32 @radix(i32 3, i32 %19, i32* %20, i32* %21)
ret void
}

LLVM IR (-O2):
define void @radixsort(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @radix(i32 0, i32 %2, i32* %0, i32* %1)
%5 = tail call i32 @radix(i32 1, i32 %2, i32* %1, i32* %0)
%6 = tail call i32 @radix(i32 2, i32 %2, i32* %0, i32* %1)
%7 = tail call i32 @radix(i32 3, i32 %2, i32* %1, i32* %0)
ret void
}
void swift_allocBox() {}


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

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

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

LLVM IR (-O2):
define void @swift_allocBox() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ calculate(int, char **);
int main(int argc, char **argv) {
  if (argc == 1)
    return 0;
  calculate(argc, argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    113c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    114f <main+0x3f>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <calculate@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
je     111f <main+0xf>
push   %rax
call   1030 <calculate@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @calculate(i32 %0, i8** %1)
br label %6
6: ; preds = %2, %4
ret i32 0
}
void file_endtrans(struct onak_dbctx *dbctx) { return; }


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

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

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

LLVM IR (-O2):
%struct.onak_dbctx = type opaque
define void @file_endtrans(%struct.onak_dbctx* nocapture %0) {
ret void
}
int http_parse_language(char const *str, char const *end) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @http_parse_language(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
int valid_portnr(int portnr) {
  if ((portnr >= 0) && (portnr <= 65535))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<valid_portnr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112a <valid_portnr+0x2a>
cmpl   $0xffff,-0x8(%rbp)
jg     112a <valid_portnr+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <valid_portnr+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_portnr>:
xor    %eax,%eax
cmp    $0x10000,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @valid_portnr(i32 %0) {
%2 = icmp ult i32 %0, 65536
%3 = zext i1 %2 to i32
ret i32 %3
}
void set2(int *b) { *b = 13; }


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

x86 assembly (clang, -O2):
<set2>:
movl   $0xd,(%rdi)
ret

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

LLVM IR (-O2):
define void @set2(i32* nocapture writeonly %0) {
store i32 13, i32* %0
ret void
}
/* Variables and functions */
long floor(double);
double harm(long);
double o_harm(long n) { return harm(n) - 0.5 * harm(floor((double)n / 2.0)); }


x86 assembly (clang, -O0):
<o_harm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <harm@plt>
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <floor@plt>
mov    %rax,%rdi
call   1030 <harm@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xe9a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<o_harm>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <harm@plt>
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %rbx,%xmm0
mulsd  0xebd(%rip),%xmm0
call   1040 <floor@plt>
mov    %rax,%rdi
call   1030 <harm@plt>
mulsd  0xeb0(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @o_harm(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call double @harm(i64 %3)
%5 = load i64, i64* %2
%6 = sitofp i64 %5 to double
%7 = fdiv double %6, 2.000000e+00
%8 = call i64 @floor(double %7)
%9 = call double @harm(i64 %8)
%10 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %9, double %4)
ret double %10
}

LLVM IR (-O2):
define double @o_harm(i64 %0) {
%2 = tail call double @harm(i64 %0)
%3 = sitofp i64 %0 to double
%4 = fmul double %3, 5.000000e-01
%5 = tail call i64 @floor(double %4)
%6 = tail call double @harm(i64 %5)
%7 = tail call double @llvm.fmuladd.f64(double %6, double -5.000000e-01, double %2)
ret double %7
}
/* Variables and functions */
int fastlz1_compress(void const *, int, void *);
int fastlz2_compress(void const *, int, void *);
int fastlz_compress(const void *input, int length, void *output) {
  if (length < 65536)
    return fastlz1_compress(input, length, output);
  return fastlz2_compress(input, length, output);
}


x86 assembly (clang, -O0):
<fastlz_compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x10000,-0x14(%rbp)
jge    1158 <fastlz_compress+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <fastlz1_compress@plt>
mov    %eax,-0x4(%rbp)
jmp    116b <fastlz_compress+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <fastlz2_compress@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastlz_compress>:
cmp    $0xffff,%esi
jg     112d <fastlz_compress+0xd>
jmp    1030 <fastlz1_compress@plt>
jmp    1040 <fastlz2_compress@plt>

LLVM IR (-O0):
define i32 @fastlz_compress(i8* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 65536
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = load i8*, i8** %7
%14 = call i32 @fastlz1_compress(i8* %11, i32 %12, i8* %13)
store i32 %14, i32* %4
br label %20
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = load i32, i32* %6
%18 = load i8*, i8** %7
%19 = call i32 @fastlz2_compress(i8* %16, i32 %17, i8* %18)
store i32 %19, i32* %4
br label %20
20: ; preds = %15, %10
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @fastlz_compress(i8* %0, i32 %1, i8* %2) {
%4 = icmp slt i32 %1, 65536
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @fastlz1_compress(i8* %0, i32 %1, i8* %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @fastlz2_compress(i8* %0, i32 %1, i8* %2)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int get_current_pid();
int /*<<< orphan*/ printf(char *, int);
int sys_hello(void) {
  printf("process %d says hello!\n", get_current_pid());
  return 0;
}


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

x86 assembly (clang, -O2):
<sys_hello>:
push   %rax
xor    %eax,%eax
call   1030 <get_current_pid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"process %d says hello!\0A\00"
define i32 @sys_hello() {
%1 = call i32 (...) @get_current_pid()
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"process %d says hello!\0A\00"
define i32 @sys_hello() {
%1 = tail call i32 (...) @get_current_pid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void ff_hevc_put_hevc_qpel_h24_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h24_10_avx2() {
ret void
}
void UARTFlowControlSet(unsigned long ulBase, unsigned long ulMode) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000030))) =
      (((*((volatile unsigned long *)(ulBase + 0x00000030))) &
        ~(0x00008000 | 0x00004000)) |
       ulMode);
}


x86 assembly (clang, -O0):
<UARTFlowControlSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rcx
and    $0xffffffffffff3fff,%rcx
or     -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFlowControlSet>:
mov    $0xffffffffffff3fff,%rax
and    0x30(%rdi),%rax
or     %rsi,%rax
mov    %rax,0x30(%rdi)
ret

LLVM IR (-O0):
define void @UARTFlowControlSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 48
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -49153
%10 = load i64, i64* %4
%11 = or i64 %9, %10
%12 = load i64, i64* %3
%13 = add i64 %12, 48
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
ret void
}

LLVM IR (-O2):
define void @UARTFlowControlSet(i64 %0, i64 %1) {
%3 = add i64 %0, 48
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -49153
%7 = or i64 %6, %1
store volatile i64 %7, i64* %4
ret void
}
/* Variables and functions */
int fct1();
int fct2();
int fct(unsigned nb) {
  if ((nb >> 5) != 0)
    return fct1();
  else
    return fct2();
}


x86 assembly (clang, -O0):
<fct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x5,%eax
cmp    $0x0,%eax
je     1149 <fct+0x29>
mov    $0x0,%al
call   1040 <fct1@plt>
mov    %eax,-0x4(%rbp)
jmp    1153 <fct+0x33>
mov    $0x0,%al
call   1030 <fct2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fct>:
xor    %eax,%eax
cmp    $0x20,%edi
jae    112c <fct+0xc>
jmp    1030 <fct2@plt>
jmp    1040 <fct1@plt>

LLVM IR (-O0):
define i32 @fct(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = lshr i32 %4, 5
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @fct1()
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = call i32 (...) @fct2()
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @fct(i32 %0) {
%2 = icmp ult i32 %0, 32
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @fct1()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @fct2()
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void *_wmo_read_any_from_file_malloc(int /*<<< orphan*/ *, int *,
                                     int /*<<< orphan*/, int);
void *wmo_read_bufr_from_file_malloc(FILE *f, int *err) {
  return _wmo_read_any_from_file_malloc(f, err, 0, 1);
}


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

x86 assembly (clang, -O2):
<wmo_read_bufr_from_file_malloc>:
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <_wmo_read_any_from_file_malloc@plt>

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

LLVM IR (-O2):
define i8* @wmo_read_bufr_from_file_malloc(i32* %0, i32* %1) {
%3 = tail call i8* @_wmo_read_any_from_file_malloc(i32* %0, i32* %1, i32 0, i32 1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern char *__progname;
  fprintf(stderr, "usage: %s [-cmrs] [-Pprinter] [-pprice] [user ...]\n",
          __progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%rdx
lea    0xec2(%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
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"usage: %s [-cmrs] [-Pprinter] [-pprice] [user ...]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"usage: %s [-cmrs] [-Pprinter] [-pprice] [user ...]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int bar(int x, int z) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
size_t utilities_round_size_upward(size_t s, size_t mod) {
  size_t v = s % mod;
  if (v == 0)
    return s;
  else
    return s + mod - v;
}


x86 assembly (clang, -O0):
<utilities_round_size_upward>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1134 <utilities_round_size_upward+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1144 <utilities_round_size_upward+0x44>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilities_round_size_upward>:
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1116 <utilities_round_size_upward+0x16>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    111c <utilities_round_size_upward+0x1c>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
add    %rdi,%rsi
sub    %rdx,%rsi
test   %rdx,%rdx
cmove  %rdi,%rsi
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @utilities_round_size_upward(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = icmp eq i64 %3, 0
%5 = add i64 %1, %0
%6 = sub i64 %5, %3
%7 = select i1 %4, i64 %0, i64 %6
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ hash;

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, unsigned char const *, int);
unsigned int sha1hash(const unsigned char *sha1) {
  unsigned int hash;
  memcpy(&hash, sha1, sizeof(hash));
  return hash;
}


x86 assembly (clang, -O0):
<sha1hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha1hash>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @sha1hash(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int divide_power2(int, int);
int mul5div8(int x) { return divide_power2((x << 2) + x, 1 << 3); }


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

x86 assembly (clang, -O2):
<mul5div8>:
lea    (%rdi,%rdi,4),%edi
mov    $0x8,%esi
jmp    1030 <divide_power2@plt>

LLVM IR (-O0):
define i32 @mul5div8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 2
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
%7 = call i32 @divide_power2(i32 %6, i32 8)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mul5div8(i32 %0) {
%2 = mul i32 %0, 5
%3 = tail call i32 @divide_power2(i32 %2, i32 8)
ret i32 %3
}
void RTSemRWRequestReadNoResumeDebug(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo26() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
int /*<<< orphan*/ set_halt_until_mbus_rx();
int /*<<< orphan*/ set_halt_until_mbus_tx();
void flash_turn_off() {
  set_halt_until_mbus_rx();
  mbus_remote_register_write(0x9, 0x11, 0x00003D);
  set_halt_until_mbus_tx();
}


x86 assembly (clang, -O0):
<flash_turn_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <set_halt_until_mbus_rx@plt>
mov    $0x9,%edi
mov    $0x11,%esi
mov    $0x3d,%edx
call   1050 <mbus_remote_register_write@plt>
mov    $0x0,%al
call   1040 <set_halt_until_mbus_tx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_turn_off>:
push   %rax
xor    %eax,%eax
call   1030 <set_halt_until_mbus_rx@plt>
mov    $0x9,%edi
mov    $0x11,%esi
mov    $0x3d,%edx
call   1050 <mbus_remote_register_write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <set_halt_until_mbus_tx@plt>

LLVM IR (-O0):
define void @flash_turn_off() {
%1 = call i32 (...) @set_halt_until_mbus_rx()
%2 = call i32 @mbus_remote_register_write(i32 9, i32 17, i32 61)
%3 = call i32 (...) @set_halt_until_mbus_tx()
ret void
}

LLVM IR (-O2):
define void @flash_turn_off() {
%1 = tail call i32 (...) @set_halt_until_mbus_rx()
%2 = tail call i32 @mbus_remote_register_write(i32 9, i32 17, i32 61)
%3 = tail call i32 (...) @set_halt_until_mbus_tx()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void on_exit_fn(int x, void *arg) { printf("on_exit function called\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"on_exit function called\0A\00"
define void @on_exit_fn(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"on_exit function called\00"
define void @on_exit_fn(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
void balloon_sysfs_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @balloon_sysfs_exit() {
ret void
}
void showboard(b) const char *b;
{ tty_showboard(b); }


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

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

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

LLVM IR (-O2):
define void @showboard(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @tty_showboard to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("hello world from process %d\n", getpid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [29 x i8] c"hello world from process %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  int /*<<< orphan*/ pw_name;
};

/* Variables and functions */
int /*<<< orphan*/ geteuid();
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main(void) {
  uid_t uid = geteuid();
  struct passwd *pw = getpwuid(uid);
  puts(pw->pw_name);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
mov    (%rax),%edi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.passwd*
store i32 0, i32* %1
%4 = call i32 (...) @geteuid()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call %struct.passwd* @getpwuid(i32 %5)
store %struct.passwd* %6, %struct.passwd** %3
%7 = load %struct.passwd*, %struct.passwd** %3
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @puts(i32 %9)
ret i32 0
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @main() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @puts(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ insertion_sort(int *, int);
void sort(int *data, int length) { insertion_sort(data, length); }


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

x86 assembly (clang, -O2):
<sort>:
jmp    1030 <insertion_sort@plt>

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

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = tail call i32 @insertion_sort(i32* %0, i32 %1)
ret void
}