xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
int getch();
int /*<<< orphan*/ nodelay(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
int getch_nodelay(void) {
  int retval;
  nodelay(stdscr, TRUE);
  retval = getch();
  nodelay(stdscr, FALSE);
  return retval;
}


x86 assembly (clang, -O0):
<getch_nodelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
call   1030 <nodelay@plt>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
call   1030 <nodelay@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch_nodelay>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    (%r14),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1030 <nodelay@plt>
xor    %eax,%eax
call   1040 <getch@plt>
mov    %eax,%ebx
mov    (%r14),%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
call   1030 <nodelay@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@FALSE = global i32 0
define i32 @getch_nodelay() {
%1 = alloca i32
%2 = load i32, i32* @stdscr
%3 = load i32, i32* @TRUE
%4 = call i32 @nodelay(i32 %2, i32 %3)
%5 = call i32 (...) @getch()
store i32 %5, i32* %1
%6 = load i32, i32* @stdscr
%7 = load i32, i32* @FALSE
%8 = call i32 @nodelay(i32 %6, i32 %7)
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@FALSE = global i32 0
define i32 @getch_nodelay() {
%1 = load i32, i32* @stdscr
%2 = load i32, i32* @TRUE
%3 = tail call i32 @nodelay(i32 %1, i32 %2)
%4 = tail call i32 (...) @getch()
%5 = load i32, i32* @stdscr
%6 = load i32, i32* @FALSE
%7 = tail call i32 @nodelay(i32 %5, i32 %6)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void copy5(int *x, int *y) { memcpy(x, y, 5); }


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

x86 assembly (clang, -O2):
<copy5>:
mov    $0x5,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @copy5(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 5)
ret void
}
int Operand_lsi4x4_decode(unsigned int *valp) {
  unsigned lsi4x4_0, r_0;
  r_0 = *valp & 0xf;
  lsi4x4_0 = r_0 << 2;
  *valp = lsi4x4_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_lsi4x4_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_lsi4x4_decode>:
mov    (%rdi),%eax
shl    $0x2,%eax
and    $0x3c,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_lsi4x4_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 15
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 2
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_lsi4x4_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 2
%4 = and i32 %3, 60
store i32 %4, i32* %0
ret i32 0
}
int get_delay(int freq) {
  if (freq == 0) {
    freq = 1;
  }
  return ((1000 / freq) * 500);
}


x86 assembly (clang, -O0):
<get_delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1118 <get_delay+0x18>
movl   $0x1,-0x4(%rbp)
mov    $0x3e8,%eax
cltd
idivl  -0x4(%rbp)
imul   $0x1f4,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_delay>:
test   %edi,%edi
mov    $0x1,%ecx
cmovne %edi,%ecx
mov    $0x3e8,%eax
xor    %edx,%edx
idiv   %ecx
imul   $0x1f4,%eax,%eax
ret

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

LLVM IR (-O2):
define i32 @get_delay(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
%4 = sdiv i32 1000, %3
%5 = mul nsw i32 %4, 500
ret i32 %5
}
/* Variables and functions */
unsigned int strlen(char const *s) {
  const char *begin = s;
  while (*s)
    s++;
  return s - begin;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %5
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void OUTPUT(int j) { printf(" match=%d! \n", j); }


x86 assembly (clang, -O0):
<OUTPUT>:
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):
<OUTPUT>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c" match=%d! \0A\00"
define void @OUTPUT(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  char c = '0';
  int x = c - '0';
  printf("c:\n\tc = [%c]\n\td = [%d]\n", c, c);
  printf("x:\n\tc = [%c]\n\td = [%d]\n", x, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x30,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
movsbl -0x5(%rbp),%esi
movsbl -0x5(%rbp),%edx
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x30,%esi
mov    $0x30,%edx
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"c:\0A\09c = [%c]\0A\09d = [%d]\0A\00"
@.str.1 = [24 x i8] c"x:\0A\09c = [%c]\0A\09d = [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i8 48, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 48
store i32 %6, i32* %3
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"c:\0A\09c = [%c]\0A\09d = [%d]\0A\00"
@.str.1 = [24 x i8] c"x:\0A\09c = [%c]\0A\09d = [%d]\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 48, i32 48)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int i2c_read_reg(int);
int i2c_read_tx_data() { return i2c_read_reg(5); }


x86 assembly (clang, -O0):
<i2c_read_tx_data>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <i2c_read_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_read_tx_data>:
mov    $0x5,%edi
jmp    1030 <i2c_read_reg@plt>

LLVM IR (-O0):
define i32 @i2c_read_tx_data() {
%1 = call i32 @i2c_read_reg(i32 5)
ret i32 %1
}

LLVM IR (-O2):
define i32 @i2c_read_tx_data() {
%1 = tail call i32 @i2c_read_reg(i32 5)
ret i32 %1
}
double dmax1(a, b)
double a, b;
{
  if (a >= b)
    return (a);
  else
    return (b);
}


x86 assembly (clang, -O0):
<dmax1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     112d <dmax1+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <dmax1+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmax1>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dmax1(double %0, double %1) {
%3 = alloca double
%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 = fcmp oge double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @dmax1(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void debug_dma_unmap_sg(struct device *dev, struct scatterlist *sglist,
                        int nelems, int dir) {}


x86 assembly (clang, -O0):
<debug_dma_unmap_sg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device = type opaque
%struct.scatterlist = type opaque
define void @debug_dma_unmap_sg(%struct.device* %0, %struct.scatterlist* %1, i32 %2, i32 %3) {
%5 = alloca %struct.device*
%6 = alloca %struct.scatterlist*
%7 = alloca i32
%8 = alloca i32
store %struct.device* %0, %struct.device** %5
store %struct.scatterlist* %1, %struct.scatterlist** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
%struct.scatterlist = type opaque
define void @debug_dma_unmap_sg(%struct.device* nocapture %0, %struct.scatterlist* nocapture %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_d2a(int, int);
void set_bluetooth(int power) { set_d2a(power, 0x0800); }


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

x86 assembly (clang, -O2):
<set_bluetooth>:
mov    $0x800,%esi
jmp    1030 <set_d2a@plt>

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

LLVM IR (-O2):
define void @set_bluetooth(i32 %0) {
%2 = tail call i32 @set_d2a(i32 %0, i32 2048)
ret void
}
int gethddl(int *headl, char *head) {
  char *hp;
  for (hp = head; *hp != '}'; hp++)
    ;
  *headl = hp - head + 1;
  return 0;
}


x86 assembly (clang, -O0):
<gethddl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7d,%eax
je     113a <gethddl+0x3a>
jmp    1129 <gethddl+0x29>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <gethddl+0x14>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethddl>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x7d,(%rsi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <gethddl+0x10>
mov    %eax,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @gethddl(i32* nocapture writeonly %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 125
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %1 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = add i32 %12, 1
store i32 %13, i32* %0
ret i32 0
}
void I2C2_ER_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @I2C2_ER_IRQHandler() {
ret void
}
void johab_to_3(int johab, int *cho, int *jung, int *jong) {
  *cho = (johab >> 10) & 0x1f;
  *jung = (johab >> 5) & 0x1f;
  *jong = (johab)&0x1f;
}


x86 assembly (clang, -O0):
<johab_to_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0xa,%ecx
and    $0x1f,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
and    $0x1f,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<johab_to_3>:
mov    %edi,%eax
shr    $0xa,%eax
and    $0x1f,%eax
mov    %eax,(%rsi)
mov    %edi,%eax
shr    $0x5,%eax
and    $0x1f,%eax
mov    %eax,(%rdx)
and    $0x1f,%edi
mov    %edi,(%rcx)
ret

LLVM IR (-O0):
define void @johab_to_3(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 = ashr i32 %9, 10
%11 = and i32 %10, 31
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = ashr i32 %13, 5
%15 = and i32 %14, 31
%16 = load i32*, i32** %7
store i32 %15, i32* %16
%17 = load i32, i32* %5
%18 = and i32 %17, 31
%19 = load i32*, i32** %8
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @johab_to_3(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = lshr i32 %0, 10
%6 = and i32 %5, 31
store i32 %6, i32* %1
%7 = lshr i32 %0, 5
%8 = and i32 %7, 31
store i32 %8, i32* %2
%9 = and i32 %0, 31
store i32 %9, i32* %3
ret void
}
/* Type definitions */
struct hiena_frag {
  int dummy;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
struct hiena_frag *frag_split(struct hiena_frag *f, off_t pos) {
  off_t b[4];
  struct hiena_frag *fc[2];
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.hiena_frag = type { i32 }
define %struct.hiena_frag* @frag_split(%struct.hiena_frag* %0, i32 %1) {
%3 = alloca %struct.hiena_frag*
%4 = alloca i32
%5 = alloca [4 x i32]
%6 = alloca [2 x %struct.hiena_frag*]
store %struct.hiena_frag* %0, %struct.hiena_frag** %3
store i32 %1, i32* %4
ret %struct.hiena_frag* null
}

LLVM IR (-O2):
%struct.hiena_frag = type { i32 }
define noalias %struct.hiena_frag* @frag_split(%struct.hiena_frag* nocapture readnone %0, i32 %1) {
ret %struct.hiena_frag* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_iochannel_creds_supported() {
  printf("NOT IMPLEMENTED:"
         "pa_iochannel_creds_supported"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_iochannel_creds_supported\0A\00"
define i32 @pa_iochannel_creds_supported() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_iochannel_creds_supported\00"
define i32 @pa_iochannel_creds_supported() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
const char *getString() { return "Hello, 64-bit world!\n"; }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Hello, 64-bit world!\0A\00"
define i8* @getString() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [22 x i8] c"Hello, 64-bit world!\0A\00"
define i8* @getString() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}
int azymuth_delta(int az1, int az2) {
  int delta;
  delta = az1 - az2;
  while (delta > 180)
    delta -= 360;
  while (delta < -180)
    delta += 360;
  return delta;
}


x86 assembly (clang, -O0):
<azymuth_delta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xb4,-0xc(%rbp)
jle    1130 <azymuth_delta+0x30>
mov    -0xc(%rbp),%eax
sub    $0x168,%eax
mov    %eax,-0xc(%rbp)
jmp    1113 <azymuth_delta+0x13>
jmp    1135 <azymuth_delta+0x35>
cmpl   $0xffffff4c,-0xc(%rbp)
jge    1152 <azymuth_delta+0x52>
mov    -0xc(%rbp),%eax
add    $0x168,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <azymuth_delta+0x35>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<azymuth_delta>:
mov    %edi,%eax
sub    %esi,%eax
cmp    $0xb4,%eax
mov    $0xb4,%ecx
cmovl  %eax,%ecx
add    %esi,%ecx
neg    %ecx
add    %edi,%ecx
add    $0x167,%ecx
shr    $0x3,%ecx
imul   $0x16c16c17,%rcx,%rcx
shr    $0x22,%rcx
imul   $0x168,%ecx,%ecx
sub    %ecx,%eax
cmp    $0xffffff4d,%eax
mov    $0xffffff4c,%edx
cmovge %eax,%edx
add    %esi,%edx
add    %ecx,%edx
xor    %eax,%eax
sub    %edi,%edx
setne  %al
sub    %eax,%edx
shr    $0x3,%edx
imul   $0x16c16c17,%rdx,%rdx
shr    $0x22,%rdx
add    %eax,%edx
imul   $0x168,%edx,%eax
add    %edi,%eax
add    %esi,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @azymuth_delta(i32 %0, i32 %1) {
%3 = sub i32 %0, %1
%4 = add i32 %0, 359
%5 = call i32 @llvm.smin.i32(i32 %3, i32 180)
%6 = add i32 %5, %1
%7 = sub i32 %4, %6
%8 = urem i32 %7, 360
%9 = sub i32 %7, %8
%10 = sub i32 %3, %9
%11 = call i32 @llvm.smax.i32(i32 %10, i32 -180)
%12 = add i32 %11, %1
%13 = add i32 %12, %9
%14 = sub i32 %13, %0
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i32
%17 = sub i32 %14, %16
%18 = udiv i32 %17, 360
%19 = add nuw nsw i32 %18, %16
%20 = mul i32 %19, 360
%21 = add i32 %20, %0
%22 = add i32 %9, %1
%23 = sub i32 %21, %22
ret i32 %23
}
/* Variables and functions */
int /*<<< orphan*/ module1init();
int main() {
  module1init();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <module1init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @module1init()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @module1init()
ret i32 0
}
/* Variables and functions */
const char *internal_combine_cb(void *data, int number, int threshold,
                                size_t size) {
  (void)threshold;
  (void)size;
  const char **shares = (const char **)data;
  return shares[number - 1];
}


x86 assembly (clang, -O0):
<internal_combine_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_combine_cb>:
movslq %esi,%rax
mov    -0x8(%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define i8* @internal_combine_cb(i8* %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8**
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%10 = load i32, i32* %7
%11 = load i64, i64* %8
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to i8**
store i8** %13, i8*** %9
%14 = load i8**, i8*** %9
%15 = load i32, i32* %6
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %14, i64 %17
%19 = load i8*, i8** %18
ret i8* %19
}

LLVM IR (-O2):
define i8* @internal_combine_cb(i8* nocapture %0, i32 %1, i32 %2, i64 %3) {
%5 = bitcast i8* %0 to i8**
%6 = add nsw i32 %1, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_bitset_set() {
  printf("NOT IMPLEMENTED:"
         "pa_bitset_set"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_bitset_set\0A\00"
define i32 @pa_bitset_set() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_bitset_set\00"
define i32 @pa_bitset_set() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_32() {
  Assert_real((isqrt(32) == 5),
              "/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",
              165, ("Integer square root of 32 should be 5"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_32>:
push   %rax
mov    $0x20,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xa5,%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 = [38 x i8] c"Integer square root of 32 should be 5\00"
define void @t_sqrt_32() {
%1 = call i32 @isqrt(i32 32)
%2 = icmp eq i32 %1, 5
%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 165, i8* getelementptr inbounds ([38 x i8], [38 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 = [38 x i8] c"Integer square root of 32 should be 5\00"
define void @t_sqrt_32() {
%1 = tail call i32 @isqrt(i32 32)
%2 = icmp eq i32 %1, 5
%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 165, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex16(int, unsigned short);
void print_err_hex16(unsigned short value) { __console_tx_hex16(3, value); }


x86 assembly (clang, -O0):
<print_err_hex16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x3,%edi
movzwl -0x2(%rbp),%esi
call   1030 <__console_tx_hex16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_err_hex16>:
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <__console_tx_hex16@plt>

LLVM IR (-O0):
define void @print_err_hex16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @__console_tx_hex16(i32 3, i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_err_hex16(i16 zeroext %0) {
%2 = tail call i32 @__console_tx_hex16(i32 3, i16 zeroext %0)
ret void
}
signed long long
signedlonglong_ignoring_signedlonglongint(signed long long x,
                                          signed long long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlonglong_ignoring_signedlonglongint>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @signedlonglong_ignoring_signedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ err_quit(char *);
void test(void) { err_quit("err_quit"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"err_quit\00"
define void @test() {
%1 = tail call i32 @err_quit(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned long FanChannelStatus(unsigned long ulBase, unsigned long ulChannel) {
  ;
  ;
  return (((*((volatile unsigned long *)(ulBase + 0x00000000))) >>
           (ulChannel * 2)) &
          0x00000003);
}


x86 assembly (clang, -O0):
<FanChannelStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
shl    $0x1,%rcx
shr    %cl,%rax
and    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FanChannelStatus>:
mov    (%rdi),%rax
lea    (%rsi,%rsi,1),%ecx
shr    %cl,%rax
and    $0x3,%eax
ret

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

LLVM IR (-O2):
define i64 @FanChannelStatus(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
%4 = load volatile i64, i64* %3
%5 = shl i64 %1, 1
%6 = lshr i64 %4, %5
%7 = and i64 %6, 3
ret i64 %7
}
/* Variables and functions */
int testifisvalue(char *str) {
  if (str == NULL)
    return (0);
  if (str[0] == '-')
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<testifisvalue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <testifisvalue+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1142 <testifisvalue+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    113b <testifisvalue+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1142 <testifisvalue+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testifisvalue>:
xor    %eax,%eax
test   %rdi,%rdi
je     110d <testifisvalue+0xd>
cmpb   $0x2d,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @testifisvalue(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %15
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 45
br i1 %12, label %13, label %14
13: ; preds = %7
store i32 0, i32* %2
br label %15
14: ; preds = %7
store i32 1, i32* %2
br label %15
15: ; preds = %14, %13, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @testifisvalue(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp ne i8 %4, 45
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ hostcall_host_fault();
void host_fault(void) { hostcall_host_fault(); }


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

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

LLVM IR (-O0):
define void @host_fault() {
%1 = call i32 (...) @hostcall_host_fault()
ret void
}

LLVM IR (-O2):
define void @host_fault() {
%1 = tail call i32 (...) @hostcall_host_fault()
ret void
}
/* Variables and functions */
float rand_float();
void gen_floats(float *vect, int len) {
  int i;
  for (i = 0; i < len; i++)
    vect[i] = rand_float();
}


x86 assembly (clang, -O0):
<gen_floats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <gen_floats+0x44>
mov    $0x0,%al
call   1030 <rand_float@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <gen_floats+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_floats>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <gen_floats+0x36>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand_float@plt>
movss  %xmm0,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <gen_floats+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @gen_floats(float* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call float (...) @rand_float()
%9 = getelementptr inbounds float, float* %0, i64 %7
store float %8, float* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ ft_printf_fd(int, char *, char const *const);
int ft_perror(void) {
  extern const char *const sys_errlist[];
  if (errno > 106)
    errno = 0;
  ft_printf_fd(2, "Error : %s.\n", sys_errlist[errno]);
  return (0);
}


x86 assembly (clang, -O0):
<ft_perror>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
cmpl   $0x6a,(%rax)
jle    1131 <ft_perror+0x21>
mov    0x2ead(%rip),%rax
movl   $0x0,(%rax)
mov    0x2ea0(%rip),%rax
movslq (%rax),%rcx
mov    0x2eb6(%rip),%rax
mov    (%rax,%rcx,8),%rdx
mov    $0x2,%edi
lea    0xeae(%rip),%rsi
call   1030 <ft_printf_fd@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_perror>:
push   %rax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%eax
cmp    $0x6b,%eax
jl     1127 <ft_perror+0x17>
movl   $0x0,(%rcx)
xor    %eax,%eax
cltq
mov    0x2ec8(%rip),%rcx
mov    (%rcx,%rax,8),%rdx
lea    0xec5(%rip),%rsi
mov    $0x2,%edi
call   1030 <ft_printf_fd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [13 x i8] c"Error : %s.\0A\00"
@sys_errlist = external constant [0 x i8*]
define i32 @ft_perror() {
%1 = load i32, i32* @errno
%2 = icmp sgt i32 %1, 106
br i1 %2, label %3, label %4
3: ; preds = %0
store i32 0, i32* @errno
br label %4
4: ; preds = %3, %0
%5 = load i32, i32* @errno
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %6
%8 = load i8*, i8** %7
%9 = call i32 @ft_printf_fd(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [13 x i8] c"Error : %s.\0A\00"
@sys_errlist = external constant [0 x i8*]
define i32 @ft_perror() {
%1 = load i32, i32* @errno
%2 = icmp sgt i32 %1, 106
br i1 %2, label %3, label %4
3: ; preds = %0
store i32 0, i32* @errno
br label %4
4: ; preds = %3, %0
%5 = phi i32 [ 0, %3 ], [ %1, %0 ]
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %6
%8 = load i8*, i8** %7
%9 = tail call i32 @ft_printf_fd(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_extract_range(struct list **, int);
int /*<<< orphan*/ list_free(int /*<<< orphan*/, void (*)(void *));
void list_remove_range(struct list **l, int count, void (*f)(void *)) {
  list_free(list_extract_range(l, count), f);
}


x86 assembly (clang, -O0):
<list_remove_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <list_extract_range@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1030 <list_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_remove_range>:
push   %rbx
mov    %rdx,%rbx
call   1040 <list_extract_range@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <list_free@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_remove_range(%struct.list** %0, i32 %1, void (i8*)* %2) {
%4 = alloca %struct.list**
%5 = alloca i32
%6 = alloca void (i8*)*
store %struct.list** %0, %struct.list*** %4
store i32 %1, i32* %5
store void (i8*)* %2, void (i8*)** %6
%7 = load %struct.list**, %struct.list*** %4
%8 = load i32, i32* %5
%9 = call i32 @list_extract_range(%struct.list** %7, i32 %8)
%10 = load void (i8*)*, void (i8*)** %6
%11 = call i32 @list_free(i32 %9, void (i8*)* %10)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_remove_range(%struct.list** %0, i32 %1, void (i8*)* %2) {
%4 = tail call i32 @list_extract_range(%struct.list** %0, i32 %1)
%5 = tail call i32 @list_free(i32 %4, void (i8*)* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("Hello World!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int in_addr_t;

/* Variables and functions */
int htonl(int);
bool ipv4_is_loopback(in_addr_t addr) {
  return (addr & htonl(0xff000000UL)) == htonl(0x7f000000UL);
}


x86 assembly (clang, -O0):
<ipv4_is_loopback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xff000000,%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7f000000,%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv4_is_loopback>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xff000000,%edi
call   1030 <htonl@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x7f000000,%edi
call   1030 <htonl@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ipv4_is_loopback(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @htonl(i32 -16777216)
%5 = and i32 %3, %4
%6 = call i32 @htonl(i32 2130706432)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ipv4_is_loopback(i32 %0) {
%2 = tail call i32 @htonl(i32 -16777216)
%3 = and i32 %2, %0
%4 = tail call i32 @htonl(i32 2130706432)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int func1(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int func2(jmp_buf *env, int x) {
  if (x == 0)
    longjmp(*env, 2);
  return func1(env, x - 1) + 1;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <func2+0x29>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x2,%esi
call   1040 <longjmp@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <func1@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rax
test   %esi,%esi
je     1132 <func2+0x12>
add    $0xffffffff,%esi
call   1030 <func1@plt>
add    $0x1,%eax
pop    %rcx
ret
mov    (%rdi),%edi
mov    $0x2,%esi
call   1040 <longjmp@plt>

LLVM IR (-O0):
define i32 @func2(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @longjmp(i32 %9, i32 2)
unreachable
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = call i32 @func1(i32* %12, i32 %14)
%16 = add nsw i32 %15, 1
ret i32 %16
}

LLVM IR (-O2):
define i32 @func2(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* %0
%6 = tail call i32 @longjmp(i32 %5, i32 2)
unreachable
7: ; preds = %2
%8 = add nsw i32 %1, -1
%9 = tail call i32 @func1(i32* %0, i32 %8)
%10 = add nsw i32 %9, 1
ret i32 %10
}
void function_est_date_end(char *est_end) {}


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

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

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

LLVM IR (-O2):
define void @function_est_date_end(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
scalar_t__ islittleendian();
uint16_t ntohs(uint16_t netshort) {
  if (islittleendian())
    return (netshort << 8) | (netshort >> 8);
  else
    return netshort;
}


x86 assembly (clang, -O0):
<ntohs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <islittleendian@plt>
cmp    $0x0,%rax
je     1142 <ntohs+0x32>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <ntohs+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohs>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <islittleendian@plt>
mov    %ebx,%edx
shl    $0x8,%edx
mov    %ebx,%ecx
sar    $0x8,%ecx
or     %edx,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ntohs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @islittleendian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = shl i32 %7, 8
%9 = load i32, i32* %3
%10 = ashr i32 %9, 8
%11 = or i32 %8, %10
store i32 %11, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ntohs(i32 %0) {
%2 = tail call i64 (...) @islittleendian()
%3 = icmp eq i64 %2, 0
%4 = shl i32 %0, 8
%5 = ashr i32 %0, 8
%6 = or i32 %4, %5
%7 = select i1 %3, i32 %0, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bar(int /*<<< orphan*/, double);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  if (bar(0, 2.0) != 26)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
movsd  0xeb7(%rip),%xmm0
call   1040 <bar@plt>
cmp    $0x1a,%eax
je     115e <main+0x2e>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
xor    %edi,%edi
call   1040 <bar@plt>
cmp    $0x1a,%eax
jne    114c <main+0x1c>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bar(i32 0, double 2.000000e+00)
%3 = icmp ne i32 %2, 26
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 0, double 2.000000e+00)
%2 = icmp eq i32 %1, 26
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_B9uint16_reg(unsigned short val) {
  return ((val) & (-0xB9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B9uint16_reg>:
test   $0xff47,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B9uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -185
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct HashItr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct HashItr *);
void HashDeleteItr(struct HashItr *Itr) { free(Itr); }


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

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

LLVM IR (-O0):
%struct.HashItr = type { i32 }
define void @HashDeleteItr(%struct.HashItr* %0) {
%2 = alloca %struct.HashItr*
store %struct.HashItr* %0, %struct.HashItr** %2
%3 = load %struct.HashItr*, %struct.HashItr** %2
%4 = call i32 @free(%struct.HashItr* %3)
ret void
}

LLVM IR (-O2):
%struct.HashItr = type { i32 }
define void @HashDeleteItr(%struct.HashItr* nocapture %0) {
%2 = tail call i32 @free(%struct.HashItr* %0)
ret void
}