xunge/DecIR huggingface dataset:
/* Variables and functions */
long htonl(int /*<<< orphan*/);
int /*<<< orphan*/ random();
void fill_buffer(long *buffer, int len) {
  int i;
  for (i = 0; i < len; i++)
    buffer[i] = htonl(random());
}


x86 assembly (clang, -O0):
<fill_buffer>:
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    116d <fill_buffer+0x4d>
mov    $0x0,%al
call   1040 <random@plt>
mov    %eax,%edi
call   1030 <htonl@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <fill_buffer+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_buffer>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    115b <fill_buffer+0x3b>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <random@plt>
mov    %eax,%edi
call   1030 <htonl@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <fill_buffer+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @fill_buffer(i64* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i32 (...) @random()
%9 = tail call i64 @htonl(i32 %8)
%10 = getelementptr inbounds i64, i64* %0, i64 %7
store i64 %9, i64* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int foo2(void) {
  int rc;
  return rc;
  *&rc = 0;
}


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

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

LLVM IR (-O0):
define i32 @foo2() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @foo2() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ OAL_CREATE_SEMAPHORE();
signed int fc8180_spib_init(void *handle, unsigned short param1,
                            unsigned short param2) {
  OAL_CREATE_SEMAPHORE();
  return 0;
}


x86 assembly (clang, -O0):
<fc8180_spib_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <OAL_CREATE_SEMAPHORE@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fc8180_spib_init(i8* %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i16
store i8* %0, i8** %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = call i32 (...) @OAL_CREATE_SEMAPHORE()
ret i32 0
}

LLVM IR (-O2):
define i32 @fc8180_spib_init(i8* nocapture readnone %0, i16 zeroext %1, i16 zeroext %2) {
%4 = tail call i32 (...) @OAL_CREATE_SEMAPHORE()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ SHA512_CTX;

/* Variables and functions */
int /*<<< orphan*/ SHA384_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ SHA512_Final(unsigned char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ SHA512_Update(int /*<<< orphan*/ *, unsigned char const *,
                                 size_t);
unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md) {
  SHA512_CTX c;
  static unsigned char m[48];
  if (md == NULL)
    md = m;
  SHA384_Init(&c);
  SHA512_Update(&c, d, n);
  SHA512_Final(md, &c);
  1;
  return (md);
}


x86 assembly (clang, -O0):
<SHA384>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115a <SHA384+0x2a>
lea    0x2efa(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <SHA384_Init@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x1c(%rbp),%rdi
call   1040 <SHA512_Update@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <SHA512_Final@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA384>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
test   %rdx,%rdx
lea    0x2f08(%rip),%rbx
cmovne %rdx,%rbx
lea    0x4(%rsp),%r12
mov    %r12,%rdi
call   1030 <SHA384_Init@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <SHA512_Update@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <SHA512_Final@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SHA384.m = internal global [48 x i8] zeroinitializer
define i8* @SHA384(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %3
store i8* getelementptr inbounds ([48 x i8], [48 x i8]* @SHA384.m, i64 0, i64 0), i8** %6
br label %11
11: ; preds = %10, %3
%12 = call i32 @SHA384_Init(i32* %7)
%13 = load i8*, i8** %4
%14 = load i64, i64* %5
%15 = call i32 @SHA512_Update(i32* %7, i8* %13, i64 %14)
%16 = load i8*, i8** %6
%17 = call i32 @SHA512_Final(i8* %16, i32* %7)
%18 = load i8*, i8** %6
ret i8* %18
}

LLVM IR (-O2):
@SHA384.m = internal global [48 x i8] zeroinitializer
define i8* @SHA384(i8* %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = icmp eq i8* %2, null
%7 = select i1 %6, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @SHA384.m, i64 0, i64 0), i8* %2
%8 = call i32 @SHA384_Init(i32* %4)
%9 = call i32 @SHA512_Update(i32* %4, i8* %0, i64 %1)
%10 = call i32 @SHA512_Final(i8* %7, i32* %4)
ret i8* %7
}
/* Type definitions */
struct feature_pair {
  int dummy;
};
struct CovariateAnalysis {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _emitJSONUniNameL(const struct feature_pair *pair,
                       const struct CovariateAnalysis *covan, FILE *fp) {}


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

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

LLVM IR (-O0):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONUniNameL(%struct.feature_pair* %0, %struct.CovariateAnalysis* %1, i32* %2) {
%4 = alloca %struct.feature_pair*
%5 = alloca %struct.CovariateAnalysis*
%6 = alloca i32*
store %struct.feature_pair* %0, %struct.feature_pair** %4
store %struct.CovariateAnalysis* %1, %struct.CovariateAnalysis** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONUniNameL(%struct.feature_pair* nocapture %0, %struct.CovariateAnalysis* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void verifica_conta(int *ptr) {
  for (int i = 0; i < 1000; i++)
    if (ptr[0] == ptr[i])
      printf("\tConta já existente\n");
}


x86 assembly (clang, -O0):
<verifica_conta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1166 <verifica_conta+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1153 <verifica_conta+0x43>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <verifica_conta+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <verifica_conta+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifica_conta>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xedf(%rip),%r14
jmp    113d <verifica_conta+0x2d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    $0x3e8,%rbx
je     1150 <verifica_conta+0x40>
mov    (%r15),%eax
cmp    (%r15,%rbx,4),%eax
jne    1130 <verifica_conta+0x20>
mov    %r14,%rdi
call   1030 <puts@plt>
jmp    1130 <verifica_conta+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\09Conta j\C3\A1 existente\0A\00"
define void @verifica_conta(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1000
br i1 %6, label %7, label %23
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = icmp eq i32 %10, %15
br i1 %16, label %17, label %19
17: ; preds = %7
%18 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %7
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"\09Conta j\C3\A1 existente\00"
define void @verifica_conta(i32* nocapture %0) {
br label %3
2: ; preds = %11
ret void
3: ; preds = %1, %11
%4 = phi i64 [ 0, %1 ], [ %12, %11 ]
%5 = load i32, i32* %0
%6 = getelementptr inbounds i32, i32* %0, i64 %4
%7 = load i32, i32* %6
%8 = icmp eq i32 %5, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %3, %9
%12 = add nuw nsw i64 %4, 1
%13 = icmp eq i64 %12, 1000
br i1 %13, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int sum;
  sum = 50 + 25;
  printf("The sum of 50 and 25 is %i\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4b,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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    $0x4b,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"The sum of 50 and 25 is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 75, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"The sum of 50 and 25 is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 75)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  char *x = 0x00;
  write(1, "A\n", 2);
  *x = 0x20;
  write(1, "B\n", 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x1,%edi
lea    0xecd(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    -0x10(%rbp),%rax
movb   $0x20,(%rax)
mov    $0x1,%edi
lea    0xeb3(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1030 <write@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"A\0A\00"
@.str.1 = [3 x i8] c"B\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = load i8*, i8** %2
store i8 32, i8* %4
%5 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"A\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
unreachable
}
/* Type definitions */
struct board_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ find_king_square(struct board_state const *, int);
int is_in_check_from(struct board_state const *, int, int /*<<< orphan*/);
int is_in_check(const struct board_state *state, int side) {
  return is_in_check_from(state, side, find_king_square(state, side));
}


x86 assembly (clang, -O0):
<is_in_check>:
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    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <find_king_square@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    %eax,%edx
call   1040 <is_in_check_from@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_check>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <find_king_square@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <is_in_check_from@plt>

LLVM IR (-O0):
%struct.board_state = type { i32 }
define i32 @is_in_check(%struct.board_state* %0, i32 %1) {
%3 = alloca %struct.board_state*
%4 = alloca i32
store %struct.board_state* %0, %struct.board_state** %3
store i32 %1, i32* %4
%5 = load %struct.board_state*, %struct.board_state** %3
%6 = load i32, i32* %4
%7 = load %struct.board_state*, %struct.board_state** %3
%8 = load i32, i32* %4
%9 = call i32 @find_king_square(%struct.board_state* %7, i32 %8)
%10 = call i32 @is_in_check_from(%struct.board_state* %5, i32 %6, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.board_state = type { i32 }
define i32 @is_in_check(%struct.board_state* %0, i32 %1) {
%3 = tail call i32 @find_king_square(%struct.board_state* %0, i32 %1)
%4 = tail call i32 @is_in_check_from(%struct.board_state* %0, i32 %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
void intptr_example(intptr_t i) {}


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

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

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

LLVM IR (-O2):
define void @intptr_example(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_havege_random(char *, int);
void random_buffer(char *buffer, int size) {
  create_havege_random(buffer, size);
}


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

x86 assembly (clang, -O2):
<random_buffer>:
jmp    1030 <create_havege_random@plt>

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

LLVM IR (-O2):
define void @random_buffer(i8* %0, i32 %1) {
%3 = tail call i32 @create_havege_random(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void write0(bool show, char *str) {
  if (show) {
    printf(str);
  }
}


x86 assembly (clang, -O0):
<write0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <write0+0x22>
mov    -0x10(%rbp),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write0>:
test   %edi,%edi
je     111c <write0+0xc>
mov    %rsi,%rdi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
define void @write0(i32 %0, i8* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) %1)
br label %6
6: ; preds = %4, %2
ret void
}
int dbslast(dbs)
struct xgwindow *dbs;
{
  ddirmddone(dbs);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.xgwindow = type opaque
define i32 @dbslast(%struct.xgwindow* %0) {
%2 = alloca %struct.xgwindow*
store %struct.xgwindow* %0, %struct.xgwindow** %2
%3 = load %struct.xgwindow*, %struct.xgwindow** %2
%4 = call i32 (%struct.xgwindow*, ...) bitcast (i32 (...)* @ddirmddone to i32 (%struct.xgwindow*, ...)*)(%struct.xgwindow* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.xgwindow = type opaque
define i32 @dbslast(%struct.xgwindow* %0) {
%2 = tail call i32 (%struct.xgwindow*, ...) bitcast (i32 (...)* @ddirmddone to i32 (%struct.xgwindow*, ...)*)(%struct.xgwindow* %0)
ret i32 0
}
double irp_rdtsc_(void) {
  unsigned long long a, d;
  __asm__ volatile("rdtscp" : "=a"(a), "=d"(d));
  return (double)((d << 32) + a);
}


x86 assembly (clang, -O0):
<irp_rdtsc_>:
push   %rbp
mov    %rsp,%rbp
rdtscp
mov    %rax,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
mov    -0x8(%rbp),%rcx
add    %rcx,%rax
movq   %rax,%xmm0
movaps 0xed6(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xeda(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<irp_rdtsc_>:
rdtscp
shl    $0x20,%rdx
add    %rax,%rdx
movq   %rdx,%xmm1
punpckldq 0xee9(%rip),%xmm1
subpd  0xef1(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @irp_rdtsc_() {
%1 = alloca i64
%2 = alloca i64
%3 = call { i64, i64 } asm sideeffect "rdtscp", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %1
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = shl i64 %6, 32
%8 = load i64, i64* %1
%9 = add i64 %7, %8
%10 = uitofp i64 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @irp_rdtsc_() {
%1 = tail call { i64, i64 } asm sideeffect "rdtscp", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = shl i64 %3, 32
%5 = add i64 %4, %2
%6 = uitofp i64 %5 to double
ret double %6
}
void XGrabServer() {}


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

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

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

LLVM IR (-O2):
define void @XGrabServer() {
ret void
}
int test_imm_D8int8_reg(signed char val) {
  return ((val) & (-0xD8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D8int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff28,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_D8int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -216
%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_D8int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -216
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int const);
int isRadix10(const char *c) {
  const char *PREFIX = "#d";
  const int PREFIX_SZ = strlen(PREFIX);
  if (c == NULL)
    return 0;
  if (strncmp(c, PREFIX, PREFIX_SZ) == 0)
    return PREFIX_SZ;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isRadix10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115a <isRadix10+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1186 <isRadix10+0x66>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    117f <isRadix10+0x5f>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <isRadix10+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRadix10>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed3(%rip),%rdi
call   1040 <strlen@plt>
test   %rbx,%rbx
je     1157 <isRadix10+0x37>
mov    %eax,%ebp
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
cmove  %ebp,%eax
jmp    1159 <isRadix10+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"#d\00"
define i32 @isRadix10(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %20
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = call i64 @strncmp(i8* %12, i8* %13, i32 %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = load i32, i32* %5
store i32 %18, i32* %2
br label %20
19: ; preds = %11
store i32 0, i32* %2
br label %20
20: ; preds = %19, %17, %10
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"#d\00"
define i32 @isRadix10(i8* %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 %2, i32 0
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void dcsc_matvecs(int n_row, int n_col, int n_vecs, int *Ap, int *Ai,
                  double *Ax, double *Xx, double *Yx) {
  int i, j, ii;
  printf("dcsc_matvecs not working in m_sparsetools.c\n");
  exit(1);
}


x86 assembly (clang, -O0):
<dcsc_matvecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<dcsc_matvecs>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"dcsc_matvecs not working in m_sparsetools.c\0A\00"
define void @dcsc_matvecs(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, double* %5, double* %6, double* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store double* %5, double** %14
store double* %6, double** %15
store double* %7, double** %16
%20 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [44 x i8] c"dcsc_matvecs not working in m_sparsetools.c\00"
define void @dcsc_matvecs(i32 %0, i32 %1, i32 %2, i32* nocapture readnone %3, i32* nocapture readnone %4, double* nocapture readnone %5, double* nocapture readnone %6, double* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
}
double course_diff(double a, double b) {
  double y = b - a;
  if (y > 180)
    y -= 360;
  if (y < -180)
    y += 360;
  return y;
}


x86 assembly (clang, -O0):
<course_diff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114a <course_diff+0x4a>
movsd  -0x18(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebe(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    116f <course_diff+0x6f>
movsd  0xea3(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<course_diff>:
subsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xef0(%rip),%xmm2
cmpltsd %xmm1,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
movsd  0xedf(%rip),%xmm1
movapd %xmm2,%xmm0
cmpltsd 0xeda(%rip),%xmm0
addsd  %xmm2,%xmm1
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @course_diff(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
store double %8, double* %5
%9 = load double, double* %5
%10 = fcmp ogt double %9, 1.800000e+02
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load double, double* %5
%13 = fsub double %12, 3.600000e+02
store double %13, double* %5
br label %14
14: ; preds = %11, %2
%15 = load double, double* %5
%16 = fcmp olt double %15, -1.800000e+02
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load double, double* %5
%19 = fadd double %18, 3.600000e+02
store double %19, double* %5
br label %20
20: ; preds = %17, %14
%21 = load double, double* %5
ret double %21
}

LLVM IR (-O2):
define double @course_diff(double %0, double %1) {
%3 = fsub double %1, %0
%4 = fcmp ogt double %3, 1.800000e+02
%5 = fadd double %3, -3.600000e+02
%6 = select i1 %4, double %5, double %3
%7 = fcmp olt double %6, -1.800000e+02
%8 = fadd double %6, 3.600000e+02
%9 = select i1 %7, double %8, double %6
ret double %9
}
/* Type definitions */
struct timeval {
  long member_0;
  long member_1;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int kbhit(void) {
  struct timeval tv = {0L, 0L};
  fd_set fds;
  FD_ZERO(&fds);
  FD_SET(0, &fds);
  return select(1, &fds, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<kbhit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x14(%rbp),%rdi
call   1040 <FD_ZERO@plt>
xor    %edi,%edi
lea    -0x14(%rbp),%rsi
call   1060 <FD_SET@plt>
mov    $0x1,%edi
lea    -0x14(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rdx
call   1050 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbhit>:
push   %rbx
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <FD_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <FD_SET@plt>
lea    0x10(%rsp),%r8
mov    $0x1,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <select@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @kbhit() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = bitcast %struct.timeval* %1 to i8*
%4 = call i32 @FD_ZERO(i32* %2)
%5 = call i32 @FD_SET(i32 0, i32* %2)
%6 = call i32 @select(i32 1, i32* %2, i32* null, i32* null, %struct.timeval* %1)
ret i32 %6
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @kbhit() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @FD_ZERO(i32* %2)
%6 = call i32 @FD_SET(i32 0, i32* %2)
%7 = call i32 @select(i32 1, i32* %2, i32* null, i32* null, %struct.timeval* %1)
ret i32 %7
}
/* Variables and functions */
char *tokenParser(char *, char *, int, char *);
char *swirParser(char *header) {
  return tokenParser(header, " \t", 1, "swirParser");
}


x86 assembly (clang, -O0):
<swirParser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x1,%edx
lea    0xed0(%rip),%rcx
call   1030 <tokenParser@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swirParser>:
lea    0xee9(%rip),%rsi
lea    0xee5(%rip),%rcx
mov    $0x1,%edx
jmp    1030 <tokenParser@plt>

LLVM IR (-O0):
@.str = [3 x i8] c" \09\00"
@.str.1 = [11 x i8] c"swirParser\00"
define i8* @swirParser(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @tokenParser(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
@.str.1 = [11 x i8] c"swirParser\00"
define i8* @swirParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
int main() {
  int a[] = {0, 1, 2, 3, 4};
  int *p[] = {a, &a[1], &a[2], &a[3], &a[4]};
  int **pp = p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x48(%rbp)
lea    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x40(%rbp)
lea    -0x20(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x38(%rbp)
lea    -0x20(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x30(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32*]
%3 = alloca i32**
%4 = bitcast [5 x i32]* %1 to i8*
%5 = getelementptr inbounds [5 x i32*], [5 x i32*]* %2, i64 0, i64 0
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
store i32* %6, i32** %5
%7 = getelementptr inbounds i32*, i32** %5, i64 1
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
store i32* %8, i32** %7
%9 = getelementptr inbounds i32*, i32** %7, i64 1
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
store i32* %10, i32** %9
%11 = getelementptr inbounds i32*, i32** %9, i64 1
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
store i32* %12, i32** %11
%13 = getelementptr inbounds i32*, i32** %11, i64 1
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
store i32* %14, i32** %13
%15 = getelementptr inbounds [5 x i32*], [5 x i32*]* %2, i64 0, i64 0
store i32** %15, i32*** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int array_float_cmp(const void *x, const void *y) {
  if (*(double *)x < *(double *)y)
    return -1;
  else if (*(double *)x == *(double *)y)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<array_float_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <array_float_cmp+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <array_float_cmp+0x61>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    115a <array_float_cmp+0x5a>
jp     115a <array_float_cmp+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1161 <array_float_cmp+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_float_cmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movapd %xmm0,%xmm2
cmpneqsd %xmm1,%xmm2
movq   %xmm2,%rcx
and    $0x1,%ecx
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @array_float_cmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp olt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp oeq double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %3
br label %24
23: ; preds = %14
store i32 1, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @array_float_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp une double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
char *basename(char *name) {
  int move = 0;
  int last_move = 0;
  int i = 0;
  while (name[i] != '\0') {
    if (name[i] == '/') {
      move = i;
    }
    i++;
  }
  return &name[move + 1];
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115b <basename+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    114d <basename+0x4d>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111d <basename+0x1d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
xor    %eax,%eax
xor    %ecx,%ecx
jmp    1116 <basename+0x16>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
add    $0x1,%rax
movzbl (%rdi,%rax,1),%edx
cmp    $0x2f,%dl
je     1110 <basename+0x10>
test   %dl,%dl
jne    1112 <basename+0x12>
movslq %ecx,%rax
add    %rdi,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i8* @basename(i8* %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 47, label %7
]
7: ; preds = %2
%8 = trunc i64 %3 to i32
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
%13 = add nsw i32 %4, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
ret i8* %15
}
/* Variables and functions */
int rand();
int rnd(int mod) { return (rand() % mod) + 1; }


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
lea    0x1(%rdx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @rnd(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isupper(int);
void t_isupper_0x48() {
  Assert_real((isupper(72)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              365, ("isupper should be 1 for H"));
}


x86 assembly (clang, -O0):
<t_isupper_0x48>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48,%edi
call   1030 <isupper@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x16d,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x48>:
push   %rax
mov    $0x48,%edi
call   1030 <isupper@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x16d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for H\00"
define void @t_isupper_0x48() {
%1 = call i32 @isupper(i32 72)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for H\00"
define void @t_isupper_0x48() {
%1 = tail call i32 @isupper(i32 72)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void f1() {
  int a = 42;
  int b = 35;
  if (a = b)
    a = 36;
  return;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2a,-0x4(%rbp)
movl   $0x23,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1128 <f1+0x28>
movl   $0x24,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca i32
store i32 42, i32* %1
store i32 35, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 36, i32* %1
br label %6
6: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @f1() {
ret void
}
int tree_entry_len(const char *name, const unsigned char *sha1) {
  return (const char *)sha1 - name - 1;
}


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

x86 assembly (clang, -O2):
<tree_entry_len>:
not    %edi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @tree_entry_len(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = sub nsw i64 %9, 1
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @tree_entry_len(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = xor i64 %4, -1
%6 = add i64 %3, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int nepim_str_split_comma(char *, int, char **);
int addr_split_port(char *buf, int buf_size, char **port) {
  return nepim_str_split_comma(buf, buf_size, port);
}


x86 assembly (clang, -O0):
<addr_split_port>:
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
mov    -0x18(%rbp),%rdx
call   1030 <nepim_str_split_comma@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_split_port>:
jmp    1030 <nepim_str_split_comma@plt>

LLVM IR (-O0):
define i32 @addr_split_port(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8**, i8*** %6
%10 = call i32 @nepim_str_split_comma(i8* %7, i32 %8, i8** %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @addr_split_port(i8* %0, i32 %1, i8** %2) {
%4 = tail call i32 @nepim_str_split_comma(i8* %0, i32 %1, i8** %2)
ret i32 %4
}
int strcoll(s1, s2) const char *s1, *s2;
{ return (strcmp(s1, s2)); }


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

x86 assembly (clang, -O2):
<strcoll>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @strcoll(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 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @strcoll(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void alarmhandler(int signo) {}


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

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

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

LLVM IR (-O2):
define void @alarmhandler(i32 %0) {
ret void
}
int als_getlux(float *data) {
  *data = 20.0;
  return 0;
}


x86 assembly (clang, -O0):
<als_getlux>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xeec(%rip),%xmm0
movss  %xmm0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<als_getlux>:
movl   $0x41a00000,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @als_getlux(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
store float 2.000000e+01, float* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @als_getlux(float* nocapture writeonly %0) {
store float 2.000000e+01, float* %0
ret i32 0
}
/* Variables and functions */
long long get_long_long(int /*<<< orphan*/ *);
long long GetLongLong(void) { return get_long_long(NULL); }


x86 assembly (clang, -O0):
<GetLongLong>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <get_long_long@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetLongLong>:
xor    %edi,%edi
jmp    1030 <get_long_long@plt>

LLVM IR (-O0):
define i64 @GetLongLong() {
%1 = call i64 @get_long_long(i32* null)
ret i64 %1
}

LLVM IR (-O2):
define i64 @GetLongLong() {
%1 = tail call i64 @get_long_long(i32* null)
ret i64 %1
}
/* Variables and functions */
int xdtoi(char const);
int xtoi(const char *s) {
  int d1, d2;
  d1 = xdtoi(*s);
  if (d1 >= 0) {
    d2 = xdtoi(*(s + 1));
    if (d2 >= 0) {
      return (d1 << 4) + d2;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<xtoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <xdtoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1165 <xtoi+0x55>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <xdtoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1160 <xtoi+0x50>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <xtoi+0x5c>
jmp    1165 <xtoi+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtoi>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <xdtoi@plt>
xor    %r14d,%r14d
test   %eax,%eax
js     113d <xtoi+0x2d>
mov    %eax,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <xdtoi@plt>
test   %eax,%eax
js     113d <xtoi+0x2d>
shl    $0x4,%ebp
add    %ebp,%eax
mov    %eax,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @xtoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @xdtoi(i8 signext %2)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = tail call i32 @xdtoi(i8 signext %7)
%9 = icmp sgt i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = shl i32 %3, 4
%12 = add nsw i32 %8, %11
br label %13
13: ; preds = %1, %5, %10
%14 = phi i32 [ %12, %10 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %14
}