xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ utilStrInsertChars(char *, char *);
void utilStrInsertChar(char *str, char c) {
  char chars[2];
  chars[0] = c;
  chars[1] = '\0';
  utilStrInsertChars(str, chars);
}


x86 assembly (clang, -O0):
<utilStrInsertChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xb(%rbp)
movb   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xb(%rbp),%rsi
call   1030 <utilStrInsertChars@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilStrInsertChar>:
push   %rax
mov    %sil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rsi
call   1030 <utilStrInsertChars@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @utilStrInsertChar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca [2 x i8]
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 0, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%11 = call i32 @utilStrInsertChars(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
define void @utilStrInsertChar(i8* %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %5
%6 = call i32 @utilStrInsertChars(i8* %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version() {
  printf("simplylock v"
         "0.6.0"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"simplylock v0.6.0\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"simplylock v0.6.0\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void xyz(void) { printf("v1 xyz()\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"v1 xyz()\0A\00"
define void @xyz() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"v1 xyz()\00"
define void @xyz() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzBinaryFuncConstR_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKUP(int);
void BrzBinaryFuncConstRPush_ackup(struct comp *comp, int port) {
  struct BrzBinaryFuncConstR_ *c = (struct BrzBinaryFuncConstR_ *)comp;
  SEND_ACKUP(1);
}


x86 assembly (clang, -O0):
<BrzBinaryFuncConstRPush_ackup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <SEND_ACKUP@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzBinaryFuncConstRPush_ackup>:
mov    $0x1,%edi
jmp    1030 <SEND_ACKUP@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzBinaryFuncConstR_ = type { i32 }
define void @BrzBinaryFuncConstRPush_ackup(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzBinaryFuncConstR_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzBinaryFuncConstR_*
store %struct.BrzBinaryFuncConstR_* %7, %struct.BrzBinaryFuncConstR_** %5
%8 = call i32 @SEND_ACKUP(i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzBinaryFuncConstRPush_ackup(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKUP(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ write_le32(int /*<<< orphan*/ *, int /*<<< orphan*/);
void write_at_le32(void *dest, uint32_t val, size_t offset) {
  uint8_t *d = dest;
  d += offset;
  write_le32(d, val);
}


x86 assembly (clang, -O0):
<write_at_le32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <write_le32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_at_le32>:
lea    (%rdi,%rdx,4),%rdi
jmp    1030 <write_le32@plt>

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

LLVM IR (-O2):
define void @write_at_le32(i8* %0, i32 %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 %2
%6 = tail call i32 @write_le32(i32* %5, i32 %1)
ret void
}
void rop3_175_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~T;
  stk1 = *D | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_175_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_175_0_1>:
mov    %edx,%eax
not    %eax
movzbl (%rdi),%r8d
mov    %r8d,%ecx
or     %eax,%ecx
mov    %ecx,%r9d
and    %esi,%r9d
and    %eax,%ecx
not    %esi
and    %edx,%esi
and    %r8d,%esi
or     %r9d,%esi
or     %ecx,%esi
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_175_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = zext i8 %20 to i32
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = load i8, i8* %7
%26 = zext i8 %25 to i32
%27 = load i8, i8* %6
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = and i32 %26, %29
%31 = or i32 %24, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = load i8, i8* %5
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = load i8*, i8** %4
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = and i32 %37, %40
%42 = or i32 %31, %41
%43 = trunc i32 %42 to i8
%44 = load i8*, i8** %4
store i8 %43, i8* %44
ret void
}

LLVM IR (-O2):
define void @rop3_175_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = xor i32 %4, -1
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = trunc i32 %5 to i8
%9 = or i8 %6, %8
%10 = zext i8 %9 to i32
%11 = zext i8 %1 to i32
%12 = and i8 %9, %1
%13 = zext i8 %12 to i32
%14 = and i32 %10, %5
%15 = xor i32 %11, -1
%16 = and i32 %4, %15
%17 = and i32 %16, %7
%18 = or i32 %17, %13
%19 = or i32 %18, %14
%20 = trunc i32 %19 to i8
store i8 %20, i8* %0
ret void
}
int test_imm_FBint64_highword_reg(long long val) {
  return ((val >> 32) & (0xFB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FBint64_highword_reg>:
movabs $0xfb00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FBint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 251
%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_FBint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1078036791296
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *langRomTypeExtRam1mb() { return "1MB External RAM"; }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"1MB External RAM\00"
define i8* @langRomTypeExtRam1mb() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"1MB External RAM\00"
define i8* @langRomTypeExtRam1mb() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ TKMM_Init();
int __start_early() { TKMM_Init(); }


x86 assembly (clang, -O0):
<__start_early>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <TKMM_Init@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__start_early() {
%1 = alloca i32
%2 = call i32 (...) @TKMM_Init()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @__start_early() {
%1 = tail call i32 (...) @TKMM_Init()
ret i32 undef
}
unsigned int ELMErrLocProcessingStatusGet(unsigned int baseAddr) {
  unsigned int status;
  status =
      (((*((volatile unsigned int *)(baseAddr + (0x800)))) & (0x00000100u)) >>
       (0x00000008u));
  return (status);
}


x86 assembly (clang, -O0):
<ELMErrLocProcessingStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x800,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x100,%eax
shr    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ELMErrLocProcessingStatusGet>:
add    $0x800,%edi
mov    (%rdi),%eax
shr    $0x8,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ELMErrLocProcessingStatusGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 2048
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 256
%10 = lshr i32 %9, 8
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @ELMErrLocProcessingStatusGet(i32 %0) {
%2 = add i32 %0, 2048
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = lshr i32 %5, 8
%7 = and i32 %6, 1
ret i32 %7
}
void HPrintf(int x, int y, char *format, ...) {}


x86 assembly (clang, -O0):
<HPrintf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @HPrintf(i32 %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
/* Variables and functions */
int octdigit(char c) { return (c >= '0' && c <= '7'); }


x86 assembly (clang, -O0):
<octdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <octdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octdigit>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @octdigit(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strcmp(char *const, char *const);
int comparator(const void *p1, const void *p2) {
  return strcmp(*(char *const *)p1, *(char *const *)p2);
}


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

x86 assembly (clang, -O2):
<comparator>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @comparator(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
double clamp(double val, double min, double max) {
  return val < min ? min : val > max ? max : val;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <clamp+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1169 <clamp+0x69>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1155 <clamp+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    115f <clamp+0x5f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @clamp(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* %5
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load double, double* %5
br label %22
12: ; preds = %3
%13 = load double, double* %4
%14 = load double, double* %6
%15 = fcmp ogt double %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load double, double* %6
br label %20
18: ; preds = %12
%19 = load double, double* %4
br label %20
20: ; preds = %18, %16
%21 = phi double [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi double [ %11, %10 ], [ %21, %20 ]
ret double %23
}

LLVM IR (-O2):
define double @clamp(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ malloc(int);
int main(int argc, char *argv[]) {
  int *ip = (int *)malloc(sizeof(int));
  int *jp = ip;
  *jp = 5;
  assert(5 == *jp);
  ip = (int *)malloc(sizeof(int));
  *ip = 11;
  assert(5 == *jp);
  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)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x20(%rbp),%rcx
mov    $0x5,%eax
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xb,(%rax)
mov    -0x20(%rbp),%rcx
mov    $0x5,%eax
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movl   $0x5,(%rax)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
movl   $0xb,(%rax)
xor    %edi,%edi
cmpl   $0x5,(%rbx)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i64 @malloc(i32 4)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %6
%10 = load i32*, i32** %6
store i32* %10, i32** %7
%11 = load i32*, i32** %7
store i32 5, i32* %11
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = icmp eq i32 5, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call i64 @malloc(i32 4)
%18 = inttoptr i64 %17 to i32*
store i32* %18, i32** %6
%19 = load i32*, i32** %6
store i32 11, i32* %19
%20 = load i32*, i32** %7
%21 = load i32, i32* %20
%22 = icmp eq i32 5, %21
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32 5, i32* %4
%5 = tail call i32 @assert(i32 1)
%6 = tail call i64 @malloc(i32 4)
%7 = inttoptr i64 %6 to i32*
store i32 11, i32* %7
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 5
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void reverse(char *s) {
  void reverser(char *s, int i, int len);
  reverser(s, 0, strlen(s));
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1040 <reverser@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <reverser@plt>

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

LLVM IR (-O2):
define void @reverse(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
tail call void @reverser(i8* %0, i32 0, i32 %2)
ret void
}
float obdConvert_0B(unsigned int A, unsigned int B, unsigned int C,
                    unsigned int D) {
  return (float)A;
}


x86 assembly (clang, -O0):
<obdConvert_0B>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_0B>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_0B(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 = load i32, i32* %5
%10 = uitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @obdConvert_0B(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
ret float %5
}
/* Variables and functions */
double measure_plaquette();
double measure_rectangle();
double measure_iwasaki_action(double beta, double c0, double c1) {
  double plaquette;
  double rectangle;
  double iwasaki;
  plaquette = measure_plaquette();
  rectangle = measure_rectangle();
  iwasaki = -(beta / (2. * 3.)) * (c0 * plaquette + c1 * rectangle);
  return iwasaki;
}


x86 assembly (clang, -O0):
<measure_iwasaki_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    $0x0,%al
call   1040 <measure_plaquette@plt>
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <measure_rectangle@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
divsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
mulsd  -0x28(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measure_iwasaki_action>:
sub    $0x28,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1040 <measure_plaquette@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <measure_rectangle@plt>
movsd  0x10(%rsp),%xmm1
divsd  0xea8(%rip),%xmm1
mulsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
mulsd  0x20(%rsp),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @measure_iwasaki_action(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%10 = call double (...) @measure_plaquette()
store double %10, double* %7
%11 = call double (...) @measure_rectangle()
store double %11, double* %8
%12 = load double, double* %4
%13 = fdiv double %12, 6.000000e+00
%14 = fneg double %13
%15 = load double, double* %5
%16 = load double, double* %7
%17 = load double, double* %6
%18 = load double, double* %8
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %15, double %16, double %19)
%21 = fmul double %14, %20
store double %21, double* %9
%22 = load double, double* %9
ret double %22
}

LLVM IR (-O2):
define double @measure_iwasaki_action(double %0, double %1, double %2) {
%4 = tail call double (...) @measure_plaquette()
%5 = tail call double (...) @measure_rectangle()
%6 = fdiv double %0, -6.000000e+00
%7 = fmul double %5, %2
%8 = tail call double @llvm.fmuladd.f64(double %1, double %4, double %7)
%9 = fmul double %6, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ test43_aux(int /*<<< orphan*/);
void test44(int i) {
  int x = i;
  int y;
  for (i = 0; i < 10; i++) {
    test43_aux(x++);
    x += y;
  }
}


x86 assembly (clang, -O0):
<test44>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1159 <test44+0x49>
mov    -0x8(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
call   1030 <test43_aux@plt>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <test44+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test44>:
push   %rbx
mov    %edi,%ebx
call   1030 <test43_aux@plt>
mov    %ebx,%edi
call   1030 <test43_aux@plt>
mov    %ebx,%edi
call   1030 <test43_aux@plt>
mov    %ebx,%edi
call   1030 <test43_aux@plt>
mov    %ebx,%edi
call   1030 <test43_aux@plt>
mov    %ebx,%edi
call   1030 <test43_aux@plt>
mov    %ebx,%edi
call   1030 <test43_aux@plt>
mov    %ebx,%edi
call   1030 <test43_aux@plt>
mov    %ebx,%edi
call   1030 <test43_aux@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <test43_aux@plt>

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

LLVM IR (-O2):
define void @test44(i32 %0) {
%2 = tail call i32 @test43_aux(i32 %0)
%3 = tail call i32 @test43_aux(i32 %0)
%4 = tail call i32 @test43_aux(i32 %0)
%5 = tail call i32 @test43_aux(i32 %0)
%6 = tail call i32 @test43_aux(i32 %0)
%7 = tail call i32 @test43_aux(i32 %0)
%8 = tail call i32 @test43_aux(i32 %0)
%9 = tail call i32 @test43_aux(i32 %0)
%10 = tail call i32 @test43_aux(i32 %0)
%11 = tail call i32 @test43_aux(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetMemory(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void Test(void) {
  char *str = NULL;
  GetMemory(str);
  strcpy(str, "hello world");
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<Test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <GetMemory@plt>
mov    -0x8(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test>:
push   %rax
xor    %edi,%edi
call   1050 <GetMemory@plt>
lea    0xec1(%rip),%rsi
xor    %edi,%edi
call   1030 <strcpy@plt>
lea    0xebf(%rip),%rdi
xor    %esi,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @Test() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @GetMemory(i8* %2)
%4 = load i8*, i8** %1
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @Test() {
%1 = tail call i32 @GetMemory(i8* null)
%2 = tail call i32 @strcpy(i8* null, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* null)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool sixlowpan_iphc_is(uint8_t *data) { return ((*data & (0xe0)) == (0x60)); }


x86 assembly (clang, -O0):
<sixlowpan_iphc_is>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xe0,%eax
cmp    $0x60,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sixlowpan_iphc_is>:
mov    $0xe0,%ecx
and    (%rdi),%ecx
xor    %eax,%eax
cmp    $0x60,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @sixlowpan_iphc_is(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 224
%6 = icmp eq i32 %5, 96
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @sixlowpan_iphc_is(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 224
%4 = icmp eq i32 %3, 96
%5 = zext i1 %4 to i32
ret i32 %5
}
void print(s) char *s;
{}


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

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

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

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
void stdin_flush(void) {
  int c;
  while ((c = getchar()) != '\n' && c != EOF) {
    continue;
  }
}


x86 assembly (clang, -O0):
<stdin_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     1144 <stdin_flush+0x34>
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1154 <stdin_flush+0x44>
jmp    1159 <stdin_flush+0x49>
jmp    1118 <stdin_flush+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdin_flush>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <stdin_flush+0x20>
cmp    (%rbx),%eax
jne    1120 <stdin_flush+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @stdin_flush() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @stdin_flush() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void usage() { errx(1, "usage: arc4random-fork [-bp]"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"usage: arc4random-fork [-bp]\00"
define void @usage() {
%1 = call i32 @errx(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"usage: arc4random-fork [-bp]\00"
define void @usage() {
%1 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
int at_client_stopping() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @at_client_stopping() {
ret i32 0
}
/* Variables and functions */
scalar_t__ isnan(double);
extern int TakeADoubleNaN(double x) {
  if (isnan(x))
    return 4;
  return 0;
}


x86 assembly (clang, -O0):
<TakeADoubleNaN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     113d <TakeADoubleNaN+0x2d>
movl   $0x4,-0x4(%rbp)
jmp    1144 <TakeADoubleNaN+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TakeADoubleNaN>:
push   %rax
call   1030 <isnan@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
shl    $0x2,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @TakeADoubleNaN(double %0) {
%2 = tail call i64 @isnan(double %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 4
ret i32 %4
}
/* Type definitions */
struct dm_hash_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dm_hash_remove_binary(struct dm_hash_table *, char const *,
                                         scalar_t__);
scalar_t__ strlen(char const *);
void dm_hash_remove(struct dm_hash_table *t, const char *key) {
  dm_hash_remove_binary(t, key, strlen(key) + 1);
}


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

x86 assembly (clang, -O2):
<dm_hash_remove>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <dm_hash_remove_binary@plt>

LLVM IR (-O0):
%struct.dm_hash_table = type { i32 }
define void @dm_hash_remove(%struct.dm_hash_table* %0, i8* %1) {
%3 = alloca %struct.dm_hash_table*
%4 = alloca i8*
store %struct.dm_hash_table* %0, %struct.dm_hash_table** %3
store i8* %1, i8** %4
%5 = load %struct.dm_hash_table*, %struct.dm_hash_table** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i32 @dm_hash_remove_binary(%struct.dm_hash_table* %5, i8* %6, i64 %9)
ret void
}

LLVM IR (-O2):
%struct.dm_hash_table = type { i32 }
define void @dm_hash_remove(%struct.dm_hash_table* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @dm_hash_remove_binary(%struct.dm_hash_table* %0, i8* %1, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dot();
void sH() {
  dot();
  dot();
  dot();
  dot();
  cBreak();
}


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

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

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

LLVM IR (-O2):
define void @sH() {
%1 = tail call i32 (...) @dot()
%2 = tail call i32 (...) @dot()
%3 = tail call i32 (...) @dot()
%4 = tail call i32 (...) @dot()
%5 = tail call i32 (...) @cBreak()
ret void
}
const char *periphery_version(void) {
  return "v"
         "1"
         "."
         "1"
         "."
         "1";
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"v1.1.1\00"
define i8* @periphery_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"v1.1.1\00"
define i8* @periphery_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_122() {
  Assert_real((isqrt(122) == 11),
              "/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/stdlib/isqrt.c",
              615, ("Integer square root of 122 should be 11"));
}


x86 assembly (clang, -O0):
<t_sqrt_122>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7a,%edi
call   1030 <isqrt@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x267,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_122>:
push   %rax
mov    $0x7a,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x267,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 122 should be 11\00"
define void @t_sqrt_122() {
%1 = call i32 @isqrt(i32 122)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 615, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 122 should be 11\00"
define void @t_sqrt_122() {
%1 = tail call i32 @isqrt(i32 122)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 615, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fabs(double);
int AproxEqualOrLt(double a, double b) {
  if (fabs(a - b) < 1e-6 || a < b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AproxEqualOrLt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec3(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     115b <AproxEqualOrLt+0x4b>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1167 <AproxEqualOrLt+0x57>
movl   $0x1,-0x4(%rbp)
jmp    116e <AproxEqualOrLt+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AproxEqualOrLt>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
test   %eax,%eax
setle  %al
movsd  0x8(%rsp),%xmm0
ucomisd 0x10(%rsp),%xmm0
seta   %cl
or     %al,%cl
movzbl %cl,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @AproxEqualOrLt(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fsub double %6, %7
%9 = call i32 @fabs(double %8)
%10 = sitofp i32 %9 to double
%11 = fcmp olt double %10, 0x3EB0C6F7A0B5ED8D
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12, %2
store i32 1, i32* %3
br label %18
17: ; preds = %12
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @AproxEqualOrLt(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i32 @fabs(double %3)
%5 = icmp slt i32 %4, 1
%6 = fcmp olt double %0, %1
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
unsigned int strlen(char const *);
unsigned hash_str_impl(const char *str) {
  unsigned hash = strlen(str);
  unsigned c;
  while ((c = *str++) != 0)
    hash = ((hash << 5) ^ (hash >> 27)) ^ c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_str_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     115f <hash_str_impl+0x4f>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0xc(%rbp),%ecx
shr    $0x1b,%ecx
xor    %ecx,%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <hash_str_impl+0x18>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str_impl>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    (%rbx),%cl
test   %cl,%cl
je     1143 <hash_str_impl+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %cl,%ecx
rol    $0x5,%eax
xor    %ecx,%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <hash_str_impl+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hash_str_impl(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %13, %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
store i32 %11, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %7
%14 = load i32, i32* %3
%15 = shl i32 %14, 5
%16 = load i32, i32* %3
%17 = lshr i32 %16, 27
%18 = xor i32 %15, %17
%19 = load i32, i32* %4
%20 = xor i32 %18, %19
store i32 %20, i32* %3
br label %7
21: ; preds = %7
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @hash_str_impl(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %13, %5 ], [ %3, %1 ]
%7 = phi i8* [ %10, %5 ], [ %0, %1 ]
%8 = phi i32 [ %12, %5 ], [ %2, %1 ]
%9 = sext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = tail call i32 @llvm.fshl.i32(i32 %8, i32 %8, i32 5)
%12 = xor i32 %11, %9
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %1
%16 = phi i32 [ %2, %1 ], [ %12, %5 ]
ret i32 %16
}
/* Variables and functions */
float sqrt(float);
float Side(float val1, float val2) {
  float val;
  val = sqrt(val1 * val1 - val2 * val2);
  return val;
}


x86 assembly (clang, -O0):
<Side>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Side>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <Side+0x19>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @Side(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %3
%8 = load float, float* %4
%9 = load float, float* %4
%10 = fmul float %8, %9
%11 = fneg float %10
%12 = call float @llvm.fmuladd.f32(float %6, float %7, float %11)
%13 = call float @sqrt(float %12)
store float %13, float* %5
%14 = load float, float* %5
ret float %14
}

LLVM IR (-O2):
define float @Side(float %0, float %1) {
%3 = fneg float %1
%4 = fmul float %3, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = tail call float @sqrt(float %5)
ret float %6
}
/* Type definitions */
struct event_base {
  int dummy;
};
struct ev_loop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ev_is_default_loop(struct ev_loop *);
int /*<<< orphan*/ ev_loop_destroy(struct ev_loop *);
void event_base_free(struct event_base *base) {
  struct ev_loop *loop = (struct ev_loop *)base;
  if (!ev_is_default_loop(loop))
    ev_loop_destroy(loop);
}


x86 assembly (clang, -O0):
<event_base_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ev_is_default_loop@plt>
cmp    $0x0,%eax
jne    114f <event_base_free+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <ev_loop_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_base_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ev_is_default_loop@plt>
test   %eax,%eax
je     112f <event_base_free+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ev_loop_destroy@plt>

LLVM IR (-O0):
%struct.event_base = type { i32 }
%struct.ev_loop = type { i32 }
define void @event_base_free(%struct.event_base* %0) {
%2 = alloca %struct.event_base*
%3 = alloca %struct.ev_loop*
store %struct.event_base* %0, %struct.event_base** %2
%4 = load %struct.event_base*, %struct.event_base** %2
%5 = bitcast %struct.event_base* %4 to %struct.ev_loop*
store %struct.ev_loop* %5, %struct.ev_loop** %3
%6 = load %struct.ev_loop*, %struct.ev_loop** %3
%7 = call i32 @ev_is_default_loop(%struct.ev_loop* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load %struct.ev_loop*, %struct.ev_loop** %3
%11 = call i32 @ev_loop_destroy(%struct.ev_loop* %10)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.event_base = type { i32 }
%struct.ev_loop = type { i32 }
define void @event_base_free(%struct.event_base* %0) {
%2 = bitcast %struct.event_base* %0 to %struct.ev_loop*
%3 = tail call i32 @ev_is_default_loop(%struct.ev_loop* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @ev_loop_destroy(%struct.ev_loop* %2)
br label %7
7: ; preds = %5, %1
ret void
}
int insy_gcm_mult_lenc_lsb_csr_debug_set(
    unsigned int dev_id, union insy_gcm_mult_lenc_lsb_csr_debug_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<insy_gcm_mult_lenc_lsb_csr_debug_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.insy_gcm_mult_lenc_lsb_csr_debug_u = type opaque
define i32 @insy_gcm_mult_lenc_lsb_csr_debug_set(i32 %0, %union.insy_gcm_mult_lenc_lsb_csr_debug_u* %1) {
%3 = alloca i32
%4 = alloca %union.insy_gcm_mult_lenc_lsb_csr_debug_u*
store i32 %0, i32* %3
store %union.insy_gcm_mult_lenc_lsb_csr_debug_u* %1, %union.insy_gcm_mult_lenc_lsb_csr_debug_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.insy_gcm_mult_lenc_lsb_csr_debug_u = type opaque
define i32 @insy_gcm_mult_lenc_lsb_csr_debug_set(i32 %0, %union.insy_gcm_mult_lenc_lsb_csr_debug_u* nocapture readnone %1) {
ret i32 1
}