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

/* Variables and functions */
uint16_t udp_get_cksum(const uint8_t *p_udp) {
  return (p_udp[6] << 8) | p_udp[7];
}


x86 assembly (clang, -O0):
<udp_get_cksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x1c(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_get_cksum>:
mov    0x18(%rdi),%eax
shl    $0x8,%eax
or     0x1c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @udp_get_cksum(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 7
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @udp_get_cksum(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 7
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int get_response(char *, int);
int /*<<< orphan*/ set_nodelay_mode();
int /*<<< orphan*/ set_rc_noecho_mode();
int /*<<< orphan*/ tty_mode(int);
int main() {
  int response;
  tty_mode(0);
  set_rc_noecho_mode();
  set_nodelay_mode();
  response = get_response("Do you want another transaction?", 3);
  tty_mode(1);
  return response;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1060 <tty_mode@plt>
mov    $0x0,%al
call   1040 <set_rc_noecho_mode@plt>
mov    $0x0,%al
call   1050 <set_nodelay_mode@plt>
lea    0xe95(%rip),%rdi
mov    $0x3,%esi
call   1030 <get_response@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1060 <tty_mode@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1060 <tty_mode@plt>
xor    %eax,%eax
call   1040 <set_rc_noecho_mode@plt>
xor    %eax,%eax
call   1050 <set_nodelay_mode@plt>
lea    0xea3(%rip),%rdi
mov    $0x3,%esi
call   1030 <get_response@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1060 <tty_mode@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Do you want another transaction?\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @tty_mode(i32 0)
%4 = call i32 (...) @set_rc_noecho_mode()
%5 = call i32 (...) @set_nodelay_mode()
%6 = call i32 @get_response(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 3)
store i32 %6, i32* %2
%7 = call i32 @tty_mode(i32 1)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [33 x i8] c"Do you want another transaction?\00"
define i32 @main() {
%1 = tail call i32 @tty_mode(i32 0)
%2 = tail call i32 (...) @set_rc_noecho_mode()
%3 = tail call i32 (...) @set_nodelay_mode()
%4 = tail call i32 @get_response(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = tail call i32 @tty_mode(i32 1)
ret i32 %4
}
int intSize() {
  int intArray[10];
  int *intPtr1;
  int *intPtr2;
  intPtr1 = intArray;
  intPtr2 = intPtr1 + 1;
  return (char *)intPtr2 - (char *)intPtr1;
}


x86 assembly (clang, -O0):
<intSize>:
push   %rbp
mov    %rsp,%rbp
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @intSize() {
ret i32 4
}
int ctz(unsigned int x) {
  static const unsigned char tab[32] = {
      31, 0,  22, 1,  28, 23, 13, 2, 29, 26, 24, 17, 19, 14, 9, 3,
      30, 21, 27, 12, 25, 16, 18, 8, 20, 11, 15, 7,  10, 6,  5, 4};
  x = ((x) & (0 - (x)));
  if (x == 0)
    return 32;
  return tab[(0x0fb9ac52 * x) >> 27];
}


x86 assembly (clang, -O0):
<ctz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112a <ctz+0x2a>
movl   $0x20,-0x4(%rbp)
jmp    1146 <ctz+0x46>
imul   $0xfb9ac52,-0x8(%rbp),%eax
shr    $0x1b,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xec1(%rip),%rax
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctz>:
mov    %edi,%eax
neg    %eax
and    %edi,%eax
je     111e <ctz+0x1e>
imul   $0xfb9ac52,%eax,%eax
shr    $0x1b,%rax
lea    0xee7(%rip),%rcx
movzbl (%rax,%rcx,1),%eax
ret
mov    $0x20,%eax
ret

LLVM IR (-O0):
@ctz.tab = internal constant [32 x i8] c"\1F\00\16\01\1C\17\0D\02\1D\1A\18\11\13\0E\09\03\1E\15\1B\0C\19\10\12\08\14\0B\0F\07\0A\06\05\04"
define i32 @ctz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %3
%6 = sub i32 0, %5
%7 = and i32 %4, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 32, i32* %2
br label %19
11: ; preds = %1
%12 = load i32, i32* %3
%13 = mul i32 263826514, %12
%14 = lshr i32 %13, 27
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds [32 x i8], [32 x i8]* @ctz.tab, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
store i32 %18, i32* %2
br label %19
19: ; preds = %11, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@ctz.tab = internal unnamed_addr constant [32 x i8] c"\1F\00\16\01\1C\17\0D\02\1D\1A\18\11\13\0E\09\03\1E\15\1B\0C\19\10\12\08\14\0B\0F\07\0A\06\05\04"
define i32 @ctz(i32 %0) {
%2 = sub i32 0, %0
%3 = and i32 %2, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = mul i32 %3, 263826514
%7 = lshr i32 %6, 27
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [32 x i8], [32 x i8]* @ctz.tab, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
br label %12
12: ; preds = %1, %5
%13 = phi i32 [ %11, %5 ], [ 32, %1 ]
ret i32 %13
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isMOD(const char *comm) { return strcmp(comm, "mod") == 0; }


x86 assembly (clang, -O0):
<isMOD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isMOD>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"mod\00"
define i32 @isMOD(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"mod\00"
define i32 @isMOD(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};

/* Variables and functions */
char const *_Locale_extract_name(char const *, int *);
char const *_Locale_extract_time_name(const char *name,
                                      char *buf __attribute__((__unused__)),
                                      struct _Locale_name_hint *hint
                                      __attribute__((__unused__)),
                                      int *__err_code) {
  return _Locale_extract_name(name, __err_code);
}


x86 assembly (clang, -O0):
<_Locale_extract_time_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <_Locale_extract_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_extract_time_name>:
mov    %rcx,%rsi
jmp    1030 <_Locale_extract_name@plt>

LLVM IR (-O0):
%struct._Locale_name_hint = type { i32 }
define i8* @_Locale_extract_time_name(i8* %0, i8* %1, %struct._Locale_name_hint* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct._Locale_name_hint*
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct._Locale_name_hint* %2, %struct._Locale_name_hint** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %8
%11 = call i8* @_Locale_extract_name(i8* %9, i32* %10)
ret i8* %11
}

LLVM IR (-O2):
%struct._Locale_name_hint = type { i32 }
define i8* @_Locale_extract_time_name(i8* %0, i8* nocapture readnone %1, %struct._Locale_name_hint* nocapture readnone %2, i32* %3) {
%5 = tail call i8* @_Locale_extract_name(i8* %0, i32* %3)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct in6_addr {
  scalar_t__ s6_addr;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, scalar_t__, int);
uint16_t in6_teredo_port(const struct in6_addr *ip6) {
  uint16_t client_port;
  memcpy(&client_port, ip6->s6_addr + 10, 2);
  return ~client_port;
}


x86 assembly (clang, -O0):
<in6_teredo_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
add    $0xa,%rsi
lea    -0xc(%rbp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in6_teredo_port>:
push   %rax
mov    (%rdi),%rsi
add    $0xa,%rsi
lea    0x4(%rsp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i64 }
define i32 @in6_teredo_port(%struct.in6_addr* %0) {
%2 = alloca %struct.in6_addr*
%3 = alloca i32
store %struct.in6_addr* %0, %struct.in6_addr** %2
%4 = load %struct.in6_addr*, %struct.in6_addr** %2
%5 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %6, 10
%8 = call i32 @memcpy(i32* %3, i64 %7, i32 2)
%9 = load i32, i32* %3
%10 = xor i32 %9, -1
ret i32 %10
}

LLVM IR (-O2):
%struct.in6_addr = type { i64 }
define i32 @in6_teredo_port(%struct.in6_addr* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = add nsw i64 %5, 10
%7 = call i32 @memcpy(i32* %2, i64 %6, i32 2)
%8 = load i32, i32* %2
%9 = xor i32 %8, -1
ret i32 %9
}
int Operand_op2p1_decode(unsigned int *valp) {
  unsigned op2p1_0, op2_0;
  op2_0 = *valp & 0xf;
  op2p1_0 = op2_0 + 0x1;
  *valp = op2p1_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_op2p1_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_op2p1_decode>:
mov    (%rdi),%eax
and    $0xf,%eax
add    $0x1,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_op2p1_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 15
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = add i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_op2p1_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 15
%4 = add nuw nsw i32 %3, 1
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int munmap(void *adr, size_t size) {
  free(adr);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @munmap(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
char *xcrypt(char *, char *);
char *md_crypt(char *key, char *salt) { return (xcrypt(key, salt)); }


x86 assembly (clang, -O0):
<md_crypt>:
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 <xcrypt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md_crypt>:
jmp    1030 <xcrypt@plt>

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

LLVM IR (-O2):
define i8* @md_crypt(i8* %0, i8* %1) {
%3 = tail call i8* @xcrypt(i8* %0, i8* %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlockattr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_rwlockattr_destroy(pthread_rwlockattr_t *a) { assert(0); }


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

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

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

LLVM IR (-O2):
define i32 @pthread_rwlockattr_destroy(i32* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Type definitions */
struct ifaddrs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ifaddrs *);
void freeifaddrs_local(struct ifaddrs *ifa) { free(ifa); }


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

x86 assembly (clang, -O2):
<freeifaddrs_local>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ifaddrs = type { i32 }
define void @freeifaddrs_local(%struct.ifaddrs* %0) {
%2 = alloca %struct.ifaddrs*
store %struct.ifaddrs* %0, %struct.ifaddrs** %2
%3 = load %struct.ifaddrs*, %struct.ifaddrs** %2
%4 = call i32 @free(%struct.ifaddrs* %3)
ret void
}

LLVM IR (-O2):
%struct.ifaddrs = type { i32 }
define void @freeifaddrs_local(%struct.ifaddrs* nocapture %0) {
%2 = tail call i32 @free(%struct.ifaddrs* %0)
ret void
}
void SkipToNumber(const char **string) {
  if (string != 0) {
    const char *str = *string;
    while (*str == ' ' && *str != '\0')
      str++;
    *string = str;
  }
}


x86 assembly (clang, -O0):
<SkipToNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116f <SkipToNumber+0x6f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
jne    1143 <SkipToNumber+0x43>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1153 <SkipToNumber+0x53>
jmp    1164 <SkipToNumber+0x64>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111e <SkipToNumber+0x1e>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipToNumber>:
test   %rdi,%rdi
je     111d <SkipToNumber+0x1d>
mov    (%rdi),%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <SkipToNumber+0x10>
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @SkipToNumber(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
br label %5
5: ; preds = %5, %3
%6 = phi i8* [ %4, %3 ], [ %9, %5 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 32
%9 = getelementptr inbounds i8, i8* %6, i64 1
br i1 %8, label %5, label %10
10: ; preds = %5
store i8* %6, i8** %0
br label %11
11: ; preds = %10, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ computchar(char const);
__attribute__((weak)) long con_write(void *cookie, const char *buf,
                                     size_t size) {
  for (size_t i = 0; i < size; i++)
    computchar(buf[i]);
  return size;
}


x86 assembly (clang, -O0):
<con_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115c <con_write+0x4c>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <computchar@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <con_write+0x1c>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<con_write>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
test   %rdx,%rdx
je     1143 <con_write+0x33>
mov    %rsi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <computchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <con_write+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define weak i64 @con_write(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret i64 %2
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @computchar(i8 signext %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %2
br i1 %12, label %5, label %6
}
/* Variables and functions */
double __nv_drcp_rd(double);
double __drcp_rd(double __a) { return __nv_drcp_rd(__a); }


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

x86 assembly (clang, -O2):
<__drcp_rd>:
jmp    1030 <__nv_drcp_rd@plt>

LLVM IR (-O0):
define double @__drcp_rd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @__nv_drcp_rd(double %3)
ret double %4
}

LLVM IR (-O2):
define double @__drcp_rd(double %0) {
%2 = tail call double @__nv_drcp_rd(double %0)
ret double %2
}
int test_imm_77int64_lowword_mem(long long *val) {
  return ((*val) & (0x77 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_77int64_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, 119
%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_77int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 119
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned long djb2(char *str) {
  unsigned long hash = 5381;
  char c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1149 <djb2+0x49>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movsbq -0x11(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <djb2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb2>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <djb2+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <djb2+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @djb2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int streq(char *, char *);
int xsamefile(char *f1, char *f2) { return streq(f1, f2); }


x86 assembly (clang, -O0):
<xsamefile>:
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 <streq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsamefile>:
jmp    1030 <streq@plt>

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

LLVM IR (-O2):
define i32 @xsamefile(i8* %0, i8* %1) {
%3 = tail call i32 @streq(i8* %0, i8* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
char *Fnv1a_create_string(int /*<<< orphan*/ const);
int /*<<< orphan*/ free(char *const);
int /*<<< orphan*/ printf(char *, char *const);
void Fnv1a_print(uint32_t const inHash) {
  char *const str = Fnv1a_create_string(inHash);
  printf("%s", str);
  free(str);
}


x86 assembly (clang, -O0):
<Fnv1a_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <Fnv1a_create_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fnv1a_print>:
push   %rbx
call   1050 <Fnv1a_create_string@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @Fnv1a_print(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @Fnv1a_create_string(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @Fnv1a_print(i32 %0) {
%2 = tail call i8* @Fnv1a_create_string(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
unsigned int d(unsigned int);
bool is_amicable(unsigned int a) {
  unsigned int b = d(a);
  return a != b && a == d(b);
}


x86 assembly (clang, -O0):
<is_amicable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <d@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x9(%rbp)
je     1152 <is_amicable+0x42>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <d@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_amicable>:
push   %rbx
mov    %edi,%ebx
call   1030 <d@plt>
mov    %eax,%edi
xor    %eax,%eax
cmp    %ebx,%edi
je     112e <is_amicable+0x1e>
call   1030 <d@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_amicable(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @d(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @d(i32 %11)
%13 = icmp eq i32 %10, %12
br label %14
14: ; preds = %9, %1
%15 = phi i1 [ false, %1 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_amicable(i32 %0) {
%2 = tail call i32 @d(i32 %0)
%3 = icmp eq i32 %2, %0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @d(i32 %2)
%6 = icmp eq i32 %5, %0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct hda_codec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alc885_macpro_init_hook(struct hda_codec *);
int /*<<< orphan*/ alc_hp_automute(struct hda_codec *);
void alc885_imac24_init_hook(struct hda_codec *codec) {
  alc885_macpro_init_hook(codec);
  alc_hp_automute(codec);
}


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

x86 assembly (clang, -O2):
<alc885_imac24_init_hook>:
push   %rbx
mov    %rdi,%rbx
call   1040 <alc885_macpro_init_hook@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <alc_hp_automute@plt>

LLVM IR (-O0):
%struct.hda_codec = type { i32 }
define void @alc885_imac24_init_hook(%struct.hda_codec* %0) {
%2 = alloca %struct.hda_codec*
store %struct.hda_codec* %0, %struct.hda_codec** %2
%3 = load %struct.hda_codec*, %struct.hda_codec** %2
%4 = call i32 @alc885_macpro_init_hook(%struct.hda_codec* %3)
%5 = load %struct.hda_codec*, %struct.hda_codec** %2
%6 = call i32 @alc_hp_automute(%struct.hda_codec* %5)
ret void
}

LLVM IR (-O2):
%struct.hda_codec = type { i32 }
define void @alc885_imac24_init_hook(%struct.hda_codec* %0) {
%2 = tail call i32 @alc885_macpro_init_hook(%struct.hda_codec* %0)
%3 = tail call i32 @alc_hp_automute(%struct.hda_codec* %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ nrerror(char *);
double *vector(int nl, int nh) {
  double *v;
  v = (double *)malloc((unsigned)(nh - nl + 1) * sizeof(double));
  if (!v)
    nrerror("allocation failure in vector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <vector+0x3f>
lea    0xea6(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x8(,%rsi,8),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <vector+0x27>
lea    0xebe(%rip),%rdi
call   1030 <nrerror@plt>
movslq %ebp,%rax
shl    $0x3,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"allocation failure in vector()\00"
define double* @vector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to double*
store double* %14, double** %5
%15 = load double*, double** %5
%16 = icmp ne double* %15, null
br i1 %16, label %19, label %17
17: ; preds = %2
%18 = call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
%20 = load double*, double** %5
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = sub i64 0, %22
%24 = getelementptr inbounds double, double* %20, i64 %23
ret double* %24
}

LLVM IR (-O2):
@.str = [31 x i8] c"allocation failure in vector()\00"
define double* @vector(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl i32 %3, 3
%5 = add i32 %4, 8
%6 = tail call i64 @malloc(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to double*
%12 = sext i32 %0 to i64
%13 = sub nsw i64 0, %12
%14 = getelementptr inbounds double, double* %11, i64 %13
ret double* %14
}
/* Variables and functions */
int /*<<< orphan*/ isLeapYear(int);
int monthLength(int month, int year) {
  switch (month) {
  case 4:
  case 6:
  case 9:
  case 11:
    return 30;
  case 2:
    return 28 + isLeapYear(year);
  default:
    return 31;
  }
}


x86 assembly (clang, -O0):
<monthLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x2,%eax
je     1182 <monthLength+0x72>
jmp    1132 <monthLength+0x22>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     1176 <monthLength+0x66>
jmp    1143 <monthLength+0x33>
mov    -0x10(%rbp),%eax
sub    $0x6,%eax
je     1176 <monthLength+0x66>
jmp    1154 <monthLength+0x44>
mov    -0x10(%rbp),%eax
sub    $0x9,%eax
je     1176 <monthLength+0x66>
jmp    1165 <monthLength+0x55>
mov    -0x10(%rbp),%eax
sub    $0xb,%eax
jne    1195 <monthLength+0x85>
jmp    1176 <monthLength+0x66>
movl   $0x1e,-0x4(%rbp)
jmp    119c <monthLength+0x8c>
mov    -0xc(%rbp),%edi
call   1030 <isLeapYear@plt>
add    $0x1c,%eax
mov    %eax,-0x4(%rbp)
jmp    119c <monthLength+0x8c>
movl   $0x1f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monthLength>:
cmp    $0xb,%edi
ja     113a <monthLength+0x2a>
mov    $0x1e,%eax
mov    $0xa50,%ecx
bt     %edi,%ecx
jae    1125 <monthLength+0x15>
ret
cmp    $0x2,%edi
jne    113a <monthLength+0x2a>
push   %rax
mov    %esi,%edi
call   1030 <isLeapYear@plt>
add    $0x1c,%eax
add    $0x8,%rsp
ret
mov    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @monthLength(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
switch i32 %6, label %12 [
i32 4, label %7
i32 6, label %7
i32 9, label %7
i32 11, label %7
i32 2, label %8
]
7: ; preds = %2, %2, %2, %2
store i32 30, i32* %3
br label %13
8: ; preds = %2
%9 = load i32, i32* %5
%10 = call i32 @isLeapYear(i32 %9)
%11 = add nsw i32 28, %10
store i32 %11, i32* %3
br label %13
12: ; preds = %2
store i32 31, i32* %3
br label %13
13: ; preds = %12, %8, %7
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @monthLength(i32 %0, i32 %1) {
switch i32 %0, label %6 [
i32 4, label %7
i32 6, label %7
i32 9, label %7
i32 11, label %7
i32 2, label %3
]
3: ; preds = %2
%4 = tail call i32 @isLeapYear(i32 %1)
%5 = add nsw i32 %4, 28
br label %7
6: ; preds = %2
br label %7
7: ; preds = %2, %2, %2, %2, %6, %3
%8 = phi i32 [ 31, %6 ], [ %5, %3 ], [ 30, %2 ], [ 30, %2 ], [ 30, %2 ], [ 30, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ arg_ulonglong2(unsigned long long, unsigned long long);
void arg_ulonglong1(unsigned long long i) { arg_ulonglong2(i, i + 1); }


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

x86 assembly (clang, -O2):
<arg_ulonglong1>:
lea    0x1(%rdi),%rsi
jmp    1030 <arg_ulonglong2@plt>

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

LLVM IR (-O2):
define void @arg_ulonglong1(i64 %0) {
%2 = add i64 %0, 1
%3 = tail call i32 @arg_ulonglong2(i64 %0, i64 %2)
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
struct list *list_next(struct list const *, struct list const *);
struct list *list_head(const struct list *list) {
  return list_next(list, list);
}


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

x86 assembly (clang, -O2):
<list_head>:
mov    %rdi,%rsi
jmp    1030 <list_next@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @list_head(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
%4 = load %struct.list*, %struct.list** %2
%5 = call %struct.list* @list_next(%struct.list* %3, %struct.list* %4)
ret %struct.list* %5
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @list_head(%struct.list* %0) {
%2 = tail call %struct.list* @list_next(%struct.list* %0, %struct.list* %0)
ret %struct.list* %2
}
/* Variables and functions */
short *BGBMID_LoadWAV_RateStereo16(char const *, int *, int);
short *BGBMID_LoadWAV_11Stereo16(const char *name, int *rlen) {
  return (BGBMID_LoadWAV_RateStereo16(name, rlen, 11025));
}


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

x86 assembly (clang, -O2):
<BGBMID_LoadWAV_11Stereo16>:
mov    $0x2b11,%edx
jmp    1030 <BGBMID_LoadWAV_RateStereo16@plt>

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

LLVM IR (-O2):
define i16* @BGBMID_LoadWAV_11Stereo16(i8* %0, i32* %1) {
%3 = tail call i16* @BGBMID_LoadWAV_RateStereo16(i8* %0, i32* %1, i32 11025)
ret i16* %3
}
/* Variables and functions */
char getchar();
void clear_s(void) {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<clear_s>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <clear_s+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <clear_s+0x21>
jmp    1119 <clear_s+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_s>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clear_s+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @clear_s() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @clear_s() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ read_be32(int /*<<< orphan*/ const *);
uint32_t read_at_be32(const void *src, size_t offset) {
  const uint8_t *s = src;
  s += offset;
  return read_be32(s);
}


x86 assembly (clang, -O0):
<read_at_be32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <read_be32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_at_be32>:
lea    (%rdi,%rsi,4),%rdi
jmp    1030 <read_be32@plt>

LLVM IR (-O0):
define i32 @read_at_be32(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i64, i64* %4
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 %8
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = call i32 @read_be32(i32* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @read_at_be32(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to i32*
%4 = getelementptr inbounds i32, i32* %3, i64 %1
%5 = tail call i32 @read_be32(i32* %4)
ret i32 %5
}
int hash_code(int key) { return key % 32; }


x86 assembly (clang, -O0):
<hash_code>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_code>:
mov    %edi,%eax
lea    0x1f(%rax),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0xffffffe0,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash_code(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 32
ret i32 %4
}

LLVM IR (-O2):
define i32 @hash_code(i32 %0) {
%2 = srem i32 %0, 32
ret i32 %2
}
void rop3_35_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T & stk3;
  stk1 = S | stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_35_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_35_0_0>:
mov    (%rdi),%al
not    %al
and    %dl,%al
or     %sil,%al
not    %al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_35_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = load i8*, i8** %4
store i8 %31, i8* %32
ret void
}

LLVM IR (-O2):
define void @rop3_35_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = and i8 %5, %2
%7 = or i8 %6, %1
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getcwd(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ isatty(int /*<<< orphan*/);
int /*<<< orphan*/ mkdir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ readdir(int /*<<< orphan*/);
int /*<<< orphan*/ utime(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void nullPointer(char *p) {
  isatty(0);
  mkdir(p, 0);
  getcwd(0, 0);
  readdir(0);
  utime(NULL, NULL);
}


x86 assembly (clang, -O0):
<nullPointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1050 <isatty@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <mkdir@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1060 <getcwd@plt>
xor    %edi,%edi
call   1070 <readdir@plt>
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <utime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullPointer>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1050 <isatty@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <mkdir@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <getcwd@plt>
xor    %edi,%edi
call   1070 <readdir@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <utime@plt>

LLVM IR (-O0):
define void @nullPointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @isatty(i32 0)
%4 = load i8*, i8** %2
%5 = call i32 @mkdir(i8* %4, i32 0)
%6 = call i32 @getcwd(i32 0, i32 0)
%7 = call i32 @readdir(i32 0)
%8 = call i32 @utime(i32* null, i32* null)
ret void
}

LLVM IR (-O2):
define void @nullPointer(i8* nocapture %0) {
%2 = tail call i32 @isatty(i32 0)
%3 = tail call i32 @mkdir(i8* %0, i32 0)
%4 = tail call i32 @getcwd(i32 0, i32 0)
%5 = tail call i32 @readdir(i32 0)
%6 = tail call i32 @utime(i32* null, i32* null)
ret void
}
void deallocMemcache() {}


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

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

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

LLVM IR (-O2):
define void @deallocMemcache() {
ret void
}
char *u_strsave(str)
char *str;
{
  int len;
  char *p;
  len = strlen(str);
  p = u_malloc(len + 1);
  strcpy(p, str);
  return (p);
}


x86 assembly (clang, -O0):
<u_strsave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    $0x0,%al
call   1040 <u_malloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_strsave>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
xor    %eax,%eax
call   1040 <u_malloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @u_strsave(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = call i32 (i32, ...) bitcast (i32 (...)* @u_malloc to i32 (i32, ...)*)(i32 %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %2
%15 = call i8* @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @u_strsave(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add nsw i32 %3, 1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @u_malloc to i32 (i32, ...)*)(i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = tail call i8* @strcpy(i8* dereferenceable(1) %7, i8* dereferenceable(1) %0)
ret i8* %7
}
int do_324() { return 324; }


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

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

LLVM IR (-O0):
define i32 @do_324() {
ret i32 324
}

LLVM IR (-O2):
define i32 @do_324() {
ret i32 324
}
void sh_hup(int s) {}


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

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

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

LLVM IR (-O2):
define void @sh_hup(i32 %0) {
ret void
}