xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _bytecode_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
uint32_t bytecode_isub(uint8_t r0, uint8_t r1, uint8_t r2) {
  return _bytecode_write(23, 0, 0, r0, r1, r2);
}


x86 assembly (clang, -O0):
<bytecode_isub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    $0x17,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <_bytecode_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytecode_isub>:
mov    %edx,%r9d
mov    %esi,%r8d
mov    %edi,%ecx
mov    $0x17,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <_bytecode_write@plt>

LLVM IR (-O0):
define i32 @bytecode_isub(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @_bytecode_write(i32 23, i32 0, i32 0, i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @bytecode_isub(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_bytecode_write(i32 23, i32 0, i32 0, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
void delay(int n) {
  volatile int i;
  for (i = 0; i < n; i++) {
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <delay+0x2d>
jmp    111f <delay+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp),%eax
cmp    %edi,%eax
jge    111f <delay+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <delay+0x10>
ret

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp slt i32 %9, %0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
void import(name) char *name;
{
  outop0str("IMPORT\t");
  outnccname(name);
}


x86 assembly (clang, -O0):
<import>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <outop0str@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <outnccname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<import>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <outop0str@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <outnccname@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"IMPORT\09\00"
define void @import(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @outop0str to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @outnccname to i32 (i8*, ...)*)(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"IMPORT\09\00"
define void @import(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outop0str to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outnccname to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int a = 0;
  char buf[] = "hello world";
  a = (int)buf;
  printf("in the pointer: %s\n", (char *)a);
  printf("in the address: %s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    0xecc(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeca(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6f77206f6c6c6568,%rax
20 77 6f
mov    %rax,(%rsp)
movl   $0x646c72,0x8(%rsp)
mov    %rsp,%rbx
movslq %ebx,%rsi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.buf = [12 x i8] c"hello world\00"
@.str = [20 x i8] c"in the pointer: %s\0A\00"
@.str.1 = [20 x i8] c"in the address: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [12 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = bitcast [12 x i8]* %7 to i8*
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%10 = ptrtoint i8* %9 to i32
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.buf = [12 x i8] c"hello world\00"
@.str = [20 x i8] c"in the pointer: %s\0A\00"
@.str.1 = [20 x i8] c"in the address: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = ptrtoint [12 x i8]* %3 to i64
%6 = shl i64 %5, 32
%7 = ashr exact i64 %6, 32
%8 = inttoptr i64 %7 to i8*
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
ssize_t szl_null_size(void *priv) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @szl_null_size(i8* nocapture readnone %0) {
ret i32 0
}
void RTP_set_marker(unsigned char *p, int v) {
  p[1] = (p[1] & 0x7f) | (((unsigned char)v) << 7);
}


x86 assembly (clang, -O0):
<RTP_set_marker>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0x7f,%eax
mov    -0xc(%rbp),%ecx
movzbl %cl,%ecx
shl    $0x7,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_set_marker>:
mov    0x1(%rdi),%al
and    $0x7f,%al
shl    $0x7,%sil
or     %al,%sil
mov    %sil,0x1(%rdi)
ret

LLVM IR (-O0):
define void @RTP_set_marker(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = and i32 %8, 127
%10 = load i32, i32* %4
%11 = trunc i32 %10 to i8
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 7
%14 = or i32 %9, %13
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @RTP_set_marker(i8* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = and i8 %4, 127
%6 = trunc i32 %1 to i8
%7 = shl i8 %6, 7
%8 = or i8 %5, %7
store i8 %8, i8* %3
ret void
}
int HelpItem91(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem91() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int middle(char const *);
int /*<<< orphan*/ stderr;
int outer(char *dummy) {
  const char local = 0;
  int retval;
  fprintf(stderr, "outer: &local = %p\n", (void *)&local);
  retval = middle(&local);
  fprintf(stderr, "outer: middle returned %d\n", retval);
  return retval != 0;
}


x86 assembly (clang, -O0):
<outer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    -0x9(%rbp),%rax
mov    %eax,%edx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
lea    -0x9(%rbp),%rdi
call   1040 <middle@plt>
mov    %eax,-0x10(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outer>:
push   %r14
push   %rbx
push   %rax
movb   $0x0,0x7(%rsp)
mov    0x2eb0(%rip),%r14
mov    (%r14),%edi
lea    0x7(%rsp),%rbx
lea    0xec1(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <middle@plt>
mov    %eax,%ebx
mov    (%r14),%edi
lea    0xeba(%rip),%rsi
mov    %eax,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
test   %ebx,%ebx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"outer: &local = %p\0A\00"
@.str.1 = [27 x i8] c"outer: middle returned %d\0A\00"
define i32 @outer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
store i8* %0, i8** %2
store i8 0, i8* %3
%5 = load i32, i32* @stderr
%6 = ptrtoint i8* %3 to i32
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @middle(i8* %3)
store i32 %8, i32* %4
%9 = load i32, i32* @stderr
%10 = load i32, i32* %4
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"outer: &local = %p\0A\00"
@.str.1 = [27 x i8] c"outer: middle returned %d\0A\00"
define i32 @outer(i8* nocapture readnone %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = load i32, i32* @stderr
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @middle(i8* %2)
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%10 = icmp ne i32 %7, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _CANBaseValid(int);
void CANEnable(uint32_t ui32Base) {
  ASSERT(_CANBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<CANEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_CANBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANEnable>:
push   %rbx
mov    %edi,%ebx
call   1030 <_CANBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebx,%rax
andl   $0xfffffffe,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @CANEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_CANBaseValid(i32 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 0
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, -2
store volatile i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @CANEnable(i32 %0) {
%2 = tail call i32 @_CANBaseValid(i32 %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = sext i32 %0 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -2
store volatile i32 %7, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func_2(char, int);
int /*<<< orphan*/ printf(char *, char *, int);
void func_3(char *cc, int aa) {
  printf("func_3. bb=%s aa=%d\n", cc, aa);
  func_2('x', aa * 7);
}


x86 assembly (clang, -O0):
<func_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
imul   $0x7,-0xc(%rbp),%esi
mov    $0x78,%edi
call   1030 <func_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_3>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
mov    %ebx,%edx
call   1040 <printf@plt>
lea    0x0(,%rbx,8),%esi
sub    %ebx,%esi
mov    $0x78,%edi
pop    %rbx
jmp    1030 <func_2@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"func_3. bb=%s aa=%d\0A\00"
define void @func_3(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 7
%10 = call i32 @func_2(i8 signext 120, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"func_3. bb=%s aa=%d\0A\00"
define void @func_3(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = mul nsw i32 %1, 7
%5 = tail call i32 @func_2(i8 signext 120, i32 %4)
ret void
}
/* Variables and functions */
int U_WMRCORE_RECSAFE_get(char const *, int);
int U_WMRREALIZEPALETTE_get(const char *contents) {
  return U_WMRCORE_RECSAFE_get(contents, (6));
}


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

x86 assembly (clang, -O2):
<U_WMRREALIZEPALETTE_get>:
mov    $0x6,%esi
jmp    1030 <U_WMRCORE_RECSAFE_get@plt>

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

LLVM IR (-O2):
define i32 @U_WMRREALIZEPALETTE_get(i8* %0) {
%2 = tail call i32 @U_WMRCORE_RECSAFE_get(i8* %0, i32 6)
ret i32 %2
}
int test_imm_4Fuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x4F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Fuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 79
%6 = icmp ne i64 %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_4Fuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 79
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int recv(int, char *, int, int /*<<< orphan*/);
int http_tcpclient_recv(int socket, char *lpbuff) {
  int recvnum = 0;
  recvnum = recv(socket, lpbuff, 1024 * 4, 0);
  return recvnum;
}


x86 assembly (clang, -O0):
<http_tcpclient_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_tcpclient_recv>:
mov    $0x1000,%edx
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @http_tcpclient_recv(i32 %0, i8* %1) {
%3 = tail call i32 @recv(i32 %0, i8* %1, i32 4096, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t reverse64(uint64_t n) {
  uint64_t retval;
  uint8_t *np = (uint8_t *)&n;
  uint8_t *retvalp = (uint8_t *)&retval;
  for (int i = 0; i < sizeof(uint64_t); i++)
    retvalp[i] = np[sizeof(uint64_t) - 1 - i];
  return retval;
}


x86 assembly (clang, -O0):
<reverse64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x4,%rax
jae    1158 <reverse64+0x58>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rdx
mov    $0x3,%ecx
sub    %rdx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111e <reverse64+0x1e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse64>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @reverse64(i32 %0) {
ret i32 %0
}
/* Type definitions */
struct itstree_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_count(struct itstree_node const *, size_t *, size_t *,
                            size_t *, int);
void itstree_count_priv(const struct itstree_node *itst, size_t *p30,
                        size_t *p50, size_t *p70) {
  do_count(itst, p30, p50, p70, 1);
}


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

x86 assembly (clang, -O2):
<itstree_count_priv>:
mov    $0x1,%r8d
jmp    1030 <do_count@plt>

LLVM IR (-O0):
%struct.itstree_node = type { i32 }
define void @itstree_count_priv(%struct.itstree_node* %0, i64* %1, i64* %2, i64* %3) {
%5 = alloca %struct.itstree_node*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64*
store %struct.itstree_node* %0, %struct.itstree_node** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load %struct.itstree_node*, %struct.itstree_node** %5
%10 = load i64*, i64** %6
%11 = load i64*, i64** %7
%12 = load i64*, i64** %8
%13 = call i32 @do_count(%struct.itstree_node* %9, i64* %10, i64* %11, i64* %12, i32 1)
ret void
}

LLVM IR (-O2):
%struct.itstree_node = type { i32 }
define void @itstree_count_priv(%struct.itstree_node* %0, i64* %1, i64* %2, i64* %3) {
%5 = tail call i32 @do_count(%struct.itstree_node* %0, i64* %1, i64* %2, i64* %3, i32 1)
ret void
}
int _circ_space_to_end(int head, int tail, int size) {
  int end = size - 1 - head;
  int n = (end + tail) % (size);
  if (n <= end)
    return n;
  else
    return end + 1;
}


x86 assembly (clang, -O0):
<_circ_space_to_end>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     113d <_circ_space_to_end+0x3d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <_circ_space_to_end+0x46>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_circ_space_to_end>:
mov    %edx,%r8d
mov    %edi,%ecx
not    %ecx
add    %edx,%ecx
lea    (%rsi,%rcx,1),%eax
cltd
idiv   %r8d
sub    %edi,%r8d
cmp    %ecx,%edx
cmovle %edx,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @_circ_space_to_end(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %0, -1
%5 = add i32 %4, %2
%6 = add nsw i32 %5, %1
%7 = srem i32 %6, %2
%8 = icmp sgt i32 %7, %5
%9 = sub i32 %2, %0
%10 = select i1 %8, i32 %9, i32 %7
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ ILibLinkedList_UnLock(void *);
void ILibQueue_UnLock(void *q) { ILibLinkedList_UnLock(q); }


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

x86 assembly (clang, -O2):
<ILibQueue_UnLock>:
jmp    1030 <ILibLinkedList_UnLock@plt>

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

LLVM IR (-O2):
define void @ILibQueue_UnLock(i8* %0) {
%2 = tail call i32 @ILibLinkedList_UnLock(i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bitmap_LittleEndToINT32(unsigned char *pByteArray) {
  uint32_t intValue;
  intValue = 0;
  intValue = (uint32_t)pByteArray[0];
  intValue = intValue | ((uint32_t)pByteArray[1] << 8);
  intValue = intValue | ((uint32_t)pByteArray[2] << 16);
  intValue = intValue | ((uint32_t)pByteArray[3] << 24);
  return intValue;
}


x86 assembly (clang, -O0):
<bitmap_LittleEndToINT32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_LittleEndToINT32>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @bitmap_LittleEndToINT32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *prog) {
  fprintf(stderr, "%s conf_file row_num\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"%s conf_file row_num\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"%s conf_file row_num\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int is_switch_char(char c) { return (c == '-' || c == '/'); }


x86 assembly (clang, -O0):
<is_switch_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_switch_char+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_switch_char>:
and    $0xfd,%dil
xor    %eax,%eax
cmp    $0x2d,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_switch_char(i8 signext %0) {
%2 = and i8 %0, -3
%3 = icmp eq i8 %2, 45
%4 = zext i1 %3 to i32
ret i32 %4
}
char *eisa_str(unsigned id) {
  static char s[4];
  s[0] = ((id >> 10) & 0x1f) + 'A' - 1;
  s[1] = ((id >> 5) & 0x1f) + 'A' - 1;
  s[2] = (id & 0x1f) + 'A' - 1;
  s[3] = 0;
  return s;
}


x86 assembly (clang, -O0):
<eisa_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xa,%eax
and    $0x1f,%eax
add    $0x41,%eax
sub    $0x1,%eax
mov    %al,0x2f05(%rip)
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
and    $0x1f,%eax
add    $0x41,%eax
sub    $0x1,%eax
mov    %al,0x2ef1(%rip)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
add    $0x41,%eax
sub    $0x1,%eax
mov    %al,0x2ee0(%rip)
movb   $0x0,0x2eda(%rip)
lea    0x2ed0(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eisa_str>:
mov    %edi,%eax
shr    $0xa,%eax
and    $0x1f,%al
or     $0x40,%al
mov    %al,0x2f12(%rip)
lea    0x2f0b(%rip),%rax
mov    %edi,%ecx
shr    $0x5,%ecx
and    $0x1f,%cl
or     $0x40,%cl
mov    %cl,0x2efb(%rip)
and    $0x1f,%dil
or     $0x40,%dil
mov    %dil,0x2eed(%rip)
movb   $0x0,0x2ee7(%rip)
ret

LLVM IR (-O0):
@eisa_str.s = internal global [4 x i8] zeroinitializer
define i8* @eisa_str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 10
%5 = and i32 %4, 31
%6 = add i32 %5, 65
%7 = sub i32 %6, 1
%8 = trunc i32 %7 to i8
store i8 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @eisa_str.s, i64 0, i64 0)
%9 = load i32, i32* %2
%10 = lshr i32 %9, 5
%11 = and i32 %10, 31
%12 = add i32 %11, 65
%13 = sub i32 %12, 1
%14 = trunc i32 %13 to i8
store i8 %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @eisa_str.s, i64 0, i64 1)
%15 = load i32, i32* %2
%16 = and i32 %15, 31
%17 = add i32 %16, 65
%18 = sub i32 %17, 1
%19 = trunc i32 %18 to i8
store i8 %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @eisa_str.s, i64 0, i64 2)
store i8 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @eisa_str.s, i64 0, i64 3)
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @eisa_str.s, i64 0, i64 0)
}

LLVM IR (-O2):
@eisa_str.s = internal global [4 x i8] zeroinitializer
define i8* @eisa_str(i32 %0) {
%2 = lshr i32 %0, 10
%3 = trunc i32 %2 to i8
%4 = and i8 %3, 31
%5 = or i8 %4, 64
store i8 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @eisa_str.s, i64 0, i64 0)
%6 = lshr i32 %0, 5
%7 = trunc i32 %6 to i8
%8 = and i8 %7, 31
%9 = or i8 %8, 64
store i8 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @eisa_str.s, i64 0, i64 1)
%10 = trunc i32 %0 to i8
%11 = and i8 %10, 31
%12 = or i8 %11, 64
store i8 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @eisa_str.s, i64 0, i64 2)
store i8 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @eisa_str.s, i64 0, i64 3)
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @eisa_str.s, i64 0, i64 0)
}
void f2(char *p) { *p = 42; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movb   $0x2a,(%rdi)
ret

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

LLVM IR (-O2):
define void @f2(i8* nocapture writeonly %0) {
store i8 42, i8* %0
ret void
}
/* Variables and functions */
double sqrt(double);
double vp_length(double x, double y, double z) {
  return sqrt(x * x + y * y + z * z);
}


x86 assembly (clang, -O0):
<vp_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp_length>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1136 <vp_length+0x26>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
ret
movapd %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @vp_length(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %6
%14 = load double, double* %6
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double %12)
%16 = call double @sqrt(double %15)
ret double %16
}

LLVM IR (-O2):
define double @vp_length(double %0, double %1, double %2) {
%4 = fmul double %1, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = tail call double @sqrt(double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ real_renderer_update_caches(int, int, int, int);
int /*<<< orphan*/ renderer_sync();
void renderer_update_caches(int x, int y, int w, int h) {
  renderer_sync();
  real_renderer_update_caches(x, y, w, h);
}


x86 assembly (clang, -O0):
<renderer_update_caches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <renderer_sync@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <real_renderer_update_caches@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderer_update_caches>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <renderer_sync@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <real_renderer_update_caches@plt>

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

LLVM IR (-O2):
define void @renderer_update_caches(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @renderer_sync()
%6 = tail call i32 @real_renderer_update_caches(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xf6() {
  Assert_real((islower(246) == 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_islower.c",
              1235, ("islower should be 0 for 0xf6"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xf6>:
push   %rax
mov    $0xf6,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d3,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xf6\00"
define void @t_islower_0xf6() {
%1 = call i64 @islower(i32 246)
%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 1235, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xf6\00"
define void @t_islower_0xf6() {
%1 = tail call i64 @islower(i32 246)
%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 1235, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int os_rmdir(const char *filename, int *rc) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @os_rmdir(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func(int arg) { printf("Arg is %d \n", arg); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Arg is %d \0A\00"
define void @func(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int standard_Newton_series(int idx, int maxdeg, int nbr, int verbose) {
  int fail = 0;
  int idxnbr[3];
  double *c;
  idxnbr[0] = idx;
  idxnbr[1] = maxdeg;
  idxnbr[2] = nbr;
  fail = _ada_use_c2phc4c(691, idxnbr, &verbose, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<standard_Newton_series>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    $0x2b3,%edi
lea    -0x10(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_Newton_series>:
sub    $0x18,%rsp
mov    %ecx,0x8(%rsp)
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    $0x2b3,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @standard_Newton_series(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca [3 x i32]
store i32 %3, i32* %5
%7 = bitcast [3 x i32]* %6 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 %0, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
store i32 %1, i32* %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
store i32 %2, i32* %10
%11 = call i32 @_ada_use_c2phc4c(i32 691, i32* %8, i32* %5, double* undef, i32 0)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
int /*<<< orphan*/ memcpy(char *, char *, scalar_t__);
scalar_t__ strlen(char *);
char *svz_pmalloc(scalar_t__);
char *svz_pstrdup(char *src) {
  char *dst;
  assert(src);
  dst = svz_pmalloc(strlen(src) + 1);
  memcpy(dst, src, strlen(src) + 1);
  return dst;
}


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

x86 assembly (clang, -O2):
<svz_pstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdi
call   1040 <svz_pmalloc@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <memcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @svz_pstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @assert(i8* %4)
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = call i8* @svz_pmalloc(i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = load i8*, i8** %2
%13 = call i64 @strlen(i8* %12)
%14 = add nsw i64 %13, 1
%15 = call i32 @memcpy(i8* %10, i8* %11, i64 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @svz_pstrdup(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @svz_pmalloc(i64 %4)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = add nsw i64 %6, 1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %7)
ret i8* %5
}
int is_boolean(int b) {
  int result = 0;
  if (b == 1 || b == 0) {
    result = 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<is_boolean>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1122 <is_boolean+0x22>
cmpl   $0x0,-0x4(%rbp)
jne    1129 <is_boolean+0x29>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_boolean(i32 %0) {
%2 = icmp ult i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_7Fint32_reg(int val) { return ((val) & (0x7F << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_7Fint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x7f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_7Fint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 127
%5 = icmp ne i32 %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_7Fint32_reg(i32 %0) {
%2 = and i32 %0, 127
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__attribute__((no, noclone)) int func(int arg) {
  static void *array[] = {&&foo, &&bar};
  goto *array[arg];
foo:
  return arg * 111;
bar:
  return arg * 777;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
lea    0x2f1e(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
jmp    113a <func+0x3a>
imul   $0x6f,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <func+0x35>
imul   $0x309,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret
mov    -0x10(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<func>:
movslq %edi,%rax
lea    0x2d36(%rip),%rcx
jmp    *(%rcx,%rax,8)
mov    $0x6f,%eax
imul   %edi,%eax
ret
mov    $0x309,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
@func.array = internal global [2 x i8*] [i8* blockaddress(@func, %8), i8* blockaddress(@func, %11)]
define i32 @func(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* @func.array, i64 0, i64 %5
%7 = load i8*, i8** %6
br label %16
8: ; preds = %16
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 111
store i32 %10, i32* %2
br label %14
11: ; preds = %16
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, 777
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
ret i32 %15
16: ; preds = %1
%17 = phi i8* [ %7, %1 ]
indirectbr i8* %17, [label %8, label %11]
}

LLVM IR (-O2):
@func.array = internal unnamed_addr constant [2 x i8*] [i8* blockaddress(@func, %6), i8* blockaddress(@func, %5)]
define i32 @func(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* @func.array, i64 0, i64 %2
%4 = load i8*, i8** %3
indirectbr i8* %4, [label %6, label %5]
5: ; preds = %1
br label %6
6: ; preds = %1, %5
%7 = phi i32 [ 777, %5 ], [ 111, %1 ]
%8 = mul nsw i32 %7, %0
ret i32 %8
}
void foo191(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo191(i32 %0) {
ret void
}