xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void testCastUIntPtrToIntPtrThroughIntTypedAssignment() {
  unsigned u;
  int *x;
  (*((int *)(&x))) = (int)&u;
  *x = 1;
  clang_analyzer_eval(u == 1);
}


x86 assembly (clang, -O0):
<testCastUIntPtrToIntPtrThroughIntTypedAssignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCastUIntPtrToIntPtrThroughIntTypedAssignment>:
push   %rax
lea    0x4(%rsp),%rax
mov    %eax,%eax
movl   $0x1,(%rax)
xor    %edi,%edi
cmpl   $0x1,0x4(%rsp)
sete   %dil
call   1030 <clang_analyzer_eval@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @testCastUIntPtrToIntPtrThroughIntTypedAssignment() {
%1 = alloca i32
%2 = alloca i32*
%3 = ptrtoint i32* %1 to i32
%4 = bitcast i32** %2 to i32*
store i32 %3, i32* %4
%5 = load i32*, i32** %2
store i32 1, i32* %5
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
ret void
}

LLVM IR (-O2):
define void @testCastUIntPtrToIntPtrThroughIntTypedAssignment() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = ptrtoint i32* %1 to i64
%4 = and i64 %3, 4294967292
%5 = inttoptr i64 %4 to i32*
store i32 1, i32* %5
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t getcurrenttime() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<getcurrenttime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcurrenttime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @getcurrenttime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @getcurrenttime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("usage: puppy-get [-nm] DataFiles/Foo '*.rec'");
  puts("-n  no action - just say what we would do");
  puts("-m  move files: remove source files after succesfully copying them");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"usage: puppy-get [-nm] DataFiles/Foo '*.rec'\00"
