xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
void dns_buffer_set_id(uint8_t *buf, uint16_t id) {
  *((uint16_t *)buf) = htons(id);
}


x86 assembly (clang, -O0):
<dns_buffer_set_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_buffer_set_id>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @dns_buffer_set_id(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @htons(i32 %1)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getInfo(char const *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Usage: ./run <0x00000000>\n");
    exit(1);
  }
  const char *hexstring = argv[1];
  getInfo(hexstring);
  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   $0x2,-0x8(%rbp)
je     1166 <main+0x36>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <getInfo@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1143 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <getInfo@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: ./run <0x00000000>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = call i32 @getInfo(i8* %16)
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"Usage: ./run <0x00000000>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @getInfo(i8* %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int);
int /*<<< orphan*/ writen(int, int /*<<< orphan*/ *, int);
void send_rv(int s, int32_t rv) {
  uint64_t buf;
  *(uint32_t *)&buf = htonl(4);
  *((uint32_t *)&buf + 1) = htonl(rv);
  writen(s, &buf, 8);
}


x86 assembly (clang, -O0):
<send_rv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <htonl@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x8,%edx
call   1040 <writen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_rv>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x4,%edi
call   1030 <htonl@plt>
mov    %ebx,%edi
call   1030 <htonl@plt>
mov    %eax,0x8(%rsp)
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
mov    $0x8,%edx
call   1040 <writen@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @send_rv(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @htonl(i32 4)
store i32 %6, i32* %5
%7 = load i32, i32* %4
%8 = call i32 @htonl(i32 %7)
%9 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = call i32 @writen(i32 %10, i32* %5, i32 8)
ret void
}

LLVM IR (-O2):
define void @send_rv(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htonl(i32 4)
%6 = tail call i32 @htonl(i32 %1)
%7 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %6, i32* %7
%8 = call i32 @writen(i32 %0, i32* %3, i32 8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XLeaveWindowEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XLeaveWindowEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XLeaveWindowEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XLeaveWindowEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XLeaveWindowEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XLeaveWindowEvent>:
test   %rdi,%rdi
je     112a <free_XLeaveWindowEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XLeaveWindowEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XLeaveWindowEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCDCharacter(int /*<<< orphan*/);
void LCDString(char *characters) {
  while (*characters)
    LCDCharacter(*characters++);
}


x86 assembly (clang, -O0):
<LCDString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <LCDString+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <LCDCharacter@plt>
jmp    111c <LCDString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <LCDString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <LCDCharacter@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <LCDString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @LCDString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @LCDCharacter(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void set_udp_header_udp_flood() {}


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

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

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

LLVM IR (-O2):
define void @set_udp_header_udp_flood() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_KEEPALIVE;
int __sapi_sock_set_optint(int, int /*<<< orphan*/, int /*<<< orphan*/);
int sapi_sock_set_keepalive(int sock) {
  return __sapi_sock_set_optint(sock, SOL_SOCKET, SO_KEEPALIVE);
}


x86 assembly (clang, -O0):
<sapi_sock_set_keepalive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
call   1030 <__sapi_sock_set_optint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sapi_sock_set_keepalive>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
jmp    1030 <__sapi_sock_set_optint@plt>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
define i32 @sapi_sock_set_keepalive(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_KEEPALIVE
%6 = call i32 @__sapi_sock_set_optint(i32 %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
define i32 @sapi_sock_set_keepalive(i32 %0) {
%2 = load i32, i32* @SOL_SOCKET
%3 = load i32, i32* @SO_KEEPALIVE
%4 = tail call i32 @__sapi_sock_set_optint(i32 %0, i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, int);
int counts(char *name, int size, int howmany) {
  printf("(%d) %16s = %d\n", howmany, name, size);
  return size * howmany;
}


x86 assembly (clang, -O0):
<counts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<counts>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%rdx
lea    0xedf(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%ecx
call   1030 <printf@plt>
imul   %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"(%d) %16s = %d\0A\00"
define i32 @counts(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %0, i32 %1)
%5 = mul nsw i32 %2, %1
ret i32 %5
}
/* Variables and functions */
int mfs_delete_file(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int mfs_delete_dir(char *newdir) {
  if (!strcmp(newdir, "..") || !strcmp(newdir, "."))
    return 0;
  return mfs_delete_file(newdir);
}


x86 assembly (clang, -O0):
<mfs_delete_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     115e <mfs_delete_dir+0x3e>
mov    -0x10(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    116a <mfs_delete_dir+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1176 <mfs_delete_dir+0x56>
mov    -0x10(%rbp),%rdi
call   1030 <mfs_delete_file@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfs_delete_dir>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1150 <mfs_delete_dir+0x30>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1150 <mfs_delete_dir+0x30>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <mfs_delete_file@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"..\00"
@.str.1 = [2 x i8] c".\00"
define i32 @mfs_delete_dir(i8* %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @mfs_delete_file(i8* %0)
br label %9
9: ; preds = %1, %4, %7
%10 = phi i32 [ %8, %7 ], [ 0, %4 ], [ 0, %1 ]
ret i32 %10
}
int getIntLen(int number) {
  int intLen;
  if (number < 0) {
    intLen = 2;
    while (number > -9) {
      number /= 10;
      intLen++;
    }
  } else {
    intLen = 1;
    while (number > 9) {
      number /= 10;
      intLen++;
    }
  }
  return intLen;
}


x86 assembly (clang, -O0):
<getIntLen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1143 <getIntLen+0x43>
movl   $0x2,-0x8(%rbp)
cmpl   $0xfffffff7,-0x4(%rbp)
jle    113e <getIntLen+0x3e>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <getIntLen+0x18>
jmp    1175 <getIntLen+0x75>
movl   $0x1,-0x8(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    1170 <getIntLen+0x70>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <getIntLen+0x4a>
jmp    1175 <getIntLen+0x75>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIntLen>:
test   %edi,%edi
js     1135 <getIntLen+0x35>
mov    $0x1,%eax
cmp    $0xa,%edi
jb     1134 <getIntLen+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x63,%edi
mov    %edx,%edi
ja     1120 <getIntLen+0x20>
ret
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @getIntLen(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 9
br i1 %4, label %7, label %13
5: ; preds = %1
%6 = icmp ult i32 %0, -8
br label %13
7: ; preds = %3, %7
%8 = phi i32 [ %11, %7 ], [ 1, %3 ]
%9 = phi i32 [ %10, %7 ], [ %0, %3 ]
%10 = udiv i32 %9, 10
%11 = add nuw nsw i32 %8, 1
%12 = icmp ugt i32 %9, 99
br i1 %12, label %7, label %13
13: ; preds = %7, %5, %3
%14 = phi i32 [ 1, %3 ], [ 2, %5 ], [ %11, %7 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int strcmp(char *, char *);
int wcscmp(const wchar_t *s1, const wchar_t *s2) {
  return strcmp((char *)s1, (char *)s2);
}


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

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

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

LLVM IR (-O2):
define i32 @wcscmp(i32* nocapture %0, i32* nocapture %1) {
%3 = bitcast i32* %0 to i8*
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
int gdysize(int yr) {
  if (!(yr % 4)) {
    if ((!(yr % 100)) && yr % 400)
      return (365);
    return (366);
  }
  return (365);
}


x86 assembly (clang, -O0):
<gdysize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115b <gdysize+0x5b>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <gdysize+0x4f>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114f <gdysize+0x4f>
movl   $0x16d,-0x4(%rbp)
jmp    1162 <gdysize+0x62>
movl   $0x16e,-0x4(%rbp)
jmp    1162 <gdysize+0x62>
movl   $0x16d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdysize>:
mov    $0x16d,%eax
test   $0x3,%dil
je     110c <gdysize+0xc>
ret
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x2,%ecx
cmp    $0x28f5c29,%ecx
setae  %cl
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
setb   %al
or     %cl,%al
movzbl %al,%eax
add    $0x16d,%eax
ret

LLVM IR (-O0):
define i32 @gdysize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 4
%6 = icmp ne i32 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 100
%10 = icmp ne i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = srem i32 %12, 400
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 365, i32* %2
br label %18
16: ; preds = %11, %7
store i32 366, i32* %2
br label %18
17: ; preds = %1
store i32 365, i32* %2
br label %18
18: ; preds = %17, %16, %15
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @gdysize(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
%10 = select i1 %9, i32 366, i32 365
br label %11
11: ; preds = %4, %1
%12 = phi i32 [ 365, %1 ], [ %10, %4 ]
ret i32 %12
}
/* Variables and functions */
int isUsableDasd(char *);
int isLdlDasd(char *device) { return (isUsableDasd(device) == 2); }


x86 assembly (clang, -O0):
<isLdlDasd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <isUsableDasd@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLdlDasd>:
push   %rax
call   1030 <isUsableDasd@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isLdlDasd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @isUsableDasd(i8* %3)
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isLdlDasd(i8* %0) {
%2 = tail call i32 @isUsableDasd(i8* %0)
%3 = icmp eq i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ info();
void info_command(void) { info(); }


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

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

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

LLVM IR (-O2):
define void @info_command() {
%1 = tail call i32 (...) @info()
ret void
}
double glmComputeVectorLength3dPow2(const double v[3]) {
  return v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
}


x86 assembly (clang, -O0):
<glmComputeVectorLength3dPow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeVectorLength3dPow2>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @glmComputeVectorLength3dPow2(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
ret double %23
}

LLVM IR (-O2):
define double @glmComputeVectorLength3dPow2(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "usage: %s [-n] command [args...]\n", progname);
  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    $0xffffffff,%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    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"usage: %s [-n] command [args...]\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 ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"usage: %s [-n] command [args...]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SYS_unlink;
int /*<<< orphan*/ printf(char *, char const *);
int syscall(int /*<<< orphan*/, char const *);
int real_unlink(const char *fn) {
  if (0)
    printf("real_unlink(%s)\n", fn);
  return syscall(SYS_unlink, (fn));
}


x86 assembly (clang, -O0):
<real_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_unlink>:
mov    %rdi,%rsi
mov    0x2ede(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_unlink = global i32 0
define i32 @real_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @SYS_unlink
%4 = load i8*, i8** %2
%5 = call i32 @syscall(i32 %3, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@SYS_unlink = global i32 0
define i32 @real_unlink(i8* %0) {
%2 = load i32, i32* @SYS_unlink
%3 = tail call i32 @syscall(i32 %2, i8* %0)
ret i32 %3
}
void foo509(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo509(i32 %0) {
ret void
}
int seq_compar(const void *v1, const void *v2) {
  long long ll1 = *(long long *)v1;
  long long ll2 = *(long long *)v2;
  return (ll1 < ll2) ? -1 : ((ll1 == ll2) ? 0 : 1);
}


x86 assembly (clang, -O0):
<seq_compar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    113d <seq_compar+0x3d>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1155 <seq_compar+0x55>
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @seq_compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp ne i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
char *fillnum(n, p)
long n;
char *p;
{
  if (n >= 10) {
    p = fillnum(n / 10, p);
  }
  *p++ = (int)(n % 10) + '0';
  *p = '\0';
  return p;
}


x86 assembly (clang, -O0):
<fillnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0xa,-0x8(%rbp)
jl     1149 <fillnum+0x39>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fillnum@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillnum>:
push   %rbx
mov    %rdi,%rbx
cmp    $0xa,%rdi
jl     1139 <fillnum+0x29>
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mov    %rbx,%rax
mul    %rcx
mov    %rdx,%rdi
shr    $0x3,%rdi
call   1030 <fillnum@plt>
mov    %rax,%rsi
movabs $0x6666666666666667,%rcx
66 66 66
mov    %rbx,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x2,%edx
add    %eax,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ebx
add    $0x30,%bl
lea    0x1(%rsi),%rax
mov    %bl,(%rsi)
movb   $0x0,0x1(%rsi)
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @fillnum(i64 %0, i8* %1) {
%3 = icmp sgt i64 %0, 9
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = udiv i64 %0, 10
%6 = tail call i8* @fillnum(i64 %5, i8* %1)
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %6, %4 ], [ %1, %2 ]
%9 = srem i64 %0, 10
%10 = trunc i64 %9 to i8
%11 = add nsw i8 %10, 48
%12 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %11, i8* %8
store i8 0, i8* %12
ret i8* %12
}
int string_byte_cmp_func(char *item1, char *item2) {
  if (*item1 < *item2)
    return -1;
  if (*item1 > *item2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<string_byte_cmp_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    112e <string_byte_cmp_func+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <string_byte_cmp_func+0x57>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jle    1150 <string_byte_cmp_func+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1157 <string_byte_cmp_func+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @string_byte_cmp_func(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = icmp sgt i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
void pass_whitespace(char *ptr) {
  for (; *ptr == ' ' || *ptr == '\n' || *ptr == '\t'; ptr++)
    ;
}


x86 assembly (clang, -O0):
<pass_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1142 <pass_whitespace+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     1142 <pass_whitespace+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <pass_whitespace+0x52>
jmp    1168 <pass_whitespace+0x68>
jmp    1157 <pass_whitespace+0x57>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <pass_whitespace+0x8>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @pass_whitespace(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ asinhf(float);
int /*<<< orphan*/ link_failure_asinhf();
void test_asinhf(float f) {
  if (asinhf(f) != asinhf(f))
    link_failure_asinhf();
}


x86 assembly (clang, -O0):
<test_asinhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <asinhf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <asinhf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_asinhf+0x3c>
mov    $0x0,%al
call   1030 <link_failure_asinhf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_asinhf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1040 <asinhf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1040 <asinhf@plt>
cmp    %rax,%rbx
jne    1149 <test_asinhf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_asinhf@plt>

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

LLVM IR (-O2):
define void @test_asinhf(float %0) {
%2 = tail call i64 @asinhf(float %0)
%3 = tail call i64 @asinhf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_asinhf()
br label %7
7: ; preds = %5, %1
ret void
}
void uart_wait_tx_done(void) {
  while ((*(volatile unsigned int *)((((0x10000000 + 0xA100000) + 0x0000) +
                                      0x14)) &
          0x40) == 0)
    ;
}


x86 assembly (clang, -O0):
<uart_wait_tx_done>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <uart_wait_tx_done+0x9>
mov    $0x1a100014,%eax
mov    (%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
jne    1121 <uart_wait_tx_done+0x21>
jmp    1109 <uart_wait_tx_done+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_wait_tx_done>:
testl  $0x40,0x1a100014
je     1100 <uart_wait_tx_done>
ret

LLVM IR (-O0):
define void @uart_wait_tx_done() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i32, i32* inttoptr (i64 437256212 to i32*)
%3 = and i32 %2, 64
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @uart_wait_tx_done() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 437256212 to i32*)
%3 = and i32 %2, 64
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *strrchr(char *, char);
char *_progname(char *nargv0) {
  char *tmp;
  assert(nargv0 != NULL);
  tmp = strrchr(nargv0, '/');
  if (tmp)
    tmp++;
  else
    tmp = nargv0;
  return (tmp);
}


x86 assembly (clang, -O0):
<_progname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116c <_progname+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1174 <_progname+0x54>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_progname>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_progname(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%6 = icmp eq i8* %5, null
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = select i1 %6, i8* %0, i8* %7
ret i8* %8
}
int test_imm_CFuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xCF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CFuint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xcf,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CFuint64_lowword_mem>:
testb  $0xcf,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CFuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 207
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int read(int, char *, int);
int readchar(int fd) {
  char b;
  int i = read(fd, &b, 1);
  if (i > 0)
    return b;
  else
    return 0;
}


x86 assembly (clang, -O0):
<readchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1145 <readchar+0x35>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <readchar+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readchar>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
xor    %ecx,%ecx
test   %eax,%eax
movsbl 0x7(%rsp),%eax
cmovle %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @readchar(i32 %0) {
%2 = alloca i8
%3 = call i32 @read(i32 %0, i8* %2, i32 1)
%4 = icmp sgt i32 %3, 0
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
void write_short(FILE *fw, ushort val) { fwrite(&val, sizeof(ushort), 1, fw); }


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

x86 assembly (clang, -O2):
<write_short>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @write_short(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 = call i32 @fwrite(i32* %4, i32 4, i32 1, i32* %5)
ret void
}

LLVM IR (-O2):
define void @write_short(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
ret void
}
double elswaify_1985(double annual_pmm) {
  double result;
  result = ((annual_pmm * 0.35) + 38.5);
  return result;
}


x86 assembly (clang, -O0):
<elswaify_1985>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<elswaify_1985>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @elswaify_1985(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %4, double 3.500000e-01, double 3.850000e+01)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @elswaify_1985(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 3.500000e-01, double 3.850000e+01)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int guzinta;
  int rem;
  guzinta = 25 / 5;
  rem = 25 % 5;
  printf("5 goes into 25, %i times with remainder %i \n", guzinta, rem);
  guzinta = 25 / 7;
  rem = 25 % 7;
  printf("7 goes into 25, %i times with remainder %i \n", guzinta, rem);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xed3(%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    $0x5,%esi
xor    %edx,%edx
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"5 goes into 25, %i times with remainder %i \0A\00"
@.str.1 = [45 x i8] c"7 goes into 25, %i times with remainder %i \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
store i32 3, i32* %2
store i32 4, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"5 goes into 25, %i times with remainder %i \0A\00"
@.str.1 = [45 x i8] c"7 goes into 25, %i times with remainder %i \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 5, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 4)
ret i32 0
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d", add(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <add@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <add@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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