xunge/DecIR huggingface dataset:
int test_imm_4Cuint32_mem(unsigned int *val) {
  return ((*val) & (0x4C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Cuint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 76
%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_4Cuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 76
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ tell(char const *);
void fatal(const char *label) {
  const char *err = strerror(errno);
  tell("screendump: ");
  tell(label);
  tell(": ");
  tell(err);
  tell("\n");
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,-0x10(%rbp)
lea    0xeab(%rip),%rdi
call   1030 <tell@plt>
mov    -0x8(%rbp),%rdi
call   1030 <tell@plt>
lea    0xea0(%rip),%rdi
call   1030 <tell@plt>
mov    -0x10(%rbp),%rdi
call   1030 <tell@plt>
lea    0xe8e(%rip),%rdi
call   1030 <tell@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%r14
lea    0xeb1(%rip),%rdi
call   1030 <tell@plt>
mov    %rbx,%rdi
call   1030 <tell@plt>
lea    0xea7(%rip),%rdi
call   1030 <tell@plt>
mov    %r14,%rdi
call   1030 <tell@plt>
lea    0xe96(%rip),%rdi
call   1030 <tell@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [13 x i8] c"screendump: \00"
@.str.1 = [3 x i8] c": \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
store i8* %5, i8** %3
%6 = call i32 @tell(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 @tell(i8* %7)
%9 = call i32 @tell(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8*, i8** %3
%11 = call i32 @tell(i8* %10)
%12 = call i32 @tell(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [13 x i8] c"screendump: \00"
@.str.1 = [3 x i8] c": \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @tell(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @tell(i8* %0)
%6 = tail call i32 @tell(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @tell(i8* %3)
%8 = tail call i32 @tell(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
}
void secure_tcp_syn_cookie(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<secure_tcp_syn_cookie>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<secure_tcp_syn_cookie>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.secure_tcp_syn_cookie = [22 x i8] c"secure_tcp_syn_cookie\00"
define void @secure_tcp_syn_cookie() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.secure_tcp_syn_cookie, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.secure_tcp_syn_cookie = [22 x i8] c"secure_tcp_syn_cookie\00"
define void @secure_tcp_syn_cookie() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.secure_tcp_syn_cookie, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x19() {
  Assert_real((isdigit(25) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              130, ("isdigit should be 0 for 0x19"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x19>:
push   %rbp
mov    %rsp,%rbp
mov    $0x19,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x82,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x19>:
push   %rax
mov    $0x19,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x82,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x19\00"
define void @t_isdigit_0x19() {
%1 = call i64 @isdigit(i32 25)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x19\00"
define void @t_isdigit_0x19() {
%1 = tail call i64 @isdigit(i32 25)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void EVP_PKEY_get_attr_by_OBJ(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_PKEY_get_attr_by_OBJ() {
ret void
}
/* Variables and functions */
float atmos_geopotential_alt(float);
float atmos_press_adjust2b(float, float, float);
float atmos_press_adjust2a(float Z2, float Z1, float T1) {
  float H1, H2, T2;
  static const float L = -6.5;
  H1 = atmos_geopotential_alt(Z1);
  H2 = atmos_geopotential_alt(Z2);
  return (atmos_press_adjust2b(H2, H1, T1));
}


x86 assembly (clang, -O0):
<atmos_press_adjust2a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <atmos_geopotential_alt@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <atmos_geopotential_alt@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1040 <atmos_press_adjust2b@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atmos_press_adjust2a>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
movaps %xmm1,%xmm0
call   1030 <atmos_geopotential_alt@plt>
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
call   1030 <atmos_geopotential_alt@plt>
movss  0xc(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
add    $0x18,%rsp
jmp    1040 <atmos_press_adjust2b@plt>

LLVM IR (-O0):
@atmos_press_adjust2a.L = internal constant float -6.500000e+00
define float @atmos_press_adjust2a(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%10 = load float, float* %5
%11 = call float @atmos_geopotential_alt(float %10)
store float %11, float* %7
%12 = load float, float* %4
%13 = call float @atmos_geopotential_alt(float %12)
store float %13, float* %8
%14 = load float, float* %8
%15 = load float, float* %7
%16 = load float, float* %6
%17 = call float @atmos_press_adjust2b(float %14, float %15, float %16)
ret float %17
}

LLVM IR (-O2):
define float @atmos_press_adjust2a(float %0, float %1, float %2) {
%4 = tail call float @atmos_geopotential_alt(float %1)
%5 = tail call float @atmos_geopotential_alt(float %0)
%6 = tail call float @atmos_press_adjust2b(float %5, float %4, float %2)
ret float %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_98(void) {
  if ((*(uint32_t *)0x10000130ul == 0x8ul) &&
      (*(uint32_t *)0x10000134ul == 0x0ul)) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_98>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0x8,%rax
jne    1134 <errata_98+0x34>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_98+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <errata_98+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_98>:
cmpl   $0x8,0x10000130
08
jne    1114 <errata_98+0x14>
cmpl   $0x0,0x10000134
je     1117 <errata_98+0x17>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @errata_98() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 8
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %11
10: ; preds = %5, %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @errata_98() {
%1 = load i32, i32* inttoptr (i64 268435760 to i32*)
%2 = icmp eq i32 %1, 8
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* inttoptr (i64 268435764 to i32*)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
int make_new_seed();
int fmake_new_seed(void) { return make_new_seed(); }


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

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

LLVM IR (-O0):
define i32 @fmake_new_seed() {
%1 = call i32 (...) @make_new_seed()
ret i32 %1
}

LLVM IR (-O2):
define i32 @fmake_new_seed() {
%1 = tail call i32 (...) @make_new_seed()
ret i32 %1
}
int cc_to_rt(int cc, int nd, int tf) { return (cc << 2) | (nd << 1) | tf; }


x86 assembly (clang, -O0):
<cc_to_rt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
or     %ecx,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_to_rt>:
lea    0x0(,%rdi,4),%ecx
lea    (%rsi,%rsi,1),%eax
or     %ecx,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @cc_to_rt(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* %4
%8 = shl i32 %7, 2
%9 = load i32, i32* %5
%10 = shl i32 %9, 1
%11 = or i32 %8, %10
%12 = load i32, i32* %6
%13 = or i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @cc_to_rt(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 2
%5 = shl i32 %1, 1
%6 = or i32 %5, %4
%7 = or i32 %6, %2
ret i32 %7
}
/* Variables and functions */
scalar_t__ pow(int, int);
int sumSquare() {
  int i, t = 0;
  for (i = 1; i <= 100; i++) {
    t += pow(i, 2);
  }
  return t;
}


x86 assembly (clang, -O0):
<sumSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jg     1158 <sumSquare+0x48>
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <sumSquare+0x16>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumSquare>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0x1,%r14d
xor    %ebx,%ebx
mov    %r14d,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%r15
add    %ebx,%r15d
lea    0x1(%r14),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rbx
add    %r15d,%ebx
lea    0x2(%r14),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%r15
add    %ebx,%r15d
lea    0x3(%r14),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%r12
add    %r15d,%r12d
lea    0x4(%r14),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rbx
add    %r12d,%ebx
add    $0x5,%r14d
cmp    $0x65,%r14d
jne    1120 <sumSquare+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @sumSquare() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store i32 1, i32* %1
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 100
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i64 @pow(i32 %7, i32 2)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %6
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %3
16: ; preds = %3
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @sumSquare() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %22, %1 ]
%3 = phi i32 [ 1, %0 ], [ %23, %1 ]
%4 = tail call i64 @pow(i32 %3, i32 2)
%5 = trunc i64 %4 to i32
%6 = add i32 %2, %5
%7 = add nuw nsw i32 %3, 1
%8 = tail call i64 @pow(i32 %7, i32 2)
%9 = trunc i64 %8 to i32
%10 = add i32 %6, %9
%11 = add nuw nsw i32 %3, 2
%12 = tail call i64 @pow(i32 %11, i32 2)
%13 = trunc i64 %12 to i32
%14 = add i32 %10, %13
%15 = add nuw nsw i32 %3, 3
%16 = tail call i64 @pow(i32 %15, i32 2)
%17 = trunc i64 %16 to i32
%18 = add i32 %14, %17
%19 = add nuw nsw i32 %3, 4
%20 = tail call i64 @pow(i32 %19, i32 2)
%21 = trunc i64 %20 to i32
%22 = add i32 %18, %21
%23 = add nuw nsw i32 %3, 5
%24 = icmp eq i32 %23, 101
br i1 %24, label %25, label %1
25: ; preds = %1
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int clear_bit(int bit_array[], unsigned bit_number) {
  int ArraySize = 1000;
  if (bit_number > ArraySize - 1) {
    printf("the second parameter is too big! The set_bit function can not "
           "accept it!\n\n");
    return 0;
  }
  bit_array[bit_number] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x3e8,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jbe    114f <clear_bit+0x3f>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1164 <clear_bit+0x54>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movl   $0x0,(%rax,%rcx,4)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
push   %rax
cmp    $0x3e8,%esi
jb     1127 <clear_bit+0x17>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
jmp    1130 <clear_bit+0x20>
mov    %esi,%eax
movl   $0x0,(%rdi,%rax,4)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [75 x i8] c"the second parameter is too big! The set_bit function can not accept it!\0A\0A\00"
define i32 @clear_bit(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 1000, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = sub nsw i32 %8, 1
%10 = icmp ugt i32 %7, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %18
13: ; preds = %2
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 0, i32* %17
store i32 0, i32* %3
br label %18
18: ; preds = %13, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@str = [74 x i8] c"the second parameter is too big! The set_bit function can not accept it!\0A\00"
define i32 @clear_bit(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp ugt i32 %1, 999
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
br label %9
6: ; preds = %2
%7 = zext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 0, i32* %8
br label %9
9: ; preds = %6, %4
ret i32 0
}
void mpi_init(void) {}


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

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

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

LLVM IR (-O2):
define void @mpi_init() {
ret void
}
/* Variables and functions */
int floor(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float c;
  int result;
  printf("Enter a number: ");
  scanf("%f", &c);
  result = floor(c);
  printf("Floor integer of %.2f=%d", c, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1050 <floor@plt>
mov    %eax,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0xc(%rbp),%esi
lea    0xe97(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1050 <floor@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea8(%rip),%rdi
mov    %eax,%esi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"Floor integer of %.2f=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = call i32 @floor(float %6)
store i32 %7, i32* %3
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), double %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"Floor integer of %.2f=%d\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call i32 @floor(float %5)
%7 = load float, float* %1
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), double %8, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IPC_CREAT;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int shmget(int, int, int /*<<< orphan*/);
int create_shm(int key) {
  int shmid = shmget(1234, 128, IPC_CREAT);
  if (shmid < 0) {
    perror("shmget");
    exit(1);
  }
  return shmid;
}


x86 assembly (clang, -O0):
<create_shm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0x4d2,%edi
mov    $0x80,%esi
call   1040 <shmget@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1176 <create_shm+0x46>
lea    0xe99(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_shm>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    $0x4d2,%edi
mov    $0x80,%esi
call   1040 <shmget@plt>
test   %eax,%eax
js     114f <create_shm+0x1f>
pop    %rcx
ret
lea    0xeaa(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@.str = [7 x i8] c"shmget\00"
define i32 @create_shm(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @IPC_CREAT
%5 = call i32 @shmget(i32 1234, i32 128, i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@.str = [7 x i8] c"shmget\00"
define i32 @create_shm(i32 %0) {
%2 = load i32, i32* @IPC_CREAT
%3 = tail call i32 @shmget(i32 1234, i32 128, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i32 %3
}
void g_queue_push_head_link() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_push_head_link() {
ret void
}
/* Variables and functions */
int memlock(char *addr, size_t size) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @memlock(i8* nocapture readnone %0, i64 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
long caller_i64(long (*callback)(long), long value) {
  printf("calling i64 callback\n");
  return callback(value);
}


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

x86 assembly (clang, -O2):
<caller_i64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax

LLVM IR (-O0):
@.str = [22 x i8] c"calling i64 callback\0A\00"
define i64 @caller_i64(i64 (i64)* %0, i64 %1) {
%3 = alloca i64 (i64)*
%4 = alloca i64
store i64 (i64)* %0, i64 (i64)** %3
store i64 %1, i64* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = load i64 (i64)*, i64 (i64)** %3
%7 = load i64, i64* %4
%8 = call i64 %6(i64 %7)
ret i64 %8
}

LLVM IR (-O2):
@str = [21 x i8] c"calling i64 callback\00"
define i64 @caller_i64(i64 (i64)* nocapture %0, i64 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call i64 %0(i64 %1)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ l;

/* Variables and functions */
int /*<<< orphan*/ cocktailsort(int *, int);
int main() {
  int l[] = {5, 1, 4, 2, 8, 0, 2};
  int n = sizeof(l) / sizeof(l[0]);
  cocktailsort(l, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed2(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <cocktailsort@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <cocktailsort@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.l = [7 x i32] [i32 5, i32 1, i32 4, i32 2, i32 8, i32 0, i32 2]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @cocktailsort(i32* %3, i32 7)
ret i32 0
}
int getparent(int childindex) { return (childindex - 1) / 2; }


x86 assembly (clang, -O0):
<getparent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<getparent>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @getparent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @getparent(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
int isupper(int c) {
  if ('A' <= c && c <= 'Z')
    return c;
  else
    return 0;
}


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

x86 assembly (clang, -O2):
<isupper>:
lea    -0x41(%rdi),%ecx
xor    %eax,%eax
cmp    $0x1a,%ecx
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = select i1 %3, i32 %0, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fold(char *);
int /*<<< orphan*/ free(char *);
int getline(char **, int *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main() {
  int len;
  char *line = NULL;
  while (getline(&line, &len, stdin) != -1) {
    fold(line);
  }
  free(line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <getline@plt>
cmp    $0xffffffff,%eax
je     1174 <main+0x44>
mov    -0x10(%rbp),%rdi
call   1040 <fold@plt>
jmp    1147 <main+0x17>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movq   $0x0,(%rsp)
mov    0x2ea0(%rip),%r15
mov    (%r15),%edx
mov    %rsp,%rdi
lea    0xc(%rsp),%rsi
call   1050 <getline@plt>
cmp    $0xffffffff,%eax
je     118c <main+0x5c>
mov    %rsp,%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rsp),%rdi
call   1040 <fold@plt>
mov    (%r15),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <getline@plt>
cmp    $0xffffffff,%eax
jne    1170 <main+0x40>
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = bitcast i32* %1 to i8*
%4 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%5 = load i32, i32* @stdin
%6 = call i32 @getline(i8** %2, i32* %1, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %14, label %8
8: ; preds = %0, %8
%9 = load i8*, i8** %2
%10 = call i32 @fold(i8* %9)
%11 = load i32, i32* @stdin
%12 = call i32 @getline(i8** %2, i32* %1, i32 %11)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %8
14: ; preds = %8, %0
%15 = load i8*, i8** %2
%16 = call i32 @free(i8* %15)
ret i32 0
}
int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
                               struct wpa_ssid *ssid) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wpa_ssid = type opaque
define i32 @wpas_dbus_register_network(%struct.wpa_supplicant* %0, %struct.wpa_ssid* %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca %struct.wpa_ssid*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store %struct.wpa_ssid* %1, %struct.wpa_ssid** %4
ret i32 0
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wpa_ssid = type opaque
define i32 @wpas_dbus_register_network(%struct.wpa_supplicant* nocapture readnone %0, %struct.wpa_ssid* nocapture readnone %1) {
ret i32 0
}
int todo_version() { return 0 << 0x10 | 0 << 0x8 | 1; }


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

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

LLVM IR (-O0):
define i32 @todo_version() {
ret i32 1
}

LLVM IR (-O2):
define i32 @todo_version() {
ret i32 1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mp2vpicx_get_rff(const uint8_t *p_mp2vpicx) {
  return !!(p_mp2vpicx[7] & 0x2);
}


x86 assembly (clang, -O0):
<mp2vpicx_get_rff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_get_rff>:
mov    0x1c(%rdi),%eax
shr    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mp2vpicx_get_rff(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = and i32 %5, 2
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mp2vpicx_get_rff(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ emit_adc(int, int, int);
int /*<<< orphan*/ emit_lsrs_imm(int, int, int);
int /*<<< orphan*/ emit_sbcs(int, int, int);
int /*<<< orphan*/ emit_xorimm(int, int, int);
void emit_subc(int s, int t, int sr) {
  emit_xorimm(sr, 1, sr);
  emit_lsrs_imm(sr, 1, sr);
  emit_sbcs(t, s, t);
  emit_adc(sr, sr, sr);
  emit_xorimm(sr, 1, sr);
}


x86 assembly (clang, -O0):
<emit_subc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1060 <emit_xorimm@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1040 <emit_lsrs_imm@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <emit_sbcs@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <emit_adc@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1060 <emit_xorimm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_subc>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %edx,%edi
mov    $0x1,%esi
call   1060 <emit_xorimm@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
call   1040 <emit_lsrs_imm@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebp,%edx
call   1030 <emit_sbcs@plt>
mov    %ebx,%edi
mov    %ebx,%esi
mov    %ebx,%edx
call   1050 <emit_adc@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <emit_xorimm@plt>

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

LLVM IR (-O2):
define void @emit_subc(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @emit_xorimm(i32 %2, i32 1, i32 %2)
%5 = tail call i32 @emit_lsrs_imm(i32 %2, i32 1, i32 %2)
%6 = tail call i32 @emit_sbcs(i32 %1, i32 %0, i32 %1)
%7 = tail call i32 @emit_adc(i32 %2, i32 %2, i32 %2)
%8 = tail call i32 @emit_xorimm(i32 %2, i32 1, i32 %2)
ret void
}
int main(int argc, char **argv) { return 123; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x7b,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x7b,%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
ret i32 123
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 123
}
/* Variables and functions */
long long scm_page_level(long long);
long long scm_page_rank(long long);
long long scm_page_row(long long i) {
  return scm_page_rank(i) / (1LL << scm_page_level(i));
}


x86 assembly (clang, -O0):
<scm_page_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <scm_page_rank@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <scm_page_level@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
cqto
idiv   %rcx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scm_page_row>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <scm_page_rank@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <scm_page_level@plt>
mov    $0x1,%esi
mov    %eax,%ecx
shl    %cl,%rsi
mov    %r14,%rcx
bts    %rax,%rcx
shr    $0x20,%rcx
je     1158 <scm_page_row+0x38>
mov    %r14,%rax
cqto
idiv   %rsi
jmp    115f <scm_page_row+0x3f>
mov    %r14d,%eax
xor    %edx,%edx
div    %esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @scm_page_row(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @scm_page_rank(i64 %3)
%5 = load i64, i64* %2
%6 = call i64 @scm_page_level(i64 %5)
%7 = shl i64 1, %6
%8 = sdiv i64 %4, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @scm_page_row(i64 %0) {
%2 = tail call i64 @scm_page_rank(i64 %0)
%3 = tail call i64 @scm_page_level(i64 %0)
%4 = shl nuw i64 1, %3
%5 = sdiv i64 %2, %4
ret i64 %5
}
int foo(int i) {
  switch (i) {
  case 0:
  case 2:
  case 5:
    return 0;
  case 7:
  case 11:
  case 13:
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     116f <foo+0x6f>
jmp    111a <foo+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     116f <foo+0x6f>
jmp    112b <foo+0x2b>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
je     116f <foo+0x6f>
jmp    113c <foo+0x3c>
mov    -0xc(%rbp),%eax
sub    $0x7,%eax
je     117b <foo+0x7b>
jmp    114d <foo+0x4d>
mov    -0xc(%rbp),%eax
sub    $0xb,%eax
je     117b <foo+0x7b>
jmp    115e <foo+0x5e>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     117b <foo+0x7b>
jmp    1187 <foo+0x87>
movl   $0x0,-0x4(%rbp)
jmp    118e <foo+0x8e>
movl   $0x1,-0x4(%rbp)
jmp    118e <foo+0x8e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0xffffffff,%eax
cmp    $0xd,%edi
ja     1117 <foo+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 2, label %5
i32 5, label %5
i32 7, label %6
i32 11, label %6
i32 13, label %6
]
5: ; preds = %1, %1, %1
store i32 0, i32* %2
br label %8
6: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@switch.table.foo = [14 x i32] [i32 0, i32 -1, i32 0, i32 -1, i32 -1, i32 0, i32 -1, i32 1, i32 -1, i32 -1, i32 -1, i32 1, i32 -1, i32 1]
define i32 @foo(i32 %0) {
%2 = icmp ult i32 %0, 14
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [14 x i32], [14 x i32]* @switch.table.foo, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}
OP(ed, b7) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
zxor() { ol("xorl %edx, %eax"); }


x86 assembly (clang, -O0):
<zxor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"xorl %edx, %eax\00"
define i32 @zxor() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [16 x i8] c"xorl %edx, %eax\00"
define i32 @zxor() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void byte_zero(void *out, size_t len) { memset(out, 0, len); }


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

x86 assembly (clang, -O2):
<byte_zero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @byte_zero(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 i32 @memset(i8* %5, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define void @byte_zero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
int main() {
  int x;
  x = 5555;
  x--;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x15b3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5555, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5554
}
int pow3(int x) {
  int y = 3, r = 1;
  while (x) {
    if (x & 1)
      r *= y;
    y *= y;
    x >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<pow3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1150 <pow3+0x50>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1138 <pow3+0x38>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1115 <pow3+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow3>:
test   %edi,%edi
je     113a <pow3+0x3a>
mov    $0x3,%edx
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %edi,%esi
cs nopw 0x0(%rax,%rax,1)
test   $0x1,%dil
mov    %edx,%ecx
cmove  %r8d,%ecx
imul   %ecx,%eax
imul   %edx,%edx
sar    %esi
cmp    $0x1,%edi
mov    %esi,%edi
ja     1120 <pow3+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @pow3(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 1, %1 ]
%5 = phi i32 [ %11, %3 ], [ 3, %1 ]
%6 = phi i32 [ %12, %3 ], [ %0, %1 ]
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 1, i32 %5
%10 = mul nsw i32 %9, %4
%11 = mul nsw i32 %5, %5
%12 = ashr i32 %6, 1
%13 = icmp ult i32 %6, 2
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 1, %1 ], [ %10, %3 ]
ret i32 %15
}
void minimize(double *dest, double src) {
  if (src < *dest)
    *dest = src;
}


x86 assembly (clang, -O0):
<minimize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <minimize+0x31>
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimize>:
movsd  (%rdi),%xmm1
ucomisd %xmm0,%xmm1
jbe    110e <minimize+0xe>
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @minimize(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = fcmp olt double %5, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load double, double* %4
%11 = load double*, double** %3
store double %10, double* %11
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @minimize(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ogt double %3, %1
br i1 %4, label %5, label %6
5: ; preds = %2
store double %1, double* %0
br label %6
6: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  for (int i = 0; i < 81; i++) {
    printf("1");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x51,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x51,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x31,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 @putchar(i32 10)
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @putchar(i32 49)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 81
br i1 %7, label %1, label %3
}
int test_imm_11uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x11 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_11uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 17
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}