xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_dobldobl_size_limit(int k, int *szl) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(601, &k, szl, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_dobldobl_size_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x259,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_dobldobl_size_limit>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x259,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @syscon_dobldobl_size_limit(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 601, i32* %3, i32* %1, double* undef)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_app_banner();
int /*<<< orphan*/ print_app_usage();
int /*<<< orphan*/ printf(char *, char *, char *);
void error(char *err_msg, char *err_func) {
  printf("\n%s ::: => %s\n", err_func, err_msg);
  print_app_banner();
  print_app_usage();
  exit(0);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <print_app_banner@plt>
mov    $0x0,%al
call   1040 <print_app_usage@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <print_app_banner@plt>
xor    %eax,%eax
call   1040 <print_app_usage@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\0A%s ::: => %s\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 (...) @print_app_banner()
%9 = call i32 (...) @print_app_usage()
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0A%s ::: => %s\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
%4 = tail call i32 (...) @print_app_banner()
%5 = tail call i32 (...) @print_app_usage()
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *get_current_dir_name();
int /*<<< orphan*/ printf(char *, char *);
int pwd_cmd(int argc __attribute__((unused)),
            char **argv __attribute__((unused))) {
  char *pwd = get_current_dir_name();
  printf("%s\n", pwd);
  free(pwd);
  return 0;
}


x86 assembly (clang, -O0):
<pwd_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <get_current_dir_name@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwd_cmd>:
push   %rbx
xor    %eax,%eax
call   1050 <get_current_dir_name@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @pwd_cmd(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @get_current_dir_name()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 0
}
int f5(int x, int y) {
  if (y >= -1)
    __builtin_unreachable();
  return x % -y;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jl     1114 <f5+0x14>
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %edi,%eax
neg    %esi
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f5(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 = icmp sge i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %2
unreachable
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 0, %10
%12 = srem i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f5(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, -1
tail call void @llvm.assume(i1 %3)
%4 = sub nsw i32 0, %1
%5 = srem i32 %0, %4
ret i32 %5
}
/* Variables and functions */
int filesPerLine(int);
int goesIntoNum(int, int, int /*<<< orphan*/);
int getFileLine(int Pos, int scrx) {
  int lineFiles = filesPerLine(scrx);
  int rtrnval = goesIntoNum(Pos, lineFiles, 0);
  if ((Pos % lineFiles) != 0)
    ++rtrnval;
  return rtrnval;
}


x86 assembly (clang, -O0):
<getFileLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <filesPerLine@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <goesIntoNum@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1162 <getFileLine+0x42>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileLine>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <filesPerLine@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <goesIntoNum@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ebp
cmp    $0x1,%edx
sbb    $0xffffffff,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getFileLine(i32 %0, i32 %1) {
%3 = tail call i32 @filesPerLine(i32 %1)
%4 = tail call i32 @goesIntoNum(i32 %0, i32 %3, i32 0)
%5 = srem i32 %0, %3
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
%8 = add nsw i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ post(char *, char *, char *, char *);
void version(void) {
  post("%s version %s, compiled %s", "dynss~", "2.01", "9.02.07");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef9(%rip),%rsi
lea    0xef9(%rip),%rdx
lea    0xef7(%rip),%rcx
call   1030 <post@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
lea    0xefd(%rip),%rsi
lea    0xefd(%rip),%rdx
lea    0xefb(%rip),%rcx
jmp    1030 <post@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%s version %s, compiled %s\00"
@.str.1 = [7 x i8] c"dynss~\00"
@.str.2 = [5 x i8] c"2.01\00"
@.str.3 = [8 x i8] c"9.02.07\00"
define void @version() {
%1 = call i32 @post(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s version %s, compiled %s\00"
@.str.1 = [7 x i8] c"dynss~\00"
@.str.2 = [5 x i8] c"2.01\00"
@.str.3 = [8 x i8] c"9.02.07\00"
define void @version() {
%1 = tail call i32 @post(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int _sub2(int src1, int src2) {
  short s1[2], s2[2], r[2];
  int result;
  *((int *)s1) = src1;
  *((int *)s2) = src2;
  r[0] = s1[0] - s2[0];
  r[1] = s1[1] - s2[1];
  result = *(int *)r;
  return result;
}


x86 assembly (clang, -O0):
<_sub2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movswl -0xc(%rbp),%eax
movswl -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,-0x14(%rbp)
movswl -0xa(%rbp),%eax
movswl -0xe(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,-0x12(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sub2>:
mov    %edi,%eax
sub    %esi,%eax
and    $0xffff0000,%esi
sub    %esi,%edi
and    $0xffff0000,%edi
movzwl %ax,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @_sub2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i16]
%6 = alloca [2 x i16]
%7 = alloca [2 x i16]
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%11 = bitcast i16* %10 to i32*
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 0
%14 = bitcast i16* %13 to i32*
store i32 %12, i32* %14
%15 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%16 = load i16, i16* %15
%17 = sext i16 %16 to i32
%18 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 0
%19 = load i16, i16* %18
%20 = sext i16 %19 to i32
%21 = sub nsw i32 %17, %20
%22 = trunc i32 %21 to i16
%23 = getelementptr inbounds [2 x i16], [2 x i16]* %7, i64 0, i64 0
store i16 %22, i16* %23
%24 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 1
%25 = load i16, i16* %24
%26 = sext i16 %25 to i32
%27 = getelementptr inbounds [2 x i16], [2 x i16]* %6, i64 0, i64 1
%28 = load i16, i16* %27
%29 = sext i16 %28 to i32
%30 = sub nsw i32 %26, %29
%31 = trunc i32 %30 to i16
%32 = getelementptr inbounds [2 x i16], [2 x i16]* %7, i64 0, i64 1
store i16 %31, i16* %32
%33 = getelementptr inbounds [2 x i16], [2 x i16]* %7, i64 0, i64 0
%34 = bitcast i16* %33 to i32*
%35 = load i32, i32* %34
store i32 %35, i32* %8
%36 = load i32, i32* %8
ret i32 %36
}

LLVM IR (-O2):
define i32 @_sub2(i32 %0, i32 %1) {
%3 = sub i32 %0, %1
%4 = and i32 %1, -65536
%5 = sub i32 %0, %4
%6 = and i32 %5, -65536
%7 = and i32 %3, 65535
%8 = or i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int log(int);
int internal_log_i(int value) { return log(value); }


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

x86 assembly (clang, -O2):
<internal_log_i>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define i32 @internal_log_i(i32 %0) {
%2 = tail call i32 @log(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
struct packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int const *, int);
int pdu_eth(struct packet *, int *, int const *, int);
int pdu_eth_ipv6_mcast(struct packet *p, const uint8_t *dst,
                       const uint8_t *src) {
  uint8_t dst_addr[6];
  dst_addr[0] = 0x33;
  dst_addr[1] = 0x33;
  memcpy(&dst_addr[2], &dst[12], 4);
  return pdu_eth(p, dst_addr, src, 0x86dd);
}


x86 assembly (clang, -O0):
<pdu_eth_ipv6_mcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x33,-0x30(%rbp)
movl   $0x33,-0x2c(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
add    $0x30,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x86dd,%ecx
call   1030 <pdu_eth@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_eth_ipv6_mcast>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
movabs $0x3300000033,%rax
mov    %rax,(%rsp)
lea    0x8(%rsp),%rdi
add    $0x30,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    $0x86dd,%ecx
call   1030 <pdu_eth@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.packet = type { i32 }
define i32 @pdu_eth_ipv6_mcast(%struct.packet* %0, i32* %1, i32* %2) {
%4 = alloca %struct.packet*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [6 x i32]
store %struct.packet* %0, %struct.packet** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 0
store i32 51, i32* %8
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 1
store i32 51, i32* %9
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 2
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 12
%13 = call i32 @memcpy(i32* %10, i32* %12, i32 4)
%14 = load %struct.packet*, %struct.packet** %4
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 0
%16 = load i32*, i32** %6
%17 = call i32 @pdu_eth(%struct.packet* %14, i32* %15, i32* %16, i32 34525)
ret i32 %17
}

LLVM IR (-O2):
%struct.packet = type { i32 }
define i32 @pdu_eth_ipv6_mcast(%struct.packet* %0, i32* %1, i32* %2) {
%4 = alloca [6 x i32]
%5 = bitcast [6 x i32]* %4 to i8*
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 0
store i32 51, i32* %6
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 1
store i32 51, i32* %7
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 2
%9 = getelementptr inbounds i32, i32* %1, i64 12
%10 = call i32 @memcpy(i32* %8, i32* %9, i32 4)
%11 = call i32 @pdu_eth(%struct.packet* %0, i32* %6, i32* %2, i32 34525)
ret i32 %11
}
void foo() { static int l0 __attribute__((retain)) = 2; }


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

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

LLVM IR (-O0):
@foo.l0 = internal global i32 2
@llvm.used = appending global [1 x i8*] [i8* bitcast (i32* @foo.l0 to i8*)], section "llvm.metadata"
define void @foo() {
ret void
}

LLVM IR (-O2):
@foo.l0 = internal global i32 2
@llvm.used = appending global [1 x i8*] [i8* bitcast (i32* @foo.l0 to i8*)], section "llvm.metadata"
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ null_deref(int /*<<< orphan*/);
void test1() { null_deref(0); }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <null_deref@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test1() {
%1 = call i32 @null_deref(i32 0)
ret void
}

LLVM IR (-O2):
define void @test1() {
%1 = tail call i32 @null_deref(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int /*<<< orphan*/, int);
int /*<<< orphan*/ rotate_pi(int);
void rotate_pi_test(void **state) {
  assert_int_equal(rotate_pi(0x0202020202020202ul | 0x0000FF0000000000ul),
                   0x4040404040404040ul | 0x0000000000FF0000ul);
}


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

x86 assembly (clang, -O2):
<rotate_pi_test>:
push   %rax
mov    $0x2020202,%edi
call   1030 <rotate_pi@plt>
mov    %eax,%edi
mov    $0x40ff4040,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @rotate_pi_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @rotate_pi(i32 33686018)
%4 = call i32 @assert_int_equal(i32 %3, i32 1090469952)
ret void
}

LLVM IR (-O2):
define void @rotate_pi_test(i8** nocapture readnone %0) {
%2 = tail call i32 @rotate_pi(i32 33686018)
%3 = tail call i32 @assert_int_equal(i32 %2, i32 1090469952)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clearscreen(void) {
  int c, d;
  for (c = 0; c <= 100; c++) {
    for (d = 0; d <= 200; d++) {
      printf(" ");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<clearscreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jg     1171 <clearscreen+0x61>
movl   $0x0,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jg     1157 <clearscreen+0x47>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <clearscreen+0x20>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <clearscreen+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearscreen>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xc9,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1130 <clearscreen+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
jne    1120 <clearscreen+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @clearscreen() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 0, %0 ], [ %10, %8 ]
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %6, %3 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 201
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @putchar(i32 10)
%10 = add nuw nsw i32 %2, 1
%11 = icmp eq i32 %10, 101
br i1 %11, label %12, label %1
12: ; preds = %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printErr_s(char *error) { printf("Error: %s", error); }


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

x86 assembly (clang, -O2):
<printErr_s>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Error: %s\00"
define void @printErr_s(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Error: %s\00"
define void @printErr_s(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void deep() {}


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

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

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

LLVM IR (-O2):
define void @deep() {
ret void
}
int test_imm_21uint16_mem(unsigned short *val) {
  return ((*val) & (-0x21 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_21uint16_mem>:
movzwl (%rdi),%eax
test   $0xffdf,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_21uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -33
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int bar(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @bar() {
ret i32 42
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 42
}
int test_imm_7Cint8_mem(signed char *val) {
  return ((*val) & (-0x7C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Cint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -124
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float __attribute__((const)) cargf(float _Complex _Z) {
  float res;
  __asm__("fpatan;" : "=t"(res) : "0"(__real__ _Z), "u"(__imag__ _Z) : "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<cargf>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  %xmm1,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
flds   -0x10(%rbp)
flds   -0x14(%rbp)
fxch   %st(1)
fpatan
fstps  -0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cargf>:
movss  %xmm0,-0x8(%rsp)
shufps $0x55,%xmm0,%xmm0
movss  %xmm0,-0x4(%rsp)
flds   -0x8(%rsp)
flds   -0x4(%rsp)
fxch   %st(1)
fpatan
fstps  -0xc(%rsp)
movss  -0xc(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @cargf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca float
%4 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %4
%5 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%6 = load float, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%8 = load float, float* %7
%9 = call float asm "fpatan;", "={st},0,{st(1)},~{st(1)},~{dirflag},~{fpsr},~{flags}"(float %6, float %8)
store float %9, float* %3
%10 = load float, float* %3
ret float %10
}

LLVM IR (-O2):
define float @cargf(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 0
%3 = extractelement <2 x float> %0, i64 1
%4 = tail call float asm "fpatan;", "={st},0,{st(1)},~{st(1)},~{dirflag},~{fpsr},~{flags}"(float %2, float %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR98_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR98_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMR98_swap(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 i32 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMR98_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
unsigned long USHRT_MAX;
int /*<<< orphan*/ printf(char *, unsigned long);
unsigned int longToUShort(unsigned long makeMeAUShort) {
  if (makeMeAUShort > USHRT_MAX) {
    printf("%ld is out of ushort range\n", makeMeAUShort);
    return !makeMeAUShort;
  }
  return (unsigned int)makeMeAUShort;
}


x86 assembly (clang, -O0):
<longToUShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ec1(%rip),%rcx
cmp    (%rcx),%rax
jbe    1157 <longToUShort+0x47>
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    115e <longToUShort+0x4e>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<longToUShort>:
push   %rax
mov    %rdi,%rax
mov    0x2ecd(%rip),%rcx
cmp    %rdi,(%rcx)
jae    1131 <longToUShort+0x21>
lea    0xed9(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@USHRT_MAX = global i64 0
@.str = [28 x i8] c"%ld is out of ushort range\0A\00"
define i32 @longToUShort(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = load i64, i64* @USHRT_MAX
%6 = icmp ugt i64 %4, %5
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i64, i64* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = load i64, i64* %3
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
store i32 %13, i32* %2
br label %17
14: ; preds = %1
%15 = load i64, i64* %3
%16 = trunc i64 %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@USHRT_MAX = global i64 0
@.str = [28 x i8] c"%ld is out of ushort range\0A\00"
define i32 @longToUShort(i64 %0) {
%2 = load i64, i64* @USHRT_MAX
%3 = icmp ult i64 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %8
6: ; preds = %1
%7 = trunc i64 %0 to i32
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 0, %4 ], [ %7, %6 ]
ret i32 %9
}
int test_imm_EFint8_reg(signed char val) {
  return ((val) & (-0xEF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EFint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff11,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EFint8_reg>:
test   $0xffffff11,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EFint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -239
%6 = icmp ne i32 %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_EFint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -239
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ integerAtmt(char *);
scalar_t__ strcmp(char *, char *);
int isNum(char *str) {
  if ((integerAtmt(str) == 0) || (strcmp(str, "Vrai") == 0) ||
      (strcmp(str, "Faux") == 0)) {
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<isNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <integerAtmt@plt>
cmp    $0x0,%rax
je     1173 <isNum+0x53>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1173 <isNum+0x53>
mov    -0x10(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    117f <isNum+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    1186 <isNum+0x66>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNum>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <integerAtmt@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     115a <isNum+0x3a>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     115a <isNum+0x3a>
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
neg    %rax
sbb    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"Vrai\00"
@.str.1 = [5 x i8] c"Faux\00"
define i32 @isNum(i8* %0) {
%2 = tail call i64 @integerAtmt(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
%10 = sext i1 %9 to i32
br label %11
11: ; preds = %7, %1, %4
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
void *alloc_fun(int);
void *ce_intrn_alloc_msg_space(int size) { return alloc_fun(size); }


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

x86 assembly (clang, -O2):
<ce_intrn_alloc_msg_space>:
jmp    1030 <alloc_fun@plt>

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

LLVM IR (-O2):
define i8* @ce_intrn_alloc_msg_space(i32 %0) {
%2 = tail call i8* @alloc_fun(i32 %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double glmRandomNumberd(double min, double max) {
  return min + (max - min) * rand() / (double)RAND_MAX;
}


x86 assembly (clang, -O0):
<glmRandomNumberd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
mov    0x2e8e(%rip),%rax
cvtsi2sdq (%rax),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmRandomNumberd>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mulsd  0x8(%rsp),%xmm0
mov    0x2eb0(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @glmRandomNumberd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = call double (...) @rand()
%10 = fmul double %8, %9
%11 = load i64, i64* @RAND_MAX
%12 = sitofp i64 %11 to double
%13 = fdiv double %10, %12
%14 = fadd double %5, %13
ret double %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @glmRandomNumberd(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call double (...) @rand()
%5 = fmul double %3, %4
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fdiv double %5, %7
%9 = fadd double %8, %0
ret double %9
}
int numdigit(int number) {
  int cnt = 1;
  if (number < 0)
    ++cnt;
  while ((number /= 10) != 0)
    ++cnt;
  return cnt;
}


x86 assembly (clang, -O0):
<numdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1121 <numdigit+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <numdigit+0x26>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     114b <numdigit+0x4b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <numdigit+0x26>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numdigit>:
mov    %edi,%eax
shr    $0x1f,%eax
add    $0x1,%eax
lea    0x9(%rdi),%ecx
cmp    $0x13,%ecx
jb     1135 <numdigit+0x35>
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%edi
add    $0x1,%eax
add    %edx,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <numdigit+0x10>
ret

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

LLVM IR (-O2):
define i32 @numdigit(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 2, i32 1
%4 = add i32 %0, 9
%5 = icmp ult i32 %4, 19
br i1 %5, label %13, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %10, %6 ], [ %3, %1 ]
%8 = phi i32 [ %9, %6 ], [ %0, %1 ]
%9 = sdiv i32 %8, 10
%10 = add nuw nsw i32 %7, 1
%11 = add nsw i32 %9, 9
%12 = icmp ult i32 %11, 19
br i1 %12, label %13, label %6
13: ; preds = %6, %1
%14 = phi i32 [ %3, %1 ], [ %10, %6 ]
ret i32 %14
}
int test_imm_EBint8_reg(signed char val) {
  return ((val) & (-0xEB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EBint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff15,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EBint8_reg>:
test   $0xffffff15,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EBint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -235
%6 = icmp ne i32 %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_EBint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -235
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
cvCreateImage() { printf("create()\n"); }


x86 assembly (clang, -O0):
<cvCreateImage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"create()\0A\00"
define i32 @cvCreateImage() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [9 x i8] c"create()\00"
define i32 @cvCreateImage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ decompte_zone(void *, size_t, int);
int /*<<< orphan*/ printf(char *, char *, unsigned long, unsigned long);
void afficher_zone(void *adresse, size_t taille, int free) {
  decompte_zone(adresse, taille, free);
  printf("Zone %s, Adresse : %lx, Taille : %lu\n", free ? "libre" : "occupée",
         (unsigned long)adresse, (unsigned long)taille);
}


x86 assembly (clang, -O0):
<afficher_zone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <decompte_zone@plt>
mov    -0x14(%rbp),%ecx
lea    0xedf(%rip),%rsi
lea    0xed2(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficher_zone>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <decompte_zone@plt>
test   %ebx,%ebx
lea    0xef1(%rip),%rax
lea    0xee4(%rip),%rsi
cmove  %rax,%rsi
lea    0xeb3(%rip),%rdi
mov    %r15,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Zone %s, Adresse : %lx, Taille : %lu\0A\00"
@.str.1 = [6 x i8] c"libre\00"
@.str.2 = [9 x i8] c"occup\C3\A9e\00"
define void @afficher_zone(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @decompte_zone(i8* %7, i64 %8, i32 %9)
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%15 = load i8*, i8** %4
%16 = ptrtoint i8* %15 to i64
%17 = load i64, i64* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %14, i64 %16, i64 %17)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Zone %s, Adresse : %lx, Taille : %lu\0A\00"
@.str.1 = [6 x i8] c"libre\00"
@.str.2 = [9 x i8] c"occup\C3\A9e\00"
define void @afficher_zone(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @decompte_zone(i8* %0, i64 %1, i32 %2)
%5 = icmp eq i32 %2, 0
%6 = select i1 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%7 = ptrtoint i8* %0 to i64
%8 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %6, i64 %7, i64 %1)
ret void
}
int readsnumf(s)
char *s;
{
  char *p;
  p = s;
  if (*p == '-') {
    p = p + 1;
    skipspace(&p);
    return (-readnumf(p));
  } else {
    return (readnumf(p));
  }
}


x86 assembly (clang, -O0):
<readsnumf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1174 <readsnumf+0x54>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <skipspace@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <readnumf@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1182 <readsnumf+0x62>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <readnumf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readsnumf>:
push   %rax
cmpb   $0x2d,(%rdi)
jne    1147 <readsnumf+0x27>
add    $0x1,%rdi
mov    %rdi,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <skipspace@plt>
mov    (%rsp),%rdi
xor    %eax,%eax
call   1030 <readnumf@plt>
neg    %eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <readnumf@plt>

LLVM IR (-O0):
define i32 @readsnumf(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %10, label %17
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8* %12, i8** %4
%13 = call i32 (i8**, ...) bitcast (i32 (...)* @skipspace to i32 (i8**, ...)*)(i8** %4)
%14 = load i8*, i8** %4
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @readnumf to i32 (i8*, ...)*)(i8* %14)
%16 = sub nsw i32 0, %15
store i32 %16, i32* %2
br label %20
17: ; preds = %1
%18 = load i8*, i8** %4
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @readnumf to i32 (i8*, ...)*)(i8* %18)
store i32 %19, i32* %2
br label %20
20: ; preds = %17, %10
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @readsnumf(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 45
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8* %7, i8** %2
%8 = call i32 (i8**, ...) bitcast (i32 (...)* @skipspace to i32 (i8**, ...)*)(i8** %2)
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @readnumf to i32 (i8*, ...)*)(i8* %9)
%11 = sub nsw i32 0, %10
br label %14
12: ; preds = %1
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @readnumf to i32 (i8*, ...)*)(i8* %0)
br label %14
14: ; preds = %12, %6
%15 = phi i32 [ %11, %6 ], [ %13, %12 ]
ret i32 %15
}
/* Variables and functions */
int mm_support();
extern int xmmx_ok(void) { return ((mm_support() & 0x2) >> 1); }


x86 assembly (clang, -O0):
<xmmx_ok>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mm_support@plt>
and    $0x2,%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmmx_ok>:
push   %rax
xor    %eax,%eax
call   1030 <mm_support@plt>
shr    %eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xmmx_ok() {
%1 = call i32 (...) @mm_support()
%2 = and i32 %1, 2
%3 = ashr i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @xmmx_ok() {
%1 = tail call i32 (...) @mm_support()
%2 = lshr i32 %1, 1
%3 = and i32 %2, 1
ret i32 %3
}
int f_bgt_cr1(float a1) { return (__builtin_isgreater(100, a1)); }


x86 assembly (clang, -O0):
<f_bgt_cr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bgt_cr1>:
movss  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @f_bgt_cr1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_bgt_cr1(float %0) {
%2 = fcmp olt float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
float __nv_fsub_rz(float, float);
float __fsub_rz(float __a, float __b) { return __nv_fsub_rz(__a, __b); }


x86 assembly (clang, -O0):
<__fsub_rz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__nv_fsub_rz@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fsub_rz>:
jmp    1030 <__nv_fsub_rz@plt>

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

LLVM IR (-O2):
define float @__fsub_rz(float %0, float %1) {
%3 = tail call float @__nv_fsub_rz(float %0, float %1)
ret float %3
}