@.str.1 = [42 x i8] c"-n no action - just say what we would do\00"
@.str.2 = [67 x i8] c"-m move files: remove source files after succesfully copying them\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"usage: puppy-get [-nm] DataFiles/Foo '*.rec'\00"
@.str.1 = [42 x i8] c"-n no action - just say what we would do\00"
@.str.2 = [67 x i8] c"-m move files: remove source files after succesfully copying them\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int gdt_compare_int(const void *p1, const void *p2) {
  int n1 = *((int *)p1);
  int n2 = *((int *)p2);
  if (n1 < n2) {
    return -1;
  } else if (n1 > n2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<gdt_compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <gdt_compare_int+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <gdt_compare_int+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <gdt_compare_int+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <gdt_compare_int+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdt_compare_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gdt_compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void g_rand_free() {}


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

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

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

LLVM IR (-O2):
define void @g_rand_free() {
ret void
}
void NV12ToARGBRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToARGBRow_Any_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_tanl();
scalar_t__ tanl(long double);
void test_tanl(long double ld) {
  if (tanl(ld) != tanl(ld))
    link_failure_tanl();
}


x86 assembly (clang, -O0):
<test_tanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <tanl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <tanl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_tanl+0x43>
mov    $0x0,%al
call   1030 <link_failure_tanl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tanl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <tanl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <tanl@plt>
cmp    %rax,%rbx
jne    1151 <test_tanl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_tanl@plt>

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

LLVM IR (-O2):
define void @test_tanl(x86_fp80 %0) {
%2 = tail call i64 @tanl(x86_fp80 %0)
%3 = tail call i64 @tanl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_tanl()
br label %7
7: ; preds = %5, %1
ret void
}
char *strcpy(char *s1, const char *s2) {
  while (*s2 != 0) {
    *s1 = *s2;
    s1++;
    s2++;
  }
  *s1 = 0;
  return s1;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <strcpy+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
store i8 0, i8* %14
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printArray(void) {
  int array[10] = {5, 4, 3, 9, 1, 8, 6, 7, 5, 2};
  printf("4: %d\n", array[4]);
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%esi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.printArray.array = [10 x i32] [i32 5, i32 4, i32 3, i32 9, i32 1, i32 8, i32 6, i32 7, i32 5, i32 2]
@.str = [7 x i8] c"4: %d\0A\00"
define void @printArray() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"4: %d\0A\00"
define void @printArray() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
struct text_tag_list {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_clear(struct genlist *);
void text_tag_list_clear(struct text_tag_list *tthis) {
  genlist_clear(((struct genlist *)(tthis)));
}


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

x86 assembly (clang, -O2):
<text_tag_list_clear>:
jmp    1030 <genlist_clear@plt>

LLVM IR (-O0):
%struct.text_tag_list = type { i32 }
%struct.genlist = type { i32 }
define void @text_tag_list_clear(%struct.text_tag_list* %0) {
%2 = alloca %struct.text_tag_list*
store %struct.text_tag_list* %0, %struct.text_tag_list** %2
%3 = load %struct.text_tag_list*, %struct.text_tag_list** %2
%4 = bitcast %struct.text_tag_list* %3 to %struct.genlist*
%5 = call i32 @genlist_clear(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.text_tag_list = type { i32 }
%struct.genlist = type { i32 }
define void @text_tag_list_clear(%struct.text_tag_list* %0) {
%2 = bitcast %struct.text_tag_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_clear(%struct.genlist* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((constructor)) void thingInit() { printf("Init!\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Init!\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @thingInit, i8* null }]
define void @thingInit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @thingInit, i8* null }]
@str = [6 x i8] c"Init!\00"
define void @thingInit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int *);
int /*<<< orphan*/ close(int);
void cleanup_close_fdp(int *fdp) {
  int fd;
  assert(fdp);
  fd = *fdp;
  if (fd != -1)
    (void)close(fd);
}


x86 assembly (clang, -O0):
<cleanup_close_fdp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
je     1150 <cleanup_close_fdp+0x30>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_close_fdp>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    (%rbx),%edi
cmp    $0xffffffff,%edi
je     1136 <cleanup_close_fdp+0x16>
pop    %rbx
jmp    1030 <close@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cleanup_close_fdp(i32* %0) {
%2 = tail call i32 @assert(i32* %0)
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @close(i32 %3)
br label %7
7: ; preds = %5, %1
ret void
}
void GPIOPinIntDisable(unsigned long ulPort, unsigned char ucPins) {
  ;
  (*((volatile unsigned long *)(ulPort + 0x00000410))) &= ~(ucPins);
}


x86 assembly (clang, -O0):
<GPIOPinIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    0x410(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x410(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinIntDisable>:
mov    %esi,%eax
not    %rax
and    %rax,0x410(%rdi)
ret

LLVM IR (-O0):
define void @GPIOPinIntDisable(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = xor i32 %6, -1
%8 = sext i32 %7 to i64
%9 = load i64, i64* %3
%10 = add i64 %9, 1040
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
define void @GPIOPinIntDisable(i64 %0, i8 zeroext %1) {
%3 = zext i8 %1 to i64
%4 = xor i64 %3, -1
%5 = add i64 %0, 1040
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, %4
store volatile i64 %8, i64* %6
ret void
}
void add_one(int *x) { *x = *x + 1; }


x86 assembly (clang, -O0):
<add_one>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_one>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @add_one(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int32_to_hex(int, unsigned char *);
void nint32_to_hex(int *data, unsigned char *datahex, int n) {
  for (int i = 0; i < n; ++i) {
    int32_to_hex(data[i], &datahex[i * 4]);
  }
}


x86 assembly (clang, -O0):
<nint32_to_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1163 <nint32_to_hex+0x53>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%eax
shl    $0x2,%eax
cltq
add    %rax,%rsi
call   1030 <int32_to_hex@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <nint32_to_hex+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nint32_to_hex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1146 <nint32_to_hex+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
shl    $0x2,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,1),%edi
lea    (%r14,%rbx,1),%rsi
call   1030 <int32_to_hex@plt>
add    $0x4,%rbx
cmp    %rbx,%r12
jne    1130 <nint32_to_hex+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @nint32_to_hex(i32* nocapture %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %15, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = shl nsw i64 %9, 2
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = tail call i32 @int32_to_hex(i32 %11, i8* %13)
%15 = add nuw nsw i64 %9, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %7, label %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sgml_free(void *mem) {
  if (mem)
    free(mem);
}


x86 assembly (clang, -O0):
<sgml_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <sgml_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgml_free>:
test   %rdi,%rdi
je     111a <sgml_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @sgml_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qsort_internal_serial(int *, int /*<<< orphan*/, int);
void qsort_serial(int *array, int N) { qsort_internal_serial(array, 0, N - 1); }


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

x86 assembly (clang, -O2):
<qsort_serial>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <qsort_internal_serial@plt>

LLVM IR (-O0):
define void @qsort_serial(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 = sub nsw i32 %6, 1
%8 = call i32 @qsort_internal_serial(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @qsort_serial(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @qsort_internal_serial(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ dec_and_test(int *);
int getit(int *);
int f(int *i, int cond) {
  if (cond) {
    getit(0);
    if (dec_and_test(i))
      getit(i);
    return 42;
  }
  if (dec_and_test(i))
    (void)1;
  return getit(i);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116a <f+0x4a>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <getit@plt>
mov    -0x10(%rbp),%rdi
call   1040 <dec_and_test@plt>
cmp    $0x0,%rax
je     115e <f+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <getit@plt>
movl   $0x2a,-0x4(%rbp)
jmp    118e <f+0x6e>
mov    -0x10(%rbp),%rdi
call   1040 <dec_and_test@plt>
cmp    $0x0,%rax
je     1182 <f+0x62>
jmp    1182 <f+0x62>
mov    -0x10(%rbp),%rdi
call   1030 <getit@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
je     114b <f+0x2b>
xor    %edi,%edi
call   1030 <getit@plt>
mov    %rbx,%rdi
call   1040 <dec_and_test@plt>
test   %rax,%rax
je     1144 <f+0x24>
mov    %rbx,%rdi
call   1030 <getit@plt>
mov    $0x2a,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <dec_and_test@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <getit@plt>

LLVM IR (-O0):
define i32 @f(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = call i32 @getit(i32* null)
%10 = load i32*, i32** %4
%11 = call i64 @dec_and_test(i32* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32*, i32** %4
%15 = call i32 @getit(i32* %14)
br label %16
16: ; preds = %13, %8
store i32 42, i32* %3
br label %25
17: ; preds = %2
%18 = load i32*, i32** %4
%19 = call i64 @dec_and_test(i32* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %17
br label %22
22: ; preds = %21, %17
%23 = load i32*, i32** %4
%24 = call i32 @getit(i32* %23)
store i32 %24, i32* %3
br label %25
25: ; preds = %22, %16
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @f(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i32 @getit(i32* null)
%6 = tail call i64 @dec_and_test(i32* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = tail call i32 @getit(i32* %0)
br label %13
10: ; preds = %2
%11 = tail call i64 @dec_and_test(i32* %0)
%12 = tail call i32 @getit(i32* %0)
br label %13
13: ; preds = %4, %8, %10
%14 = phi i32 [ %12, %10 ], [ 42, %8 ], [ 42, %4 ]
ret i32 %14
}
int right_child(int i) { return (i << 1) + 2; }


x86 assembly (clang, -O0):
<right_child>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_child>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @right_child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = add nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @right_child(i32 %0) {
%2 = shl i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
ssize_t __recv(int fd, void *buf, size_t n, int flags) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__recv>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__recv(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* @ENOSYS
%10 = call i32 @__set_errno(i32 %9)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__recv(i32 %0, i8* nocapture readnone %1, i64 %2, i32 %3) {
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int height;
};
typedef TYPE_1__ XExposeEvent;

/* Variables and functions */
void set_XExposeEvent_height(void *_p, int _v) {
  ((XExposeEvent *)_p)->height = (int)_v;
}


x86 assembly (clang, -O0):
<set_XExposeEvent_height>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XExposeEvent_height>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XExposeEvent_height(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XExposeEvent_height(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
const char *__get_c_string(const char *__str) { return __str; }


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

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

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

LLVM IR (-O2):
define i8* @__get_c_string(i8* readnone returned %0) {
ret i8* %0
}
float module(float number) {
  if (number < 0)
    return -number;
  else
    return number;
}


x86 assembly (clang, -O0):
<module>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <module+0x32>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113c <module+0x3c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<module>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @module(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fneg float %7
store float %8, float* %2
br label %11
9: ; preds = %1
%10 = load float, float* %3
store float %10, float* %2
br label %11
11: ; preds = %9, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @module(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t bin2bcd(uint8_t value) {
  char retval;
  retval = 0;
  while (1) {
    if (value >= 10) {
      value -= 10;
      retval += 0x10;
    } else {
      retval += value;
      break;
    }
  }
  return (retval);
}


x86 assembly (clang, -O0):
<bin2bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     112d <bin2bcd+0x2d>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x10,%eax
mov    %al,-0x5(%rbp)
jmp    113e <bin2bcd+0x3e>
mov    -0x4(%rbp),%ecx
movsbl -0x5(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x5(%rbp)
jmp    1143 <bin2bcd+0x43>
jmp    110b <bin2bcd+0xb>
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin2bcd>:
xor    %eax,%eax
cmp    $0xa,%edi
jl     1121 <bin2bcd+0x21>
xor    %eax,%eax
nopl   0x0(%rax)
lea    -0xa(%rdi),%ecx
add    $0x10,%al
movsbl %al,%eax
cmp    $0x13,%edi
mov    %ecx,%edi
ja     1110 <bin2bcd+0x10>
jmp    1123 <bin2bcd+0x23>
mov    %edi,%ecx
add    %eax,%ecx
movsbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @bin2bcd(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = add nsw i32 %5, -10
%7 = shl nsw i32 %4, 24
%8 = add i32 %7, 268435456
%9 = ashr exact i32 %8, 24
%10 = icmp ugt i32 %5, 19
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ %0, %1 ], [ %6, %3 ]
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
%14 = add nsw i32 %13, %12
%15 = shl i32 %14, 24
%16 = ashr exact i32 %15, 24
ret i32 %16
}
void gtk_tree_selection_path_is_selected() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_selection_path_is_selected() {
ret void
}
/* Variables and functions */
char *strrchr(const char *s, int c) {
  char *r = NULL;
  char ch = c;
  do {
    if (*s == ch) {
      r = (char *)s;
    }
  } while (*s++);
  return r;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jne    1134 <strrchr+0x34>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1139 <strrchr+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1119 <strrchr+0x19>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
movsbl %sil,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movsbl (%rdi),%edx
cmp    %edx,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %edx,%edx
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %5, %2
%6 = phi i8* [ null, %2 ], [ %11, %5 ]
%7 = phi i8* [ %0, %2 ], [ %12, %5 ]
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %4, %9
%11 = select i1 %10, i8* %7, i8* %6
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = icmp eq i8 %8, 0
br i1 %13, label %14, label %5
14: ; preds = %5
ret i8* %11
}
double f4_sum_pre_int_int_long(int v0, int v1, long v) {
  return (double)v0 + (double)v1 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_int_int_long>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_int_int_long>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %rdx,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_int_int_long(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to double
%11 = fadd double %8, %10
%12 = load i64, i64* %6
%13 = sitofp i64 %12 to double
%14 = fadd double %11, %13
ret double %14
}

LLVM IR (-O2):
define double @f4_sum_pre_int_int_long(i32 %0, i32 %1, i64 %2) {
%4 = sitofp i32 %0 to double
%5 = sitofp i32 %1 to double
%6 = fadd double %4, %5
%7 = sitofp i64 %2 to double
%8 = fadd double %6, %7
ret double %8
}
void hkptr_setstate(int *hk_ptr, int new) { *hk_ptr = *hk_ptr + new + 1; }


x86 assembly (clang, -O0):
<hkptr_setstate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hkptr_setstate>:
mov    (%rdi),%eax
add    %esi,%eax
add    $0x1,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @hkptr_setstate(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* %5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = load i32*, i32** %3
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @hkptr_setstate(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add i32 %1, 1
%5 = add i32 %4, %3
store i32 %5, i32* %0
ret void
}
unsigned long spl_debug_get_mask(void) { return (0); }


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

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

LLVM IR (-O0):
define i64 @spl_debug_get_mask() {
ret i64 0
}

LLVM IR (-O2):
define i64 @spl_debug_get_mask() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void readyfn(void *arg) {
  if (!arg) {
    printf("readyfn got a NULL arg\n");
    exit(1);
  } else {
  }
}


x86 assembly (clang, -O0):
<readyfn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114d <readyfn+0x2d>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
jmp    1152 <readyfn+0x32>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readyfn>:
test   %rdi,%rdi
je     1126 <readyfn+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"readyfn got a NULL arg\0A\00"
define void @readyfn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
br label %9
9: ; preds = %8
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"readyfn got a NULL arg\00"
define void @readyfn(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
ret void
}
int test_imm_11int32_reg(int val) { return ((val) & (0x11 << 0)) ? -20 : -40; }


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

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

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

LLVM IR (-O2):
define i32 @test_imm_11int32_reg(i32 %0) {
%2 = and i32 %0, 17
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int str2tag(const char *str) {
  unsigned long tag;
  tag = (((unsigned long)str[0]) << 24) + (((unsigned long)str[1]) << 16) +
        (((unsigned long)str[2]) << 8) + (((unsigned long)str[3]));
  return (int)tag;
}


x86 assembly (clang, -O0):
<str2tag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbq (%rax),%rax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
movsbq 0x1(%rcx),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movsbq 0x2(%rcx),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movsbq 0x3(%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2tag>:
movzbl (%rdi),%eax
shl    $0x18,%eax
movsbl 0x1(%rdi),%ecx
shl    $0x10,%ecx
add    %eax,%ecx
movsbl 0x2(%rdi),%edx
shl    $0x8,%edx
add    %ecx,%edx
movsbl 0x3(%rdi),%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @str2tag(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = shl nsw i32 %7, 16
%9 = add i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = shl nsw i32 %12, 8
%14 = add i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = add i32 %14, %17
ret i32 %18
}
long long foo(long long a) { return a > 0 ? a : -a; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <foo+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <foo+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
void toomuchwait() {}


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

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

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

LLVM IR (-O2):
define void @toomuchwait() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Led2__clr();
void LedsP__Leds__led2On(void) {
  LedsP__Led2__clr();
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @LedsP__Leds__led2On() {
%1 = tail call i32 (...) @LedsP__Led2__clr()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __v4hi;

/* Variables and functions */
void test1() { __v4hi A = (__v4hi)0LL; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 10, y = 20;
  x = x + y;
  x += y;
  printf("integer addition: %d\n", x);
  return 0;
}


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

LLVM IR (-O0):
@.str = [22 x i8] c"integer addition: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
store i32 %6, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"integer addition: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 50)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef int ssize_t;

/* Variables and functions */
bool sancus_get_u16zd(ssize_t v, uint16_t *out) {
  if ((v >= 0) && (v <= 0xffff)) {
    if (out != NULL)
      *out = (uint16_t)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_u16zd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1144 <sancus_get_u16zd+0x44>
cmpl   $0xffff,-0x8(%rbp)
jg     1144 <sancus_get_u16zd+0x44>
cmpq   $0x0,-0x10(%rbp)
je     1138 <sancus_get_u16zd+0x38>
movslq -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    114b <sancus_get_u16zd+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_u16zd>:
xor    %eax,%eax
cmp    $0xffff,%edi
ja     1119 <sancus_get_u16zd+0x19>
mov    $0x1,%eax
test   %rsi,%rsi
je     1119 <sancus_get_u16zd+0x19>
mov    %edi,%ecx
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
define i32 @sancus_get_u16zd(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64*
store i32 %0, i32* %4
store i64* %1, i64** %5
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 65535
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i64*, i64** %5
%13 = icmp ne i64* %12, null
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = load i64*, i64** %5
store i64 %16, i64* %17
br label %18
18: ; preds = %14, %11
store i32 1, i32* %3
br label %20
19: ; preds = %8, %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @sancus_get_u16zd(i32 %0, i64* writeonly %1) {
%3 = icmp ult i32 %0, 65536
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = icmp eq i64* %1, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = zext i32 %0 to i64
store i64 %7, i64* %1
br label %8
8: ; preds = %2, %4, %6
%9 = phi i32 [ 1, %6 ], [ 1, %4 ], [ 0, %2 ]
ret i32 %9
}