xunge/DecIR huggingface dataset:
int test_imm_49uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x49 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_49uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 73
%7 = icmp ne i64 %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_49uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 313532612608
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *wPopString();
int /*<<< orphan*/ wPushNumber(char);
void wBasAsc() {
  char *string;
  string = wPopString();
  wPushNumber(string[0]);
  free(string);
}


x86 assembly (clang, -O0):
<wBasAsc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1050 <wPushNumber@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasAsc>:
push   %rbx
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%rbx
movsbl (%rax),%edi
call   1050 <wPushNumber@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @wBasAsc() {
%1 = alloca i8*
%2 = call i8* (...) @wPopString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @wPushNumber(i8 signext %5)
%7 = load i8*, i8** %1
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @wBasAsc() {
%1 = tail call i8* (...) @wPopString()
%2 = load i8, i8* %1
%3 = tail call i32 @wPushNumber(i8 signext %2)
%4 = tail call i32 @free(i8* %1)
ret void
}
void __DELETE_java_io_ObjectStreamException(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_io_ObjectStreamException(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_io_ObjectStreamException(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int i2c_setup() {
  int device;
  if ((device = open("/dev/i2c-1", O_RDWR)) < 0)
    return -1;
  return device;
}


x86 assembly (clang, -O0):
<i2c_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xed8(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1145 <i2c_setup+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114b <i2c_setup+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_setup>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <open@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/i2c-1\00"
@O_RDWR = global i32 0
define i32 @i2c_setup() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDWR
%4 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %9
7: ; preds = %0
%8 = load i32, i32* %2
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/i2c-1\00"
@O_RDWR = global i32 0
define i32 @i2c_setup() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp sgt i32 %2, -1
%4 = select i1 %3, i32 %2, i32 -1
ret i32 %4
}
/* Variables and functions */
char *MA_Malloc(long, char const *, char const *, long);
int /*<<< orphan*/ memcpy(char *, char const *, long);
char *MA_CopyString1(const char *cp, long len, const char *r, const char *fn,
                     long ln) {
  char *p = MA_Malloc(len + 1, r, fn, ln);
  if (len)
    memcpy(p, cp, len);
  p[len] = '\0';
  return p;
}


x86 assembly (clang, -O0):
<MA_CopyString1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <MA_Malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1175 <MA_CopyString1+0x55>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MA_CopyString1>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
call   1030 <MA_Malloc@plt>
mov    %rax,%r15
test   %rbx,%rbx
je     1153 <MA_CopyString1+0x33>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%r15,%rbx,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @MA_CopyString1(i8* %0, i64 %1, i8* %2, i8* %3, i64 %4) {
%6 = add nsw i64 %1, 1
%7 = tail call i8* @MA_Malloc(i64 %6, i8* %2, i8* %3, i64 %4)
%8 = icmp eq i64 %1, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @memcpy(i8* %7, i8* %0, i64 %1)
br label %11
11: ; preds = %9, %5
%12 = getelementptr inbounds i8, i8* %7, i64 %1
store i8 0, i8* %12
ret i8* %7
}
const char *str0(const char *s) { return s ? s : "(null)"; }


x86 assembly (clang, -O0):
<str0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <str0+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <str0+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <str0+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str0>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"(null)\00"
define i8* @str0(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
define i8* @str0(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Variables and functions */
unsigned char pkcs7_padding_plus_len(unsigned int, unsigned char);
unsigned int pkcs7_padding_len(unsigned int _datalen,
                               unsigned char _blocksize) {
  unsigned char plus_len = 0;
  plus_len = pkcs7_padding_plus_len(_datalen, _blocksize);
  if (0 == plus_len)
    return 0;
  return _datalen + plus_len;
}


x86 assembly (clang, -O0):
<pkcs7_padding_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movb   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%edi
movzbl -0x9(%rbp),%esi
call   1030 <pkcs7_padding_plus_len@plt>
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    114e <pkcs7_padding_len+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    115a <pkcs7_padding_len+0x4a>
mov    -0x8(%rbp),%eax
movzbl -0xa(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pkcs7_padding_len>:
push   %rbx
mov    %edi,%ebx
call   1030 <pkcs7_padding_plus_len@plt>
movzbl %al,%ecx
add    %ecx,%ebx
xor    %eax,%eax
test   %cl,%cl
cmovne %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @pkcs7_padding_len(i32 %0, i8 zeroext %1) {
%3 = tail call zeroext i8 @pkcs7_padding_plus_len(i32 %0, i8 zeroext %1)
%4 = icmp eq i8 %3, 0
%5 = zext i8 %3 to i32
%6 = add i32 %5, %0
%7 = select i1 %4, i32 0, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_si_append_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_sessinfo@%p::append (rtpp_si_append) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


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

x86 assembly (clang, -O2):
<rtpp_si_append_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [79 x i8] c"Method rtpp_sessinfo@%p::append (rtpp_si_append) is invoked after destruction\0A\00"
define void @rtpp_si_append_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [79 x i8] c"Method rtpp_sessinfo@%p::append (rtpp_si_append) is invoked after destruction\0A\00"
define void @rtpp_si_append_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
int cmp_float_lt(const void *a, const void *b) {
  float a_ = *(float *)a;
  float b_ = *(float *)b;
  if (a_ < b_)
    return -1;
  if (a_ > b_)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_float_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1145 <cmp_float_lt+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <cmp_float_lt+0x67>
movss  -0x1c(%rbp),%xmm0
ucomiss -0x20(%rbp),%xmm0
jbe    1160 <cmp_float_lt+0x60>
movl   $0x1,-0x4(%rbp)
jmp    1167 <cmp_float_lt+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_float_lt>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_float_lt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = fcmp ogt float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ az_fatal_(char const *, char *);
void *calloc(size_t, size_t);
void *az_alloc_(const char *funcname, size_t n, size_t size) {
  if (n == 0)
    return NULL;
  void *ptr = calloc(n, size);
  if (ptr == NULL) {
    az_fatal_(funcname, "Out of memory.\n");
  }
  return ptr;
}


x86 assembly (clang, -O0):
<az_alloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114c <az_alloc_+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1180 <az_alloc_+0x60>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1178 <az_alloc_+0x58>
mov    -0x10(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <az_fatal_@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<az_alloc_>:
push   %rbx
test   %rsi,%rsi
je     114a <az_alloc_+0x2a>
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <calloc@plt>
test   %rax,%rax
je     113b <az_alloc_+0x1b>
pop    %rbx
ret
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1030 <az_fatal_@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory.\0A\00"
define i8* @az_alloc_(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%9 = load i64, i64* %6
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i8* null, i8** %4
br label %23
12: ; preds = %3
%13 = load i64, i64* %6
%14 = load i64, i64* %7
%15 = call i8* @calloc(i64 %13, i64 %14)
store i8* %15, i8** %8
%16 = load i8*, i8** %8
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load i8*, i8** %5
%20 = call i32 @az_fatal_(i8* %19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %18, %12
%22 = load i8*, i8** %8
store i8* %22, i8** %4
br label %23
23: ; preds = %21, %11
%24 = load i8*, i8** %4
ret i8* %24
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory.\0A\00"
define noalias i8* @az_alloc_(i8* %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i8* @calloc(i64 %1, i64 %2)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @az_fatal_(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %5, %8, %3
%11 = phi i8* [ null, %3 ], [ null, %8 ], [ %6, %5 ]
ret i8* %11
}
void descompactaCaracteres(int src, char *char1, char *char2) {
  (*char2) = src & 0xff;
  (*char1) = (src & 0xff00) >> 8;
}


x86 assembly (clang, -O0):
<descompactaCaracteres>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<descompactaCaracteres>:
mov    %edi,%eax
mov    %al,(%rdx)
mov    %ah,(%rsi)
ret

LLVM IR (-O0):
define void @descompactaCaracteres(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %6
store i8 %9, i8* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 65280
%13 = ashr i32 %12, 8
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %5
store i8 %14, i8* %15
ret void
}

LLVM IR (-O2):
define void @descompactaCaracteres(i32 %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2) {
%4 = trunc i32 %0 to i8
store i8 %4, i8* %2
%5 = lshr i32 %0, 8
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __aeabi_memset4_impl(void *, size_t, int /*<<< orphan*/);
void __attribute__((weak)) __aeabi_memclr4_impl2(void *dest, size_t n) {
  __aeabi_memset4_impl(dest, n, 0);
}


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

x86 assembly (clang, -O2):
<__aeabi_memclr4_impl2>:
xor    %edx,%edx
jmp    1030 <__aeabi_memset4_impl@plt>

LLVM IR (-O0):
define weak void @__aeabi_memclr4_impl2(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 = load i64, i64* %4
%7 = call i32 @__aeabi_memset4_impl(i8* %5, i64 %6, i32 0)
ret void
}

LLVM IR (-O2):
define weak void @__aeabi_memclr4_impl2(i8* %0, i64 %1) {
%3 = tail call i32 @__aeabi_memset4_impl(i8* %0, i64 %1, i32 0)
ret void
}
int test_imm_B7int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xB7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B7int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 183
%7 = icmp ne i64 %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_B7int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11993088
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_y0f();
scalar_t__ y0f(float);
void test_y0f(float f) {
  if (y0f(f) != y0f(f))
    link_failure_y0f();
}


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

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

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

LLVM IR (-O2):
define void @test_y0f(float %0) {
%2 = tail call i64 @y0f(float %0)
%3 = tail call i64 @y0f(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_y0f()
br label %7
7: ; preds = %5, %1
ret void
}
main() {
  const int ki = 3;
  _Static_assert(__builtin_types_compatible_p(__typeof(ki), const int), "yo");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct inputSource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pm_error(char *);
void MasterServer(struct inputSource *const inputSourceP,
                  const char *const paramFileName,
                  const char *const outputFileName) {
  pm_error("This version of Ppmtompeg cannot run a master server because "
           "it does not have socket capability.");
}


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

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

LLVM IR (-O0):
%struct.inputSource = type { i32 }
@.str = [97 x i8] c"This version of Ppmtompeg cannot run a master server because it does not have socket capability.\00"
define void @MasterServer(%struct.inputSource* %0, i8* %1, i8* %2) {
%4 = alloca %struct.inputSource*
%5 = alloca i8*
%6 = alloca i8*
store %struct.inputSource* %0, %struct.inputSource** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @pm_error(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.inputSource = type { i32 }
@.str = [97 x i8] c"This version of Ppmtompeg cannot run a master server because it does not have socket capability.\00"
define void @MasterServer(%struct.inputSource* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @pm_error(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
ret void
}
int KlelGetVersionCurrent(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @KlelGetVersionCurrent() {
ret i32 2
}

LLVM IR (-O2):
define i32 @KlelGetVersionCurrent() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ DATA_param();
int /*<<< orphan*/ LibraryHeader(char *, char *);
int /*<<< orphan*/ STARTUP_param();
LIBRARY_param() {
  LibraryHeader("param", "Sat Feb  1 10:41:26 2014 ");
  DATA_param();
  STARTUP_param();
}


x86 assembly (clang, -O0):
<LIBRARY_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1030 <LibraryHeader@plt>
mov    $0x0,%al
call   1050 <DATA_param@plt>
mov    $0x0,%al
call   1040 <STARTUP_param@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LIBRARY_param>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1030 <LibraryHeader@plt>
xor    %eax,%eax
call   1050 <DATA_param@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <STARTUP_param@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"param\00"
@.str.1 = [26 x i8] c"Sat Feb 1 10:41:26 2014 \00"
define i32 @LIBRARY_param() {
%1 = alloca i32
%2 = call i32 @LibraryHeader(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @DATA_param()
%4 = call i32 (...) @STARTUP_param()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [6 x i8] c"param\00"
@.str.1 = [26 x i8] c"Sat Feb 1 10:41:26 2014 \00"
define i32 @LIBRARY_param() {
%1 = tail call i32 @LibraryHeader(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @DATA_param()
%3 = tail call i32 (...) @STARTUP_param()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ eight_queens_helper(int *, int /*<<< orphan*/);
int main() {
  int rows[8];
  eight_queens_helper(rows, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
call   1030 <eight_queens_helper@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <eight_queens_helper@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%4 = call i32 @eight_queens_helper(i32* %3, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @eight_queens_helper(i32* %3, i32 0)
ret i32 0
}
/* Variables and functions */
int get_nprocs();
int get_nprocs_conf();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("get_nprocs_conf() returns %d\n", get_nprocs_conf());
  printf("get_nprocs() returns %d\n", get_nprocs());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_nprocs_conf@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <get_nprocs@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <get_nprocs_conf@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <get_nprocs@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [30 x i8] c"get_nprocs_conf() returns %d\0A\00"
@.str.1 = [25 x i8] c"get_nprocs() returns %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @get_nprocs_conf()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @get_nprocs()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
int walkMeta(const char *str, const int len) {
  for (int i = 0; i < len; i += 2)
    if (str[i] != ':')
      return i;
  return len;
}


x86 assembly (clang, -O0):
<walkMeta>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1151 <walkMeta+0x51>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
je     113e <walkMeta+0x3e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <walkMeta+0x57>
jmp    1143 <walkMeta+0x43>
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <walkMeta+0x12>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<walkMeta>:
mov    %esi,%eax
test   %esi,%esi
jle    111e <walkMeta+0x1e>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpb   $0x3a,(%rdi,%rcx,1)
jne    111f <walkMeta+0x1f>
add    $0x2,%rcx
cmp    %eax,%ecx
jl     1110 <walkMeta+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @walkMeta(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 58
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = add nuw i64 %5, 2
%11 = trunc i64 %10 to i32
%12 = icmp slt i32 %11, %1
br i1 %12, label %4, label %15
13: ; preds = %4
%14 = trunc i64 %5 to i32
br label %15
15: ; preds = %9, %13, %2
%16 = phi i32 [ %1, %2 ], [ %14, %13 ], [ %1, %9 ]
ret i32 %16
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ creation_canal(int, int *, struct sockaddr_in *);
int /*<<< orphan*/ lancement_service(int);
int /*<<< orphan*/ printf(char *);
void connexion_individuelle(void *m_socket) {
  int ma_socket = *(int *)m_socket;
  int ta_socket;
  struct sockaddr_in client;
  creation_canal(ma_socket, &ta_socket, &client);
  printf("lancement service\n");
  close(ma_socket);
  lancement_service(ta_socket);
}


x86 assembly (clang, -O0):
<connexion_individuelle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <creation_canal@plt>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    -0x10(%rbp),%edi
call   1060 <lancement_service@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connexion_individuelle>:
push   %rbx
sub    $0x10,%rsp
mov    (%rdi),%ebx
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
call   1050 <creation_canal@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    0x4(%rsp),%edi
call   1060 <lancement_service@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@.str = [19 x i8] c"lancement service\0A\00"
define void @connexion_individuelle(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sockaddr_in
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @creation_canal(i32 %9, i32* %4, %struct.sockaddr_in* %5)
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = call i32 @close(i32 %12)
%14 = load i32, i32* %4
%15 = call i32 @lancement_service(i32 %14)
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
@str = [18 x i8] c"lancement service\00"
define void @connexion_individuelle(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i32* %2 to i8*
%7 = bitcast %struct.sockaddr_in* %3 to i8*
%8 = call i32 @creation_canal(i32 %5, i32* %2, %struct.sockaddr_in* %3)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%10 = call i32 @close(i32 %5)
%11 = load i32, i32* %2
%12 = call i32 @lancement_service(i32 %11)
ret void
}
/* Variables and functions */
int equal(char *, char *);
int /*<<< orphan*/ reverse(char *);
int test_reverse_even_chars() {
  char string[] = "abcd";
  reverse(string);
  return equal("dcba", string);
}


x86 assembly (clang, -O0):
<test_reverse_even_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x5(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1040 <equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_reverse_even_chars>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x64636261,0x8(%rsp)
64
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <equal@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_reverse_even_chars.string = [5 x i8] c"abcd\00"
@.str = [5 x i8] c"dcba\00"
define i32 @test_reverse_even_chars() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = call i32 @reverse(i8* %3)
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%6 = call i32 @equal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@__const.test_reverse_even_chars.string = [5 x i8] c"abcd\00"
@.str = [5 x i8] c"dcba\00"
define i32 @test_reverse_even_chars() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverse(i8* %2)
%4 = call i32 @equal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %4
}
char *firstblankchar(char *str) {
  while (*str) {
    if (*str == ' ')
      return str;
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<firstblankchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1143 <firstblankchar+0x43>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1132 <firstblankchar+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114b <firstblankchar+0x4b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <firstblankchar+0x8>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstblankchar>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <firstblankchar+0x22>
cmp    $0x20,%cl
je     1124 <firstblankchar+0x24>
add    $0x1,%rax
jmp    1110 <firstblankchar+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @firstblankchar(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 32, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i8* [ %3, %7 ], [ null, %2 ]
ret i8* %9
}
void modif_rear_unit2MODIF_UNGREEDY() {}


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

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

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

LLVM IR (-O2):
define void @modif_rear_unit2MODIF_UNGREEDY() {
ret void
}
unsigned int get32bits(unsigned char *p) {
  return (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3];
}


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

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

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

LLVM IR (-O2):
define i32 @get32bits(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
void rop3_241_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | S;
  stk2 = ~stk2;
  stk1 = T | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_241_0_1>:
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
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_241_0_1>:
mov    (%rdi),%r8b
mov    %edx,%ecx
and    %sil,%cl
mov    %edx,%eax
or     %sil,%al
or     %r8b,%al
not    %al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %cl,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_241_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = or i32 %30, %36
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = and i32 %43, %46
%48 = or i32 %37, %47
%49 = trunc i32 %48 to i8
%50 = load i8*, i8** %4
store i8 %49, i8* %50
ret void
}

LLVM IR (-O2):
define void @rop3_241_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %2, %1
%6 = or i8 %2, %1
%7 = or i8 %6, %4
%8 = xor i8 %7, -1
%9 = xor i8 %1, -1
%10 = and i8 %9, %2
%11 = and i8 %10, %4
%12 = or i8 %11, %5
%13 = or i8 %12, %8
store i8 %13, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ is_barebox_arm_head(char const *);
scalar_t__ is_barebox_mips_head(char const *);
int is_barebox_head(const char *head) {
  return is_barebox_arm_head(head) || is_barebox_mips_head(head);
}


x86 assembly (clang, -O0):
<is_barebox_head>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <is_barebox_arm_head@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <is_barebox_head+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <is_barebox_mips_head@plt>
cmp    $0x0,%rax
setne  %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_barebox_head>:
push   %rbx
mov    %rdi,%rbx
call   1040 <is_barebox_arm_head@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <is_barebox_head+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <is_barebox_mips_head@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_barebox_head(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @is_barebox_arm_head(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @is_barebox_mips_head(i8* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_barebox_head(i8* %0) {
%2 = tail call i64 @is_barebox_arm_head(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_barebox_mips_head(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int ffiTestInts8(int c1, int c2, int c3, int c4, int c5, int c6, int c7,
                 int c8) {
  ;
  return 42;
}


x86 assembly (clang, -O0):
<ffiTestInts8>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    $0x2a,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ffiTestInts8(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
ret i32 42
}

LLVM IR (-O2):
define i32 @ffiTestInts8(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ finish(int *, int, int *);
void main() {
  int src[50];
  int dst[50];
  finish(src, 50, dst);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
lea    -0xd0(%rbp),%rdi
lea    -0x1a0(%rbp),%rdx
mov    $0x32,%esi
call   1030 <finish@plt>
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
lea    0xd0(%rsp),%rdi
mov    %rsp,%rdx
mov    $0x32,%esi
call   1030 <finish@plt>
add    $0x198,%rsp
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca [50 x i32]
%2 = alloca [50 x i32]
%3 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
%5 = call i32 @finish(i32* %3, i32 50, i32* %4)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [50 x i32]
%2 = alloca [50 x i32]
%3 = bitcast [50 x i32]* %1 to i8*
%4 = bitcast [50 x i32]* %2 to i8*
%5 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
%7 = call i32 @finish(i32* %5, i32 50, i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ faux(int);
int main() {
  for (int tiph = 0; tiph <= 259; tiph++)
    faux(tiph);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x103,-0x8(%rbp)
jg     1149 <main+0x39>
mov    -0x8(%rbp),%edi
call   1030 <faux@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <faux@plt>
add    $0x1,%ebx
cmp    $0x104,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 259
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @faux(i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @faux(i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 260
br i1 %6, label %1, label %2
}