xunge/DecIR huggingface dataset:
void ATIReduceRatio(int *Numerator, int *Denominator) {
  int Multiplier, Divider, Remainder;
  Multiplier = *Numerator;
  Divider = *Denominator;
  while ((Remainder = Multiplier % Divider)) {
    Multiplier = Divider;
    Divider = Remainder;
  }
  *Numerator /= Divider;
  *Denominator /= Divider;
}


x86 assembly (clang, -O0):
<ATIReduceRatio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmp    $0x0,%edx
je     1142 <ATIReduceRatio+0x42>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    111e <ATIReduceRatio+0x1e>
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ATIReduceRatio>:
mov    (%rdi),%r8d
mov    (%rsi),%edx
mov    %r8d,%ecx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%eax
mov    %edx,%ecx
cltd
idiv   %ecx
test   %edx,%edx
jne    1110 <ATIReduceRatio+0x10>
mov    %r8d,%eax
cltd
idiv   %ecx
mov    %eax,(%rdi)
mov    (%rsi),%eax
cltd
idiv   %ecx
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @ATIReduceRatio(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
br label %5
5: ; preds = %5, %2
%6 = phi i32 [ %4, %2 ], [ %8, %5 ]
%7 = phi i32 [ %3, %2 ], [ %6, %5 ]
%8 = srem i32 %7, %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = sdiv i32 %3, %6
store i32 %11, i32* %0
%12 = load i32, i32* %1
%13 = sdiv i32 %12, %6
store i32 %13, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_signed_msg_encoding();
int main() {
  test_signed_msg_encoding();
  test_signed_msg_encoding();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_signed_msg_encoding()
%2 = tail call i32 (...) @test_signed_msg_encoding()
ret i32 0
}
/* Variables and functions */
int socket(int, int, int);
__attribute__((weak)) int __real_socket(int protocol_family, int socket_type,
                                        int protocol) {
  return socket(protocol_family, socket_type, protocol);
}


x86 assembly (clang, -O0):
<__real_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__real_socket>:
jmp    1030 <socket@plt>

LLVM IR (-O0):
define weak i32 @__real_socket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @socket(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define weak i32 @__real_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct mark {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mark_ref_copy(struct mark *, struct mark *);
int /*<<< orphan*/ mark_to_mark_noref(struct mark *, struct mark *);
void mark_to_mark(struct mark *m, struct mark *target) {
  mark_to_mark_noref(m, target);
  mark_ref_copy(m, target);
}


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

x86 assembly (clang, -O2):
<mark_to_mark>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <mark_to_mark_noref@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <mark_ref_copy@plt>

LLVM IR (-O0):
%struct.mark = type { i32 }
define void @mark_to_mark(%struct.mark* %0, %struct.mark* %1) {
%3 = alloca %struct.mark*
%4 = alloca %struct.mark*
store %struct.mark* %0, %struct.mark** %3
store %struct.mark* %1, %struct.mark** %4
%5 = load %struct.mark*, %struct.mark** %3
%6 = load %struct.mark*, %struct.mark** %4
%7 = call i32 @mark_to_mark_noref(%struct.mark* %5, %struct.mark* %6)
%8 = load %struct.mark*, %struct.mark** %3
%9 = load %struct.mark*, %struct.mark** %4
%10 = call i32 @mark_ref_copy(%struct.mark* %8, %struct.mark* %9)
ret void
}

LLVM IR (-O2):
%struct.mark = type { i32 }
define void @mark_to_mark(%struct.mark* %0, %struct.mark* %1) {
%3 = tail call i32 @mark_to_mark_noref(%struct.mark* %0, %struct.mark* %1)
%4 = tail call i32 @mark_ref_copy(%struct.mark* %0, %struct.mark* %1)
ret void
}
void ordenarIndex() {}


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

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

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

LLVM IR (-O2):
define void @ordenarIndex() {
ret void
}
int test_imm_0Cint8_mem(signed char *val) {
  return ((*val) & (0x0C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Cint8_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, 12
%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_0Cint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 12
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double sphere_volume(double);
double sqrt(double);
double bcc_volume_fraction(double radius, double dnn) {
  return 2.0 * sphere_volume(sqrt(0.75) * radius / dnn);
}


x86 assembly (clang, -O0):
<bcc_volume_fraction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xece(%rip),%xmm0
call   1040 <sqrt@plt>
mulsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <sphere_volume@plt>
movaps %xmm0,%xmm1
movsd  0xea7(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcc_volume_fraction>:
push   %rax
mulsd  0xee7(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1030 <sphere_volume@plt>
addsd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bcc_volume_fraction(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double @sqrt(double 7.500000e-01)
%6 = load double, double* %3
%7 = fmul double %5, %6
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = call double @sphere_volume(double %9)
%11 = fmul double 2.000000e+00, %10
ret double %11
}

LLVM IR (-O2):
define double @bcc_volume_fraction(double %0, double %1) {
%3 = fmul double %0, 0x3FEBB67AE8584CAA
%4 = fdiv double %3, %1
%5 = tail call double @sphere_volume(double %4)
%6 = fmul double %5, 2.000000e+00
ret double %6
}
void dummyaudio_AiDacrateChanged(int SystemType) { return; }


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

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

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

LLVM IR (-O2):
define void @dummyaudio_AiDacrateChanged(i32 %0) {
ret void
}
unsigned long int hash2(char *llave) {
  unsigned long int hash = 0;
  while (*llave)
    hash += (int)*llave++;
  return hash;
}


x86 assembly (clang, -O0):
<hash2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <hash2+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash2>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <hash2+0x23>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash2+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hash2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i64
%10 = add i64 %6, %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %14
}
int getByte(int x, int n) {
  int y = n << 3;
  return ((x & (255 << y)) >> y) & 255;
}


x86 assembly (clang, -O0):
<getByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xff,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getByte>:
lea    0x0(,%rsi,8),%ecx
mov    $0xff,%eax
shl    %cl,%eax
and    %edi,%eax
sar    %cl,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @getByte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = shl i32 %6, 3
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = shl i32 255, %9
%11 = and i32 %8, %10
%12 = load i32, i32* %5
%13 = ashr i32 %11, %12
%14 = and i32 %13, 255
ret i32 %14
}

LLVM IR (-O2):
define i32 @getByte(i32 %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = shl i32 255, %3
%5 = and i32 %4, %0
%6 = ashr i32 %5, %3
%7 = and i32 %6, 255
ret i32 %7
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
struct plainstring *plainstring_new();
int /*<<< orphan*/ plainstring_set_int(struct plainstring *, int);
struct plainstring *plainstring_new_int(int i) {
  struct plainstring *str = plainstring_new();
  if (!str)
    return str;
  plainstring_set_int(str, i);
  return str;
}


x86 assembly (clang, -O0):
<plainstring_new_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <plainstring_new@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114e <plainstring_new_int+0x2e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <plainstring_new_int+0x42>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <plainstring_set_int@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_new_int>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <plainstring_new@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113e <plainstring_new_int+0x1e>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <plainstring_set_int@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define %struct.plainstring* @plainstring_new_int(i32 %0) {
%2 = alloca %struct.plainstring*
%3 = alloca i32
%4 = alloca %struct.plainstring*
store i32 %0, i32* %3
%5 = call %struct.plainstring* (...) @plainstring_new()
store %struct.plainstring* %5, %struct.plainstring** %4
%6 = load %struct.plainstring*, %struct.plainstring** %4
%7 = icmp ne %struct.plainstring* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load %struct.plainstring*, %struct.plainstring** %4
store %struct.plainstring* %9, %struct.plainstring** %2
br label %15
10: ; preds = %1
%11 = load %struct.plainstring*, %struct.plainstring** %4
%12 = load i32, i32* %3
%13 = call i32 @plainstring_set_int(%struct.plainstring* %11, i32 %12)
%14 = load %struct.plainstring*, %struct.plainstring** %4
store %struct.plainstring* %14, %struct.plainstring** %2
br label %15
15: ; preds = %10, %8
%16 = load %struct.plainstring*, %struct.plainstring** %2
ret %struct.plainstring* %16
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define %struct.plainstring* @plainstring_new_int(i32 %0) {
%2 = tail call %struct.plainstring* (...) @plainstring_new()
%3 = icmp eq %struct.plainstring* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @plainstring_set_int(%struct.plainstring* %2, i32 %0)
br label %6
6: ; preds = %1, %4
ret %struct.plainstring* %2
}
/* Variables and functions */
int get_immediate_sub(char **, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int get_immediate(char *s) {
  char *p = (char *)malloc(1024);
  strcpy(p, s);
  return get_immediate_sub(&p, 10);
}


x86 assembly (clang, -O0):
<get_immediate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <get_immediate_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_immediate>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0x8(%rsp),%rdi
mov    $0xa,%esi
call   1040 <get_immediate_sub@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_immediate(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 1024)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = call i32 @get_immediate_sub(i8** %3, i32 10)
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_immediate(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = tail call i64 @malloc(i32 1024)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
%7 = call i32 @get_immediate_sub(i8** %2, i32 10)
ret i32 %7
}
void g_set_prgname() {}


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

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

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

LLVM IR (-O2):
define void @g_set_prgname() {
ret void
}
/* Variables and functions */
int random();
void test_modified_value_then_error_bad(int *x) {
  *x = random();
  if (*x == 5) {
    int *p = NULL;
    *p = 42;
  }
}


x86 assembly (clang, -O0):
<test_modified_value_then_error_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x5,(%rax)
jne    114a <test_modified_value_then_error_bad+0x3a>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_modified_value_then_error_bad>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @test_modified_value_then_error_bad(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = call i32 (...) @random()
%5 = load i32*, i32** %2
store i32 %4, i32* %5
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 5
br i1 %8, label %9, label %11
9: ; preds = %1
store i32* null, i32** %3
%10 = load i32*, i32** %3
store i32 42, i32* %10
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @test_modified_value_then_error_bad(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @random()
store i32 %2, i32* %0
%3 = icmp ne i32 %2, 5
tail call void @llvm.assume(i1 %3)
ret void
}
void process_plain_bad(int num_tasks, int vec[num_tasks][num_tasks]) {}


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

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

LLVM IR (-O0):
define void @process_plain_bad(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
ret void
}

LLVM IR (-O2):
define void @process_plain_bad(i32 %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int /*<<< orphan*/ swap(int);
int main() {
  while (1) {
    int c = getchar();
    if (c == -1)
      break;
    putchar(swap(c));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1158 <main+0x28>
jmp    116c <main+0x3c>
mov    -0x8(%rbp),%edi
call   1050 <swap@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xffffffff,%eax
je     115c <main+0x2c>
mov    %eax,%edi
call   1050 <swap@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = icmp eq i32 %1, -1
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ %1, %0 ]
%5 = tail call i32 @swap(i32 %4)
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %3
9: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *alloc_array(size_t len, size_t elem_size) {
  return calloc(len, elem_size);
}


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

x86 assembly (clang, -O2):
<alloc_array>:
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @alloc_array(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_pointerToConstInt(int *);
void f_1_1(void) {
  int t;
  int *tp1 = &t;
  int *tp2 = tp1;
  doStuff_pointerToConstInt(tp2);
}


x86 assembly (clang, -O0):
<f_1_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <doStuff_pointerToConstInt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_1_1>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <doStuff_pointerToConstInt@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @f_1_1() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @doStuff_pointerToConstInt(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FNDELAY;
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ exit(int);
int fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void nonblock(int s) {
  if (fcntl(s, F_SETFL, FNDELAY) == -1) {
    perror("Noblock");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    0x2e8a(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
jne    1174 <nonblock+0x44>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonblock>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     114f <nonblock+0x1f>
pop    %rax
ret
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@FNDELAY = global i32 0
@.str = [8 x i8] c"Noblock\00"
define void @nonblock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @FNDELAY
%6 = call i32 @fcntl(i32 %3, i32 %4, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@FNDELAY = global i32 0
@.str = [8 x i8] c"Noblock\00"
define void @nonblock(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @FNDELAY
%4 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}
void model_finalize(void) { return; }


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

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

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

LLVM IR (-O2):
define void @model_finalize() {
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int);
main(void) {
  int c, nc;
  nc = 0;
  c = getchar();
  while (c != '\n') {
    nc++;
    c = getchar();
  }
  printf("Número de caracteres: %d\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
je     1162 <main+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
mov    -0xc(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     114f <main+0x2f>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    1140 <main+0x20>
lea    0xeaa(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"N\C3\BAmero de caracteres: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = call i32 (...) @getchar()
store i32 %11, i32* %2
br label %5
12: ; preds = %5
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [27 x i8] c"N\C3\BAmero de caracteres: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = icmp eq i32 %1, 10
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %5, %3 ], [ 0, %0 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i32 (...) @getchar()
%7 = icmp eq i32 %6, 10
br i1 %7, label %8, label %3
8: ; preds = %3, %0
%9 = phi i32 [ 0, %0 ], [ %5, %3 ]
%10 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
char *sub_unsigned(char *base, unsigned long offset) { return base - offset; }


x86 assembly (clang, -O0):
<sub_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_unsigned>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @sub_unsigned(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 = sub i64 0, %6
%8 = getelementptr inbounds i8, i8* %5, i64 %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @sub_unsigned(i8* readnone %0, i64 %1) {
%3 = sub i64 0, %1
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void die() { exit(EXIT_FAILURE); }


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @die() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @die() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int fabs(double);
int sgn(double x) {
  if (fabs(x) < 1e-14)
    return 0;
  else if (x < 0)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1149 <sgn+0x39>
movl   $0x0,-0x4(%rbp)
jmp    116a <sgn+0x5a>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1163 <sgn+0x53>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <sgn+0x5a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <fabs@plt>
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
ucomisd (%rsp),%xmm0
setbe  %cl
lea    (%rcx,%rcx,1),%edx
add    $0xffffffff,%edx
xor    %ecx,%ecx
test   %eax,%eax
cmovg  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sgn(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i32 @fabs(double %4)
%6 = sitofp i32 %5 to double
%7 = fcmp olt double %6, 0x3D06849B86A12B9B
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %14
9: ; preds = %1
%10 = load double, double* %3
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 -1, i32* %2
br label %14
13: ; preds = %9
store i32 1, i32* %2
br label %14
14: ; preds = %13, %12, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @sgn(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = fcmp olt double %0, 0.000000e+00
%4 = select i1 %3, i32 -1, i32 1
%5 = icmp sgt i32 %2, 0
%6 = select i1 %5, i32 %4, i32 0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ ts_copy(char *, int /*<<< orphan*/);
void ts_copy_c_string(char *str) { ts_copy(str, strlen(str)); }


x86 assembly (clang, -O0):
<ts_copy_c_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <ts_copy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_copy_c_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ts_copy@plt>

LLVM IR (-O0):
define void @ts_copy_c_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @ts_copy(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @ts_copy_c_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @ts_copy(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_001();
int /*<<< orphan*/ test_002();
int /*<<< orphan*/ test_003();
int /*<<< orphan*/ test_004();
int main(int argc, char **argv) {
  test_001();
  test_002();
  test_003();
  test_004();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_001@plt>
mov    $0x0,%al
call   1050 <test_002@plt>
mov    $0x0,%al
call   1040 <test_003@plt>
mov    $0x0,%al
call   1060 <test_004@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_001@plt>
xor    %eax,%eax
call   1050 <test_002@plt>
xor    %eax,%eax
call   1040 <test_003@plt>
xor    %eax,%eax
call   1060 <test_004@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_001()
%7 = call i32 (...) @test_002()
%8 = call i32 (...) @test_003()
%9 = call i32 (...) @test_004()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_001()
%4 = tail call i32 (...) @test_002()
%5 = tail call i32 (...) @test_003()
%6 = tail call i32 (...) @test_004()
ret i32 0
}
void DBGFR3AsResolveAndRetain(void) {}


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

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

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

LLVM IR (-O2):
define void @DBGFR3AsResolveAndRetain() {
ret void
}
/* Variables and functions */
char const *irc_nick_find_color(char const *);
const char *irc_info_info_irc_nick_color_cb(void *data, const char *info_name,
                                            const char *arguments) {
  (void)data;
  (void)info_name;
  return (arguments && arguments[0]) ? irc_nick_find_color(arguments) : NULL;
}


x86 assembly (clang, -O0):
<irc_info_info_irc_nick_color_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1151 <irc_info_info_irc_nick_color_cb+0x41>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <irc_info_info_irc_nick_color_cb+0x41>
mov    -0x18(%rbp),%rdi
call   1030 <irc_nick_find_color@plt>
mov    %rax,-0x20(%rbp)
jmp    115c <irc_info_info_irc_nick_color_cb+0x4c>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    115c <irc_info_info_irc_nick_color_cb+0x4c>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_info_info_irc_nick_color_cb>:
test   %rdx,%rdx
je     1122 <irc_info_info_irc_nick_color_cb+0x12>
cmpb   $0x0,(%rdx)
je     1122 <irc_info_info_irc_nick_color_cb+0x12>
mov    %rdx,%rdi
jmp    1030 <irc_nick_find_color@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @irc_info_info_irc_nick_color_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i8* @irc_nick_find_color(i8* %2)
br label %10
10: ; preds = %3, %5, %8
%11 = phi i8* [ %9, %8 ], [ null, %5 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, World\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello, World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t strlen(char const *);
size_t ls_strlen(const char *a) {
  if (a == NULL) {
    return 0;
  }
  return strlen(a);
}


x86 assembly (clang, -O0):
<ls_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <ls_strlen+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <ls_strlen+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_strlen>:
test   %rdi,%rdi
je     111a <ls_strlen+0xa>
jmp    1030 <strlen@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @ls_strlen(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 0, i64* %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %2
br label %10
10: ; preds = %7, %6
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
define i64 @ls_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Variables and functions */
float fabs(double);
int eq(double a, double b) { return (fabs(a - b) < 0.001f); }


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movss  0xec4(%rip),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq>:
push   %rax
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
movss  0xede(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eq(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 = fsub double %5, %6
%8 = call float @fabs(double %7)
%9 = fcmp olt float %8, 0x3F50624DE0000000
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @eq(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call float @fabs(double %3)
%5 = fcmp olt float %4, 0x3F50624DE0000000
%6 = zext i1 %5 to i32
ret i32 %6
}
int test_imm_2Auint32_reg(unsigned int val) {
  return ((val) & (0x2A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Auint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x2a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Auint32_reg>:
test   $0x2a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Auint32_reg(i32 %0) {
%2 = and i32 %0, 42
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void startFileReader(long *plThreadId, char *pcFilename) {}


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

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

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

LLVM IR (-O2):
define void @startFileReader(i64* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int gen_posix_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mut) {
  return pthread_cond_wait(cond, mut);
}


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

x86 assembly (clang, -O2):
<gen_posix_cond_wait>:
jmp    1030 <pthread_cond_wait@plt>

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

LLVM IR (-O2):
define i32 @gen_posix_cond_wait(i32* %0, i32* %1) {
%3 = tail call i32 @pthread_cond_wait(i32* %0, i32* %1)
ret i32 %3
}
void _string_do(char *text, void (*closure)(char *c)) {
  int i = 0;
  while (text[i] != '\0') {
    closure(&text[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<_string_do>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114b <_string_do+0x4b>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rcx
add    %rcx,%rdi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <_string_do+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_string_do>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1120 <_string_do+0x20>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1110 <_string_do+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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


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

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

LLVM IR (-O0):
define i32 @gettermsize_unix() {
ret i32 0
}

LLVM IR (-O2):
define i32 @gettermsize_unix() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ f(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int array[] = {5, 2, 3, 1, 0, 7};
  int size = sizeof(array) / sizeof(int);
  printf("%d\n", size);
  f(array, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x6,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed6(%rip),%rdi
mov    $0x6,%esi
call   1040 <printf@plt>
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.array = [6 x i32] [i32 5, i32 2, i32 3, i32 1, i32 0, i32 7]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%5 = call i32 @f(i32* %4, i32 6)
ret i32 0
}
unsigned xrop3_122_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = ~D;
  stk3 = S | stk4;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_122_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_122_0_0>:
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
lea    -0x100(%rdi),%eax
and    %ecx,%eax
xor    $0xff,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_122_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = or i32 %3, -256
%7 = and i32 %5, %6
%8 = xor i32 %7, 255
ret i32 %8
}