xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned int mp_add(unsigned int, unsigned int);
int main() {
  unsigned int a, b, r;
  r = mp_add(a, b);
  assert(r == a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <mp_add@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @mp_add(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = add i32 %9, %10
%12 = icmp eq i32 %8, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @mp_add(i32 undef, i32 undef)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
size_t CountBitsInShort(void) {
  size_t count = 0;
  unsigned short bits = (unsigned short)-1;
  while (bits > 0) {
    bits >>= 1;
    ++count;
  }
  return count;
}


x86 assembly (clang, -O0):
<CountBitsInShort>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movw   $0xffff,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
cmp    $0x0,%eax
jle    113b <CountBitsInShort+0x3b>
movzwl -0xa(%rbp),%eax
sar    $0x1,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <CountBitsInShort+0x12>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @CountBitsInShort() {
%1 = alloca i64
%2 = alloca i16
store i64 0, i64* %1
store i16 -1, i16* %2
br label %3
3: ; preds = %7, %0
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i16, i16* %2
%9 = zext i16 %8 to i32
%10 = ashr i32 %9, 1
%11 = trunc i32 %10 to i16
store i16 %11, i16* %2
%12 = load i64, i64* %1
%13 = add i64 %12, 1
store i64 %13, i64* %1
br label %3
14: ; preds = %3
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
define i64 @CountBitsInShort() {
ret i64 16
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int const);
void wait_millisec(const unsigned int ms) { usleep(ms * 1000ul); }


x86 assembly (clang, -O0):
<wait_millisec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x3e8,%rax,%rax
mov    %eax,%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_millisec>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @wait_millisec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = mul i64 %4, 1000
%6 = trunc i64 %5 to i32
%7 = call i32 @usleep(i32 %6)
ret void
}

LLVM IR (-O2):
define void @wait_millisec(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
void test_strings_equal() {
  char *s = "hello";
  do {
    seatest_assert_string_equal("hello", s, __FUNCTION__, 6);
  } while (0);
}


x86 assembly (clang, -O0):
<test_strings_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
lea    0xed1(%rip),%rdx
mov    $0x6,%ecx
mov    $0x0,%al
call   1030 <seatest_assert_string_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strings_equal>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rdx
mov    %rdi,%rsi
mov    $0x6,%ecx
xor    %eax,%eax
jmp    1030 <seatest_assert_string_equal@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@__FUNCTION__.test_strings_equal = [19 x i8] c"test_strings_equal\00"
define void @test_strings_equal() {
%1 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
br label %2
2: ; preds = %0
%3 = load i8*, i8** %1
%4 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.test_strings_equal, i64 0, i64 0), i32 6)
br label %5
5: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@__FUNCTION__.test_strings_equal = [19 x i8] c"test_strings_equal\00"
define void @test_strings_equal() {
%1 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.test_strings_equal, i64 0, i64 0), i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process();
int main(int argc, char **argv) {
  process();
  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)
mov    $0x0,%al
call   1030 <process@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @process()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @process()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cpright();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int);
void version(void) {
  cpright();
  printf("Version %d.%d\n", 0, 99);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cpright@plt>
lea    0xece(%rip),%rdi
xor    %esi,%esi
mov    $0x63,%edx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rax
xor    %eax,%eax
call   1040 <cpright@plt>
lea    0xed1(%rip),%rdi
xor    %esi,%esi
mov    $0x63,%edx
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Version %d.%d\0A\00"
define void @version() {
%1 = call i32 (...) @cpright()
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 0, i32 99)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Version %d.%d\0A\00"
define void @version() {
%1 = tail call i32 (...) @cpright()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 0, i32 99)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void *malloc(size_t);
void *smalloc(size_t size) {
  void *p;
  p = malloc(size);
  if (p == NULL)
    error("cannot malloc()");
  return (p);
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <smalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <smalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"cannot malloc()\00"
define i8* @smalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [16 x i8] c"cannot malloc()\00"
define noalias i8* @smalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
struct webidl_node {
  int dummy;
};
struct binding {
  int dummy;
};

/* Variables and functions */
int generate_property_body(struct binding *, int /*<<< orphan*/);
int /*<<< orphan*/ webidl_node_gettext(struct webidl_node *);
int webidl_implements_cb(struct webidl_node *node, void *ctx) {
  struct binding *binding = ctx;
  return generate_property_body(binding, webidl_node_gettext(node));
}


x86 assembly (clang, -O0):
<webidl_implements_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <webidl_node_gettext@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1030 <generate_property_body@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<webidl_implements_cb>:
push   %rbx
mov    %rsi,%rbx
call   1040 <webidl_node_gettext@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <generate_property_body@plt>

LLVM IR (-O0):
%struct.webidl_node = type { i32 }
%struct.binding = type { i32 }
define i32 @webidl_implements_cb(%struct.webidl_node* %0, i8* %1) {
%3 = alloca %struct.webidl_node*
%4 = alloca i8*
%5 = alloca %struct.binding*
store %struct.webidl_node* %0, %struct.webidl_node** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.binding*
store %struct.binding* %7, %struct.binding** %5
%8 = load %struct.binding*, %struct.binding** %5
%9 = load %struct.webidl_node*, %struct.webidl_node** %3
%10 = call i32 @webidl_node_gettext(%struct.webidl_node* %9)
%11 = call i32 @generate_property_body(%struct.binding* %8, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.webidl_node = type { i32 }
%struct.binding = type { i32 }
define i32 @webidl_implements_cb(%struct.webidl_node* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.binding*
%4 = tail call i32 @webidl_node_gettext(%struct.webidl_node* %0)
%5 = tail call i32 @generate_property_body(%struct.binding* %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
int rnd(int min, int max) {
  return (int)(((double)rand() / ((double)RAND_MAX + 1.0)) * (max - min + 1) +
               min);
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb7(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xec2(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm2
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ebe(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
sub    %ebp,%ebx
add    $0x1,%ebx
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
cvtsi2sd %ebp,%xmm2
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
cvttsd2si %xmm2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @rnd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to double
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double %6, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = sub nsw i32 %11, %12
%14 = add nsw i32 %13, 1
%15 = sitofp i32 %14 to double
%16 = load i32, i32* %3
%17 = sitofp i32 %16 to double
%18 = call double @llvm.fmuladd.f64(double %10, double %15, double %17)
%19 = fptosi double %18 to i32
ret i32 %19
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @rnd(i32 %0, i32 %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %4, %7
%9 = sub i32 1, %0
%10 = add i32 %9, %1
%11 = sitofp i32 %10 to double
%12 = sitofp i32 %0 to double
%13 = tail call double @llvm.fmuladd.f64(double %8, double %11, double %12)
%14 = fptosi double %13 to i32
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ GENERAL_SUBTREE;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ GENERAL_SUBTREE_it;
GENERAL_SUBTREE *GENERAL_SUBTREE_new(void) {
  return (GENERAL_SUBTREE *)ASN1_item_new(&GENERAL_SUBTREE_it);
}


x86 assembly (clang, -O0):
<GENERAL_SUBTREE_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GENERAL_SUBTREE_new>:
mov    0x2ed1(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@GENERAL_SUBTREE_it = global i32 0
define i32* @GENERAL_SUBTREE_new() {
%1 = call i64 @ASN1_item_new(i32* @GENERAL_SUBTREE_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@GENERAL_SUBTREE_it = global i32 0
define i32* @GENERAL_SUBTREE_new() {
%1 = tail call i64 @ASN1_item_new(i32* @GENERAL_SUBTREE_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int /*<<< orphan*/, char **, size_t);
int main(void) {
  char string[] = "1234";
  size_t count = 4;
  ssize_t ret;
  ret = write(0, &string, count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x5(%rbp)
movq   $0x4,-0x18(%rbp)
lea    -0x9(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %edi,%edi
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x34333231,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edx
xor    %edi,%edi
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.string = [5 x i8] c"1234\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca i64
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [5 x i8]* %2 to i8*
store i64 4, i64* %3
%6 = bitcast [5 x i8]* %2 to i8**
%7 = load i64, i64* %3
%8 = call i32 @write(i32 0, i8** %6, i64 %7)
store i32 %8, i32* %4
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [5 x i8] c"1234\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = bitcast [5 x i8]* %1 to i8**
%4 = call i32 @write(i32 0, i8** %3, i64 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ glClearColor(float, float, float, float);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void init(void) {
  glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
  glShadeModel(GL_FLAT);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <glShadeModel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1030 <glClearColor@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <glShadeModel@plt>

LLVM IR (-O0):
@GL_FLAT = global i32 0
define void @init() {
%1 = call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = call i32 @glShadeModel(i32 %2)
ret void
}

LLVM IR (-O2):
@GL_FLAT = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = tail call i32 @glShadeModel(i32 %2)
ret void
}
void unmake_c_str(p, savech) char *p;
char savech;
{
  if (savech)
    *p = savech;
}


x86 assembly (clang, -O0):
<unmake_c_str>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     1121 <unmake_c_str+0x21>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmake_c_str>:
test   %sil,%sil
je     1108 <unmake_c_str+0x8>
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @unmake_c_str(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = icmp eq i8 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store i8 %3, i8* %0
br label %6
6: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void cli() {
  printf("%s:%d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/"
         "mock/avr/interrupt.c",
         7);
}


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

x86 assembly (clang, -O2):
<cli>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x7,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/avr/interrupt.c\00"
define void @cli() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 7)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/avr/interrupt.c\00"
define void @cli() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 7)
ret void
}
float df2x(float x, float y) { return (2 * x); }


x86 assembly (clang, -O0):
<df2x>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xeea(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<df2x>:
addss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @df2x(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fmul float 2.000000e+00, %5
ret float %6
}

LLVM IR (-O2):
define float @df2x(float %0, float %1) {
%3 = fmul float %0, 2.000000e+00
ret float %3
}
long small_msg_receive(long *source, long *msgpt) {
  long res = 2;
  long msg;
  long src;
  __asm__ volatile("int $0x80"
                   : "=a"(res), "=b"(src), "=c"(msg)
                   : "0"(res), "b"(*source));
  if (res == 1) {
    *msgpt = msg;
    *source = src;
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<small_msg_receive>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movq   $0x2,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rbx
int    $0x80
mov    %rax,-0x28(%rbp)
mov    %rbx,-0x38(%rbp)
mov    %rcx,-0x30(%rbp)
cmpq   $0x1,-0x28(%rbp)
jne    115c <small_msg_receive+0x5c>
mov    -0x30(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x38(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x1,-0x10(%rbp)
jmp    1164 <small_msg_receive+0x64>
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<small_msg_receive>:
push   %rbx
mov    (%rdi),%rbx
mov    $0x2,%eax
int    $0x80
mov    %rax,%rdx
mov    $0xffffffffffffffff,%rax
cmp    $0x1,%rdx
jne    1126 <small_msg_receive+0x26>
mov    %rcx,(%rsi)
mov    %rbx,(%rdi)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @small_msg_receive(i64* %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64 2, i64* %6
%9 = load i64, i64* %6
%10 = load i64*, i64** %4
%11 = load i64, i64* %10
%12 = call { i64, i64, i64 } asm sideeffect "int $$0x80", "={ax},={bx},={cx},0,{bx},~{dirflag},~{fpsr},~{flags}"(i64 %9, i64 %11)
%13 = extractvalue { i64, i64, i64 } %12, 0
%14 = extractvalue { i64, i64, i64 } %12, 1
%15 = extractvalue { i64, i64, i64 } %12, 2
store i64 %13, i64* %6
store i64 %14, i64* %8
store i64 %15, i64* %7
%16 = load i64, i64* %6
%17 = icmp eq i64 %16, 1
br i1 %17, label %18, label %23
18: ; preds = %2
%19 = load i64, i64* %7
%20 = load i64*, i64** %5
store i64 %19, i64* %20
%21 = load i64, i64* %8
%22 = load i64*, i64** %4
store i64 %21, i64* %22
store i64 1, i64* %3
br label %24
23: ; preds = %2
store i64 -1, i64* %3
br label %24
24: ; preds = %23, %18
%25 = load i64, i64* %3
ret i64 %25
}

LLVM IR (-O2):
define i64 @small_msg_receive(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = tail call { i64, i64, i64 } asm sideeffect "int $$0x80", "={ax},={bx},={cx},0,{bx},~{dirflag},~{fpsr},~{flags}"(i64 2, i64 %3)
%5 = extractvalue { i64, i64, i64 } %4, 0
%6 = icmp eq i64 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = extractvalue { i64, i64, i64 } %4, 2
%9 = extractvalue { i64, i64, i64 } %4, 1
store i64 %8, i64* %1
store i64 %9, i64* %0
br label %10
10: ; preds = %2, %7
%11 = phi i64 [ 1, %7 ], [ -1, %2 ]
ret i64 %11
}
/* Variables and functions */
int ENOSYS;
int sys_select() { return -ENOSYS; }


x86 assembly (clang, -O0):
<sys_select>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2edb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_select>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @sys_select() {
%1 = load i32, i32* @ENOSYS
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @sys_select() {
%1 = load i32, i32* @ENOSYS
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Type definitions */
typedef float const int32_t;

/* Variables and functions */
float float_from_q4_27(int32_t ival) {
  static const float scale = 1. / (float)(1UL << 27);
  return ival * scale;
}


x86 assembly (clang, -O0):
<float_from_q4_27>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_from_q4_27>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
@float_from_q4_27.scale = internal constant float 0x3E40000000000000
define float @float_from_q4_27(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3E40000000000000
ret float %4
}

LLVM IR (-O2):
define float @float_from_q4_27(float %0) {
%2 = fmul float %0, 0x3E40000000000000
ret float %2
}
/* Variables and functions */
int floor_log2(int);
int ceil_log2(int n) {
  int r = floor_log2(n);
  if ((1 << r) < n)
    ++r;
  return r;
}


x86 assembly (clang, -O0):
<ceil_log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <floor_log2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0x4(%rbp),%eax
jge    1142 <ceil_log2+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_log2>:
push   %rbx
mov    %edi,%ebx
call   1030 <floor_log2@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
xor    %ecx,%ecx
cmp    %ebx,%edx
setl   %cl
add    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ceil_log2(i32 %0) {
%2 = tail call i32 @floor_log2(i32 %0)
%3 = shl nuw i32 1, %2
%4 = icmp slt i32 %3, %0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %2, %5
ret i32 %6
}
void spca561_setquality(struct usb_spca50x *spca50x) {}


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

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

LLVM IR (-O0):
%struct.usb_spca50x = type opaque
define void @spca561_setquality(%struct.usb_spca50x* %0) {
%2 = alloca %struct.usb_spca50x*
store %struct.usb_spca50x* %0, %struct.usb_spca50x** %2
ret void
}

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @spca561_setquality(%struct.usb_spca50x* nocapture %0) {
ret void
}
void mem_tlb_flush(void *m) {
  __asm volatile("invlpg (%0)" : : "b"(m) : "memory");
}


x86 assembly (clang, -O0):
<mem_tlb_flush>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
invlpg (%rbx)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_tlb_flush>:
push   %rbx
mov    %rdi,%rbx
invlpg (%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @mem_tlb_flush(i8* %0) {
tail call void asm sideeffect "invlpg ($0)", "{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ err_exit(char *, int /*<<< orphan*/);
int lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
void binskip(int fd, ssize_t skip) {
  if (lseek(fd, skip, SEEK_SET) == -1)
    err_exit("set skip bytes %ld", skip);
}


x86 assembly (clang, -O0):
<binskip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
cmp    $0xffffffff,%eax
jne    115a <binskip+0x3a>
mov    -0x8(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1040 <err_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binskip>:
push   %rbx
mov    %esi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
cmp    $0xffffffff,%eax
je     1138 <binskip+0x18>
pop    %rbx
ret
lea    0xec1(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <err_exit@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [19 x i8] c"set skip bytes %ld\00"
define void @binskip(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 = load i32, i32* @SEEK_SET
%8 = call i32 @lseek(i32 %5, i32 %6, i32 %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @err_exit(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [19 x i8] c"set skip bytes %ld\00"
define void @binskip(i32 %0, i32 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @err_exit(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void hit(void) { say("I want to draw blood, not water!", 1); }


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"I want to draw blood, not water!\00"
define void @hit() {
%1 = call i32 @say(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"I want to draw blood, not water!\00"
define void @hit() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
void gtk_color_selection_dialog_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_selection_dialog_get_type() {
ret void
}
void update_database(struct bt_peer *peer) {}


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

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

LLVM IR (-O0):
%struct.bt_peer = type opaque
define void @update_database(%struct.bt_peer* %0) {
%2 = alloca %struct.bt_peer*
store %struct.bt_peer* %0, %struct.bt_peer** %2
ret void
}

LLVM IR (-O2):
%struct.bt_peer = type opaque
define void @update_database(%struct.bt_peer* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int transaction = 0;
  int i;
  for (i = 1; i < 501; i++) {
    transaction += i;
  }
  printf("Transactions: %d", transaction);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1f5,-0xc(%rbp)
jge    1151 <main+0x41>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea5(%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    $0x1e942,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Transactions: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 125250)
ret i32 0
}
void slip_flush(void) {}


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

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

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

LLVM IR (-O2):
define void @slip_flush() {
ret void
}
int mstrlen(const char *string) {
  const char *buff;
  for (buff = string; *buff; ++buff)
    ;
  return (buff - string);
}


x86 assembly (clang, -O0):
<mstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <mstrlen+0x33>
jmp    1122 <mstrlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <mstrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mstrlen(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
}
unsigned int setbit_count(int num) {
  int count = 0;
  while (num != 0) {
    if (((num)&1) == 1)
      count++;
    num = num >> 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<setbit_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <setbit_count+0x3e>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1130 <setbit_count+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <setbit_count+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbit_count>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <setbit_count+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <setbit_count+0x10>
ret

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

LLVM IR (-O2):
define i32 @setbit_count(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = ashr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
void fd136(int n) {
a : {
  typedef int(*b)[n];
P01A:
  goto P01A;
  {
    typedef int(*c)[n];
  P012A:
    goto P012A;
    0;
  }
P01B:
  goto P01B;
  {
    typedef int(*d)[n];
  P013A:
    goto P013A;
    0;
  }
P01C:
  goto P01C;
  ;
  typedef int(*e)[n];
P014A:
  goto P014A;
  0;
};
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  p02A:
    goto p02A;
    goto a;
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd136>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd136+0x7>

x86 assembly (clang, -O2):
<fd136>:
jmp    1100 <fd136>

LLVM IR (-O0):
define void @fd136(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %6, %3
br label %6
7: ; No predecessors!
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %10, %7
br label %10
11: ; preds = %11
br label %11
12: ; No predecessors!
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
br label %15
15: ; preds = %15, %12
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %20
20: ; preds = %20, %17
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
%23 = load i32, i32* %2
%24 = zext i32 %23 to i64
br label %25
25: ; preds = %25, %22
br label %25
26: ; preds = %26
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd136(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
unsigned int m_limit_uint(unsigned int val, unsigned int low,
                          unsigned int high) {
  return (val < low) ? low : ((val > high) ? high : val);
}


x86 assembly (clang, -O0):
<m_limit_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1124 <m_limit_uint+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <m_limit_uint+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    113b <m_limit_uint+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <m_limit_uint+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_limit_uint>:
mov    %edx,%eax
cmp    %edx,%edi
cmovbe %edi,%eax
cmp    %esi,%edi
cmovb  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @m_limit_uint(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %0, %1
%5 = icmp ugt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void f_scalar_stack_3(double a, int64_t b, double c, int64_t d, int e,
                      int64_t f, int32_t g, double h, long double i) {}


x86 assembly (clang, -O0):
<f_scalar_stack_3>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
fstpt  -0x40(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f_scalar_stack_3(double %0, i32 %1, double %2, i32 %3, i32 %4, i32 %5, i32 %6, double %7, x86_fp80 %8) {
%10 = alloca double
%11 = alloca i32
%12 = alloca double
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
%18 = alloca x86_fp80
store double %0, double* %10
store i32 %1, i32* %11
store double %2, double* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store double %7, double* %17
store x86_fp80 %8, x86_fp80* %18
ret void
}

LLVM IR (-O2):
define void @f_scalar_stack_3(double %0, i32 %1, double %2, i32 %3, i32 %4, i32 %5, i32 %6, double %7, x86_fp80 %8) {
ret void
}
void instruc_1() {}


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

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

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

LLVM IR (-O2):
define void @instruc_1() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int numbtrop_dobldobl_size(int *nbt) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(721, nbt, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<numbtrop_dobldobl_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2d1,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbtrop_dobldobl_size>:
mov    %rdi,%rsi
mov    $0x2d1,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @numbtrop_dobldobl_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 721, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @numbtrop_dobldobl_size(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 721, i32* %0, i32* undef, double* undef)
ret i32 %2
}
void foo_2_2_1_1_2_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_2_2_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ w_pawn_defended_from_west(int);
void w_pawn_defended_from_west_test(void **state) {
  assert_int_equal(0x0000000010000000ul,
                   w_pawn_defended_from_west(0x0000000010080000ul));
}


x86 assembly (clang, -O0):
<w_pawn_defended_from_west_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x10080000,%edi
call   1040 <w_pawn_defended_from_west@plt>
mov    %eax,%esi
mov    $0x10000000,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_pawn_defended_from_west_test>:
push   %rax
mov    $0x10080000,%edi
call   1040 <w_pawn_defended_from_west@plt>
mov    $0x10000000,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @w_pawn_defended_from_west_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @w_pawn_defended_from_west(i32 268959744)
%4 = call i32 @assert_int_equal(i32 268435456, i32 %3)
ret void
}

LLVM IR (-O2):
define void @w_pawn_defended_from_west_test(i8** nocapture readnone %0) {
%2 = tail call i32 @w_pawn_defended_from_west(i32 268959744)
%3 = tail call i32 @assert_int_equal(i32 268435456, i32 %2)
ret void
}
unsigned int _uiTestTimer(unsigned long ulTimer) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @_uiTestTimer(i64 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ deposit(void *);
void *deposit_thread(void *arg) { deposit(arg); }


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

x86 assembly (clang, -O2):
<deposit_thread>:
jmp    1030 <deposit@plt>

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

LLVM IR (-O2):
define noalias i8* @deposit_thread(i8* %0) {
%2 = tail call i32 @deposit(i8* %0)
ret i8* undef
}
/* Variables and functions */
void *memset1(void *s, int c, size_t n) {
  unsigned char *sCopy = (unsigned char *)s;
  for (; n > 0; n--) {
    *sCopy++ = c;
  }
  return s;
}


x86 assembly (clang, -O0):
<memset1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    1149 <memset1+0x49>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <memset1+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset1>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <memset1+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @memset1(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}