xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int uniquePaths(int, int);
int main(void) {
  printf("%d\n", uniquePaths(7, 3));
  printf("%d\n", uniquePaths(10, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
mov    $0x3,%esi
call   1040 <uniquePaths@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%esi
mov    %esi,%edi
call   1040 <uniquePaths@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7,%edi
mov    $0x3,%esi
call   1040 <uniquePaths@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <uniquePaths@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @uniquePaths(i32 7, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @uniquePaths(i32 10, i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
unsigned int bits_is_even_uint(unsigned int val) { return (((val)&1) ^ 1); }


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

x86 assembly (clang, -O2):
<bits_is_even_uint>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bits_is_even_uint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @bits_is_even_uint(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int open(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int opendev(int mode) {
  int fd;
  extern int errno;
  fd = open("/dev/armem", mode);
  if (fd < 0) {
    perror("open: "
           "/dev/armem");
    fprintf(stderr, "Create using: mknod "
                    "/dev/armem"
                    " c 1 13\n");
  }
  return fd;
}


x86 assembly (clang, -O0):
<opendev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1178 <opendev+0x48>
lea    0xea2(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opendev>:
push   %rbx
mov    %edi,%esi
lea    0xecc(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1149 <opendev+0x19>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb0(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1145 <opendev+0x15>

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/armem\00"
@.str.1 = [17 x i8] c"open: /dev/armem\00"
@stderr = global i32 0
@.str.2 = [39 x i8] c"Create using: mknod /dev/armem c 1 13\0A\00"
define i32 @opendev(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %8, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/armem\00"
@.str.1 = [17 x i8] c"open: /dev/armem\00"
@stderr = global i32 0
@.str.2 = [39 x i8] c"Create using: mknod /dev/armem c 1 13\0A\00"
define i32 @opendev(i32 %0) {
%2 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %4, %1
ret i32 %2
}
void __attribute__((warning("curl_easy_getinfo expects a pointer to struct "
                            "curl_slist * for this info")))
__attribute__((unused)) __attribute__((no))
_curl_easy_getinfo_err_curl_slist(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_getinfo_err_curl_slist() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int xxx_create_segfault(char *dest) {
  int *ptr = (int *)0xFFFFFFFF;
  *ptr = 2;
  return 0;
}


x86 assembly (clang, -O0):
<xxx_create_segfault>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xffffffff,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxx_create_segfault>:
mov    $0xffffffff,%eax
movl   $0x2,(%rax)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @xxx_create_segfault(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
store i32* inttoptr (i64 4294967295 to i32*), i32** %3
%4 = load i32*, i32** %3
store i32 2, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @xxx_create_segfault(i8* nocapture readnone %0) {
store i32 2, i32* inttoptr (i64 4294967295 to i32*)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap32(uint32_t x) {
  x = ((x & 0x00ff00ff) << 8) | ((x & 0xff00ff00) >> 8);
  return (x << 16) | (x >> 16);
}


x86 assembly (clang, -O0):
<swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff00,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap32>:
bswap  %edi
ror    $0x10,%edi
mov    %edi,%eax
shl    $0x10,%eax
sar    $0x10,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @swap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16711935
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, -16711936
%8 = lshr i32 %7, 8
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = shl i32 %10, 16
%12 = load i32, i32* %2
%13 = ashr i32 %12, 16
%14 = or i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @swap32(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, -16711936
%4 = lshr i32 %0, 8
%5 = and i32 %4, 16711935
%6 = or i32 %3, %5
%7 = shl i32 %6, 16
%8 = ashr i32 %6, 16
%9 = or i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int print_test_data();
int test();
int main(int argc, char *argv[]) {
  int ret;
  if (argc > 1)
    ret = print_test_data();
  else
    ret = test();
  exit(ret);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    115f <main+0x2f>
mov    $0x0,%al
call   1030 <print_test_data@plt>
mov    %eax,-0x14(%rbp)
jmp    1169 <main+0x39>
mov    $0x0,%al
call   1050 <test@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
cmp    $0x2,%edi
jl     1144 <main+0x14>
call   1030 <print_test_data@plt>
mov    %eax,%edi
call   1040 <exit@plt>
call   1050 <test@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @print_test_data()
store i32 %10, i32* %6
br label %13
11: ; preds = %2
%12 = call i32 (...) @test()
store i32 %12, i32* %6
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %6
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @print_test_data()
br label %8
6: ; preds = %2
%7 = tail call i32 (...) @test()
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
char heapBased1() {
  char *buf = malloc(2);
  buf[0] = 'a';
  char result = buf[1];
  free(buf);
  return result;
}


x86 assembly (clang, -O0):
<heapBased1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapBased1>:
push   %rax
mov    $0x2,%edi
call   1040 <malloc@plt>
movb   $0x61,(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define signext i8 @heapBased1() {
%1 = alloca i8*
%2 = alloca i8
%3 = call i8* @malloc(i32 2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 0
store i8 97, i8* %5
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
store i8 %8, i8* %2
%9 = load i8*, i8** %1
%10 = call i32 @free(i8* %9)
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @heapBased1() {
%1 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
store i8 97, i8* %1
%2 = tail call i32 @free(i8* %1)
ret i8 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    fputs("Out of memory.\n", stderr);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xmalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory.\0A\00"
@stderr = global i32 0
define i8* @xmalloc(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 %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory.\0A\00"
@stderr = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ nrf_drv_radio802154_busy_channel();
void nrf_drv_radio802154_notify_busy_channel(void) {
  nrf_drv_radio802154_busy_channel();
}


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

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

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

LLVM IR (-O2):
define void @nrf_drv_radio802154_notify_busy_channel() {
%1 = tail call i32 (...) @nrf_drv_radio802154_busy_channel()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compressQueue(int *, int, int);
int /*<<< orphan*/ showSucess(int);
void freeQueue(int *queue, int *begin, int *end) {
  compressQueue(queue, (5 - 1), (5 - 1));
  *begin = -1;
  *end = -1;
  showSucess(2);
  return;
}


x86 assembly (clang, -O0):
<freeQueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%edx
mov    %edx,%esi
call   1040 <compressQueue@plt>
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    $0x2,%edi
call   1030 <showSucess@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeQueue>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    $0x4,%esi
mov    $0x4,%edx
call   1040 <compressQueue@plt>
movl   $0xffffffff,(%rbx)
movl   $0xffffffff,(%r14)
mov    $0x2,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <showSucess@plt>

LLVM IR (-O0):
define void @freeQueue(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 = call i32 @compressQueue(i32* %7, i32 4, i32 4)
%9 = load i32*, i32** %5
store i32 -1, i32* %9
%10 = load i32*, i32** %6
store i32 -1, i32* %10
%11 = call i32 @showSucess(i32 2)
ret void
}

LLVM IR (-O2):
define void @freeQueue(i32* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @compressQueue(i32* %0, i32 4, i32 4)
store i32 -1, i32* %1
store i32 -1, i32* %2
%5 = tail call i32 @showSucess(i32 2)
ret void
}
/* Variables and functions */
scalar_t__ dagutil_lockstream(int, int);
int dagutil_lockallstreams(int dagfd) {
  int stream;
  for (stream = 0; stream < 64; stream++) {
    if (0 != dagutil_lockstream(dagfd, stream)) {
      return -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<dagutil_lockallstreams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    1164 <dagutil_lockallstreams+0x54>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <dagutil_lockstream@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1151 <dagutil_lockallstreams+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <dagutil_lockallstreams+0x5b>
jmp    1156 <dagutil_lockallstreams+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <dagutil_lockallstreams+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dagutil_lockallstreams>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <dagutil_lockstream@plt>
test   %rax,%rax
jne    113a <dagutil_lockallstreams+0x2a>
add    $0x1,%ebp
cmp    $0x40,%ebp
jne    1120 <dagutil_lockallstreams+0x10>
xor    %eax,%eax
jmp    113f <dagutil_lockallstreams+0x2f>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @dagutil_lockallstreams(i32 %0) {
br label %5
2: ; preds = %5
%3 = add nuw nsw i32 %6, 1
%4 = icmp eq i32 %3, 64
br i1 %4, label %9, label %5
5: ; preds = %1, %2
%6 = phi i32 [ 0, %1 ], [ %3, %2 ]
%7 = tail call i64 @dagutil_lockstream(i32 %0, i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %2, label %9
9: ; preds = %2, %5
%10 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
unsigned isxdigit(char c) {
  return (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f') ||
         (c >= '0' && c <= '9');
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <isxdigit+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x46,%ecx
mov    %al,-0x2(%rbp)
jle    116d <isxdigit+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <isxdigit+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    116d <isxdigit+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <isxdigit+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x6,%al
setb   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 70
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 48
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 57
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @isxdigit(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 6
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_cond_timedwait(pthread_cond_t *a, pthread_mutex_t *b,
                           const struct timespec *c) {
  assert(0);
}


x86 assembly (clang, -O0):
<pthread_cond_timedwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @pthread_cond_timedwait(i32* %0, i32* %1, %struct.timespec* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca %struct.timespec*
store i32* %0, i32** %5
store i32* %1, i32** %6
store %struct.timespec* %2, %struct.timespec** %7
%8 = call i32 @assert(i32 0)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @pthread_cond_timedwait(i32* nocapture readnone %0, i32* nocapture readnone %1, %struct.timespec* nocapture readnone %2) {
%4 = tail call i32 @assert(i32 0)
ret i32 undef
}
void do_post_event(int id) {}


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

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

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

LLVM IR (-O2):
define void @do_post_event(i32 %0) {
ret void
}
/* Variables and functions */
double *malloc(int);
double *dptr(double value) {
  double *p = malloc(sizeof(double));
  *p = value;
  return p;
}


x86 assembly (clang, -O0):
<dptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dptr>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x8,%edi
call   1030 <malloc@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%rax)
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias double* @dptr(double %0) {
%2 = tail call double* @malloc(i32 8)
store double %0, double* %2
ret double* %2
}
void putse(const char *str) {}


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

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

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

LLVM IR (-O2):
define void @putse(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall_printString(char *);
void finished() {
  syscall_printString("\r\nDone!");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<finished>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <syscall_printString@plt>
jmp    1120 <finished+0x10>

x86 assembly (clang, -O2):
<finished>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <syscall_printString@plt>
nopl   (%rax)
jmp    1120 <finished+0x10>

LLVM IR (-O0):
@.str = [8 x i8] c"\0D\0ADone!\00"
define void @finished() {
%1 = call i32 @syscall_printString(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0D\0ADone!\00"
define void @finished() {
%1 = tail call i32 @syscall_printString(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
void INT_Excep_CMTW1_CMWI1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CMTW1_CMWI1() {
ret void
}
double f(double const x) {
  if (x < 0)
    return -x;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <f+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <f+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @f(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *pro) {
  fprintf(stderr, "%s <file> <dir>\n", pro);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"%s <file> <dir>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"%s <file> <dir>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void element2subroutine() {}


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

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

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

LLVM IR (-O2):
define void @element2subroutine() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int count5(int /*<<< orphan*/ const);
void countDigits5(size_t length, const uint32_t *dataArray, int *countArray) {
  while (length) {
    *countArray = count5(*dataArray);
    countArray++;
    dataArray++;
    length--;
  }
}


x86 assembly (clang, -O0):
<countDigits5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <countDigits5+0x5b>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <count5@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <countDigits5+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDigits5>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1146 <countDigits5+0x36>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <count5@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <countDigits5+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @countDigits5(i64 %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i32* [ %11, %5 ], [ %2, %3 ]
%7 = phi i32* [ %12, %5 ], [ %1, %3 ]
%8 = phi i64 [ %13, %5 ], [ %0, %3 ]
%9 = load i32, i32* %7
%10 = tail call i32 @count5(i32 %9)
store i32 %10, i32* %6
%11 = getelementptr inbounds i32, i32* %6, i64 1
%12 = getelementptr inbounds i32, i32* %7, i64 1
%13 = add i64 %8, -1
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %3
ret void
}
/* Variables and functions */
int are_equal(int *, int *, int);
int /*<<< orphan*/ calculate(int *, int *, int);
int test_zeros() {
  int input[] = {0, 0, 0, 0, 0};
  int expected[] = {0, 0, 0, 0, 0};
  int output[5];
  calculate(input, output, 5);
  return are_equal(output, expected, 5);
}


x86 assembly (clang, -O0):
<test_zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0x5,%edx
call   1030 <calculate@plt>
lea    -0x60(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x5,%edx
call   1050 <are_equal@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_zeros>:
push   %rbx
sub    $0x60,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x0,0x30(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x20(%rsp),%rdi
lea    0x40(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x5,%edx
call   1030 <calculate@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1040 <are_equal@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_zeros() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %1 to i8*
%5 = bitcast [5 x i32]* %2 to i8*
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%8 = call i32 @calculate(i32* %6, i32* %7, i32 5)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%11 = call i32 @are_equal(i32* %9, i32* %10, i32 5)
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_zeros() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %1 to i8*
%5 = bitcast [5 x i32]* %2 to i8*
%6 = bitcast [5 x i32]* %3 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%9 = call i32 @calculate(i32* %7, i32* %8, i32 5)
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%11 = call i32 @are_equal(i32* %8, i32* %10, i32 5)
ret i32 %11
}
/* Variables and functions */
unsigned short ButtonWaitForAnyEvent(int /*<<< orphan*/);
int /*<<< orphan*/ ButtonWaitForPress(unsigned char);
void ButtonWaitForPressAndReleae(unsigned char Button) {
  unsigned short tmp;
  ButtonWaitForPress(Button);
  tmp = (unsigned short)Button << 8;
  while ((ButtonWaitForAnyEvent(0) & tmp) == 0) {
  }
}


x86 assembly (clang, -O0):
<ButtonWaitForPressAndReleae>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <ButtonWaitForPress@plt>
movzbl -0x1(%rbp),%eax
movzwl %ax,%eax
shl    $0x8,%eax
mov    %ax,-0x4(%rbp)
xor    %edi,%edi
call   1030 <ButtonWaitForAnyEvent@plt>
movzwl %ax,%eax
movzwl -0x4(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1163 <ButtonWaitForPressAndReleae+0x43>
jmp    1145 <ButtonWaitForPressAndReleae+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ButtonWaitForPressAndReleae>:
push   %rbx
mov    %edi,%ebx
call   1040 <ButtonWaitForPress@plt>
shl    $0x8,%ebx
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <ButtonWaitForAnyEvent@plt>
movzwl %ax,%eax
test   %eax,%ebx
je     1130 <ButtonWaitForPressAndReleae+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ButtonWaitForPressAndReleae(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i16
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @ButtonWaitForPress(i8 zeroext %4)
%6 = load i8, i8* %2
%7 = zext i8 %6 to i16
%8 = zext i16 %7 to i32
%9 = shl i32 %8, 8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %3
br label %11
11: ; preds = %18, %1
%12 = call zeroext i16 @ButtonWaitForAnyEvent(i32 0)
%13 = zext i16 %12 to i32
%14 = load i16, i16* %3
%15 = zext i16 %14 to i32
%16 = and i32 %13, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %11
br label %11
19: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @ButtonWaitForPressAndReleae(i8 zeroext %0) {
%2 = tail call i32 @ButtonWaitForPress(i8 zeroext %0)
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
br label %5
5: ; preds = %5, %1
%6 = tail call zeroext i16 @ButtonWaitForAnyEvent(i32 0)
%7 = zext i16 %6 to i32
%8 = and i32 %4, %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5
ret void
}
void gtk_about_dialog_set_name() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_set_name() {
ret void
}
/* Type definitions */
struct mat44 {
  int dummy;
};

/* Variables and functions */
float mat44_at(struct mat44 *, int, int);
float _mat44_sub33_at(struct mat44 *m, int delcol, int delrow, int col,
                      int row) {
  return mat44_at(m, col + (col >= delcol ? 1 : 0),
                  row + (row >= delrow ? 1 : 0));
}


x86 assembly (clang, -O0):
<_mat44_sub33_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0xc(%rbp),%r8d
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %r8d,%edx
cmovge %ecx,%eax
add    %eax,%esi
mov    -0x18(%rbp),%edx
mov    -0x18(%rbp),%r8d
mov    -0x10(%rbp),%r9d
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %r9d,%r8d
cmovge %ecx,%eax
add    %eax,%edx
call   1030 <mat44_at@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mat44_sub33_at>:
xor    %eax,%eax
cmp    %esi,%ecx
setge  %al
add    %ecx,%eax
xor    %ecx,%ecx
cmp    %edx,%r8d
setge  %cl
add    %r8d,%ecx
mov    %eax,%esi
mov    %ecx,%edx
jmp    1030 <mat44_at@plt>

LLVM IR (-O0):
%struct.mat44 = type { i32 }
define float @_mat44_sub33_at(%struct.mat44* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.mat44*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.mat44* %0, %struct.mat44** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.mat44*, %struct.mat44** %6
%12 = load i32, i32* %9
%13 = load i32, i32* %9
%14 = load i32, i32* %7
%15 = icmp sge i32 %13, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
%18 = add nsw i32 %12, %17
%19 = load i32, i32* %10
%20 = load i32, i32* %10
%21 = load i32, i32* %8
%22 = icmp sge i32 %20, %21
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 0
%25 = add nsw i32 %19, %24
%26 = call float @mat44_at(%struct.mat44* %11, i32 %18, i32 %25)
ret float %26
}

LLVM IR (-O2):
%struct.mat44 = type { i32 }
define float @_mat44_sub33_at(%struct.mat44* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sge i32 %3, %1
%7 = zext i1 %6 to i32
%8 = add nsw i32 %7, %3
%9 = icmp sge i32 %4, %2
%10 = zext i1 %9 to i32
%11 = add nsw i32 %10, %4
%12 = tail call float @mat44_at(%struct.mat44* %0, i32 %8, i32 %11)
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fdivrp() {
  db(0xDE);
  db(0xF1);
}


x86 assembly (clang, -O0):
<fdivrp>:
push   %rbp
mov    %rsp,%rbp
mov    $0xde,%edi
call   1030 <db@plt>
mov    $0xf1,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdivrp>:
push   %rax
mov    $0xde,%edi
call   1030 <db@plt>
mov    $0xf1,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fdivrp() {
%1 = call i32 @db(i32 222)
%2 = call i32 @db(i32 241)
ret void
}

LLVM IR (-O2):
define void @fdivrp() {
%1 = tail call i32 @db(i32 222)
%2 = tail call i32 @db(i32 241)
ret void
}
/* Variables and functions */
scalar_t__ inputint(char *);
float media(int a) {
  float media;
  int b = a;
  do {
    media += inputint("inserisci un numero");
    a--;
  } while (a);
  return media / b;
}


x86 assembly (clang, -O0):
<media>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <inputint@plt>
cvtsi2ss %rax,%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1121 <media+0x11>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<media>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r14d
lea    0xede(%rip),%rbx
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <inputint@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
addss  %xmm1,%xmm0
add    $0xffffffff,%ebp
jne    1130 <media+0x20>
xorps  %xmm1,%xmm1
cvtsi2ss %r14d,%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"inserisci un numero\00"
define float @media(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %4
br label %6
6: ; preds = %13, %1
%7 = call i64 @inputint(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = sitofp i64 %7 to float
%9 = load float, float* %3
%10 = fadd float %9, %8
store float %10, float* %3
%11 = load i32, i32* %2
%12 = add nsw i32 %11, -1
store i32 %12, i32* %2
br label %13
13: ; preds = %6
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 0
br i1 %15, label %6, label %16
16: ; preds = %13
%17 = load float, float* %3
%18 = load i32, i32* %4
%19 = sitofp i32 %18 to float
%20 = fdiv float %17, %19
ret float %20
}

LLVM IR (-O2):
@.str = [20 x i8] c"inserisci un numero\00"
define float @media(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi float [ undef, %1 ], [ %7, %2 ]
%4 = phi i32 [ %0, %1 ], [ %8, %2 ]
%5 = tail call i64 @inputint(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = sitofp i64 %5 to float
%7 = fadd float %3, %6
%8 = add nsw i32 %4, -1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %2
10: ; preds = %2
%11 = sitofp i32 %0 to float
%12 = fdiv float %7, %11
ret float %12
}
void X509V3_EXT_print_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_EXT_print_fp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ confTimerA0();
int /*<<< orphan*/ iniciaOperacao();
int /*<<< orphan*/ iniciaPinos();
int /*<<< orphan*/ printf(char *, int);
void main() {
  iniciaPinos();
  confTimerA0();
  iniciaOperacao();
  printf("Cont 1seg = %d\n", (int)(1048576 / 65536));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <iniciaPinos@plt>
mov    $0x0,%al
call   1060 <confTimerA0@plt>
mov    $0x0,%al
call   1050 <iniciaOperacao@plt>
lea    0xea0(%rip),%rdi
mov    $0x10,%esi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <iniciaPinos@plt>
xor    %eax,%eax
call   1060 <confTimerA0@plt>
xor    %eax,%eax
call   1050 <iniciaOperacao@plt>
lea    0xea3(%rip),%rdi
mov    $0x10,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Cont 1seg = %d\0A\00"
define void @main() {
%1 = call i32 (...) @iniciaPinos()
%2 = call i32 (...) @confTimerA0()
%3 = call i32 (...) @iniciaOperacao()
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 16)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Cont 1seg = %d\0A\00"
define void @main() {
%1 = tail call i32 (...) @iniciaPinos()
%2 = tail call i32 (...) @confTimerA0()
%3 = tail call i32 (...) @iniciaOperacao()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 16)
ret void
}
/* Variables and functions */
int foo(int, int, int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int display;
  int par;
  int i;
  int j;
  int k;
  int chamada;
  scanf("%d", &par);
  i = 1;
  j = 3;
  k = 4;
  chamada = foo(i, par, j, k);
  printf("\n%d", chamada);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x1,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <foo@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
mov    $0x1,%edi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1040 <foo@plt>
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @foo(i32 1, i32 %4, i32 3, i32 4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
long long bit50() { return 0x0004000000000000LL; }


x86 assembly (clang, -O0):
<bit50>:
push   %rbp
mov    %rsp,%rbp
movabs $0x4000000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit50>:
movabs $0x4000000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit50() {
ret i64 1125899906842624
}

LLVM IR (-O2):
define i64 @bit50() {
ret i64 1125899906842624
}
void sigint(signo) int signo;
{ fatal(2, "SIGINT"); }


x86 assembly (clang, -O0):
<sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
xor    %eax,%eax
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"SIGINT\00"
define void @sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @fatal to i32 (i32, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"SIGINT\00"
define void @sigint(i32 %0) {
%2 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @fatal to i32 (i32, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ charrep(char, int);
int /*<<< orphan*/ printf(char *);
void default_wakeup_table_header(__attribute__((unused)) void *report_data) {
  charrep('-', 55);
  printf("\n");
  printf("| IRQ |       Name      |  Count  |  early  |  late   |\n");
}


x86 assembly (clang, -O0):
<default_wakeup_table_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2d,%edi
mov    $0x37,%esi
call   1040 <charrep@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_wakeup_table_header>:
push   %rax
mov    $0x2d,%edi
mov    $0x37,%esi
call   1050 <charrep@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeaf(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [57 x i8] c"| IRQ | Name | Count | early | late |\0A\00"
define void @default_wakeup_table_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @charrep(i8 signext 45, i32 55)
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [56 x i8] c"| IRQ | Name | Count | early | late |\00"
define void @default_wakeup_table_header(i8* nocapture readnone %0) {
%2 = tail call i32 @charrep(i8 signext 45, i32 55)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
ret void
}
void foo005(int p) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @foo005(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ extension;
};
typedef TYPE_1__ XExtCodes;

/* Variables and functions */
int get_XExtCodes_extension(void *_p) {
  return (int)((XExtCodes *)_p)->extension;
}


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

x86 assembly (clang, -O2):
<get_XExtCodes_extension>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XExtCodes_extension(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}