xunge/DecIR huggingface dataset:
unsigned int sub_AQW4(unsigned int result) {
  if (result) {
    int v4 = __builtin_clz(result) - 8;
    int v5 = (result | 0x4B000000) - 0x800000 - (v4 << 23);
    result = v5 + (result << v4);
  }
  return result;
}


x86 assembly (clang, -O0):
<sub_AQW4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114a <sub_AQW4+0x4a>
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
sub    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     $0x4b000000,%eax
sub    $0x800000,%eax
mov    -0x8(%rbp),%ecx
shl    $0x17,%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_AQW4>:
test   %edi,%edi
je     1125 <sub_AQW4+0x25>
bsr    %edi,%ecx
xor    $0x1f,%ecx
add    $0xfffffff8,%ecx
mov    %edi,%eax
or     $0x4b000000,%eax
mov    %ecx,%edx
shl    $0x17,%edx
sub    %edx,%eax
shl    %cl,%edi
add    %edi,%eax
add    $0xff800000,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sub_AQW4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %22
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @llvm.ctlz.i32(i32 %8, i1 true)
%10 = sub nsw i32 %9, 8
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = or i32 %11, 1258291200
%13 = sub i32 %12, 8388608
%14 = load i32, i32* %3
%15 = shl i32 %14, 23
%16 = sub i32 %13, %15
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = shl i32 %18, %19
%21 = add i32 %17, %20
store i32 %21, i32* %2
br label %22
22: ; preds = %7, %1
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @sub_AQW4(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%5 = add nsw i32 %4, -8
%6 = or i32 %0, 1258291200
%7 = add nsw i32 %6, -8388608
%8 = mul nsw i32 %5, -8388608
%9 = add i32 %7, %8
%10 = shl i32 %0, %5
%11 = add i32 %9, %10
br label %12
12: ; preds = %3, %1
%13 = phi i32 [ %11, %3 ], [ 0, %1 ]
ret i32 %13
}
int test_imm_2Bint64_highword_reg(long long val) {
  return ((val >> 32) & (0x2B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_2Bint64_highword_reg>:
movabs $0x2b00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Bint64_highword_reg(i64 %0) {
%2 = and i64 %0, 184683593728
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int cmp_greedy_S1(void *qsort_thunk_vp, const void *xvp, const void *yvp) {
  return 0;
}


x86 assembly (clang, -O0):
<cmp_greedy_S1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmp_greedy_S1(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
ret i32 0
}

LLVM IR (-O2):
define i32 @cmp_greedy_S1(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ doubleindirect2();
void doubleindirect1(void) { doubleindirect2(); }


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

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

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

LLVM IR (-O2):
define void @doubleindirect1() {
%1 = tail call i32 (...) @doubleindirect2()
ret void
}
/* Type definitions */
struct timespec {
  unsigned long long tv_sec;
  unsigned long long tv_nsec;
};

/* Variables and functions */
int sol_util_msec_from_timespec(const struct timespec *ts) {
  return ts->tv_sec * 1000ULL + ts->tv_nsec / 1000000ULL;
}


x86 assembly (clang, -O0):
<sol_util_msec_from_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sol_util_msec_from_timespec>:
movabs $0x431bde82d7b634db,%rax
de 1b 43
mulq   0x8(%rdi)
imul   $0x3e8,(%rdi),%eax
shr    $0x12,%rdx
add    %edx,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @sol_util_msec_from_timespec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = udiv i64 %9, 1000000
%11 = add i64 %6, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @sol_util_msec_from_timespec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = udiv i64 %6, 1000000
%8 = add i64 %7, %4
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ RangedRandDemo(int, int, int);
int /*<<< orphan*/ SimpleRandDemo(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  srand((unsigned)time(NULL));
  SimpleRandDemo(10);
  printf("\n");
  RangedRandDemo(-100, 100, 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0xa,%edi
call   1060 <SimpleRandDemo@plt>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffff9c,%edi
mov    $0x64,%esi
mov    $0xa,%edx
call   1070 <RangedRandDemo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0xa,%edi
call   1060 <SimpleRandDemo@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xffffff9c,%edi
mov    $0x64,%esi
mov    $0xa,%edx
call   1070 <RangedRandDemo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
%4 = call i32 @SimpleRandDemo(i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @RangedRandDemo(i32 -100, i32 100, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 @SimpleRandDemo(i32 10)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @RangedRandDemo(i32 -100, i32 100, i32 10)
ret i32 0
}
int readSwitchPort() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @readSwitchPort() {
ret i32 0
}
double molecular_mass(char *chemical_formula) {
  double mass = 0;
  return mass;
}


x86 assembly (clang, -O0):
<molecular_mass>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<molecular_mass>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @molecular_mass(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
store double 0.000000e+00, double* %3
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @molecular_mass(i8* nocapture readnone %0) {
ret double 0.000000e+00
}
void batadv_nc_free(struct batadv_priv *bat_priv) { return; }


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

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

LLVM IR (-O0):
%struct.batadv_priv = type opaque
define void @batadv_nc_free(%struct.batadv_priv* %0) {
%2 = alloca %struct.batadv_priv*
store %struct.batadv_priv* %0, %struct.batadv_priv** %2
ret void
}

LLVM IR (-O2):
%struct.batadv_priv = type opaque
define void @batadv_nc_free(%struct.batadv_priv* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void skip_uint32_t(void **data, uint16_t *size) {
  assert(*size >= sizeof(uint32_t));
  *size -= sizeof(uint32_t);
  (*(uint32_t **)data)++;
}


x86 assembly (clang, -O0):
<skip_uint32_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
cmp    $0x4,%rax
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movslq (%rax),%rcx
sub    $0x4,%rcx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_uint32_t>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmpl   $0x4,(%rsi)
setae  %dil
call   1030 <assert@plt>
addl   $0xfffffffc,(%rbx)
addq   $0x4,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @skip_uint32_t(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
store i8** %0, i8*** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = icmp uge i64 %7, 4
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = sub i64 %13, 4
%15 = trunc i64 %14 to i32
store i32 %15, i32* %11
%16 = load i8**, i8*** %3
%17 = bitcast i8** %16 to i32**
%18 = load i32*, i32** %17
%19 = getelementptr inbounds i32, i32* %18, i32 1
store i32* %19, i32** %17
ret void
}

LLVM IR (-O2):
define void @skip_uint32_t(i8** nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp ugt i32 %3, 3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i32, i32* %1
%8 = add i32 %7, -4
store i32 %8, i32* %1
%9 = bitcast i8** %0 to i32**
%10 = load i32*, i32** %9
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32* %11, i32** %9
ret void
}
int getRight(int idx) { return (idx * 2) + 1; }


x86 assembly (clang, -O0):
<getRight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRight>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getRight(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @getRight(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t read_FP_BE(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
size_t int32ReadFromFP(FILE *fp, int32_t *data) {
  return read_FP_BE(fp, data, sizeof(int32_t));
}


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

x86 assembly (clang, -O2):
<int32ReadFromFP>:
mov    $0x4,%edx
jmp    1030 <read_FP_BE@plt>

LLVM IR (-O0):
define i64 @int32ReadFromFP(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 i64 @read_FP_BE(i32* %5, i32* %6, i32 4)
ret i64 %7
}

LLVM IR (-O2):
define i64 @int32ReadFromFP(i32* %0, i32* %1) {
%3 = tail call i64 @read_FP_BE(i32* %0, i32* %1, i32 4)
ret i64 %3
}
/* Variables and functions */
char *strcpy(char *, char const *);
int strlen(char *);
char *strcat(char *destination, const char *source) {
  return strcpy((char *)destination + (strlen(destination) + 1), source);
}


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

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
cltq
lea    (%rax,%rbx,1),%rdi
add    $0x1,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %1)
ret i8* %6
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ d2_list_add_tail(struct node *, struct node *);
void d2_queue_Inject(struct node *node, struct node *queue) {
  d2_list_add_tail(node, queue);
}


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

x86 assembly (clang, -O2):
<d2_queue_Inject>:
jmp    1030 <d2_list_add_tail@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define void @d2_queue_Inject(%struct.node* %0, %struct.node* %1) {
%3 = alloca %struct.node*
%4 = alloca %struct.node*
store %struct.node* %0, %struct.node** %3
store %struct.node* %1, %struct.node** %4
%5 = load %struct.node*, %struct.node** %3
%6 = load %struct.node*, %struct.node** %4
%7 = call i32 @d2_list_add_tail(%struct.node* %5, %struct.node* %6)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @d2_queue_Inject(%struct.node* %0, %struct.node* %1) {
%3 = tail call i32 @d2_list_add_tail(%struct.node* %0, %struct.node* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bit_hl(int);
void opcb_5e() { bit_hl(3); }


x86 assembly (clang, -O0):
<opcb_5e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <bit_hl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<opcb_5e>:
mov    $0x3,%edi
jmp    1030 <bit_hl@plt>

LLVM IR (-O0):
define void @opcb_5e() {
%1 = call i32 @bit_hl(i32 3)
ret void
}

LLVM IR (-O2):
define void @opcb_5e() {
%1 = tail call i32 @bit_hl(i32 3)
ret void
}
int test_imm_68int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x68 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_68int64_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, 104
%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_68int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6815744
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ BUF_MEM;

/* Variables and functions */
int /*<<< orphan*/ BUFerror(int /*<<< orphan*/);
int /*<<< orphan*/ ERR_R_MALLOC_FAILURE;
int /*<<< orphan*/ *calloc(int, int);
BUF_MEM *BUF_MEM_new(void) {
  BUF_MEM *ret;
  if ((ret = calloc(1, sizeof(BUF_MEM))) == NULL) {
    BUFerror(ERR_R_MALLOC_FAILURE);
    return (NULL);
  }
  return (ret);
}


x86 assembly (clang, -O0):
<BUF_MEM_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1160 <BUF_MEM_new+0x40>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <BUFerror@plt>
movq   $0x0,-0x8(%rbp)
jmp    1168 <BUF_MEM_new+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BUF_MEM_new>:
push   %rbx
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <BUF_MEM_new+0x26>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <BUFerror@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@ERR_R_MALLOC_FAILURE = global i32 0
define noalias i32* @BUF_MEM_new() {
%1 = tail call i32* @calloc(i32 1, i32 4)
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @ERR_R_MALLOC_FAILURE
%5 = tail call i32 @BUFerror(i32 %4)
br label %6
6: ; preds = %0, %3
ret i32* %1
}
void av_opt_set_bin() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_set_bin() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;
typedef int portnum;

/* Variables and functions */
int /*<<< orphan*/ tubeWrite(int, int /*<<< orphan*/);
void portout(uint16_t portnum, uint8_t value) {
  if ((((portnum)&0xFFF1) == 0x0080)) {
    tubeWrite(((portnum >> 1) & 0x0007), value);
  }
}


x86 assembly (clang, -O0):
<portout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfff1,%eax
cmp    $0x80,%eax
jne    1142 <portout+0x32>
mov    -0x4(%rbp),%edi
sar    $0x1,%edi
and    $0x7,%edi
mov    -0x8(%rbp),%esi
call   1030 <tubeWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portout>:
mov    %edi,%eax
and    $0xfff1,%eax
cmp    $0x80,%eax
jne    1128 <portout+0x18>
shr    %edi
and    $0x7,%edi
jmp    1030 <tubeWrite@plt>
ret

LLVM IR (-O0):
define void @portout(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 = and i32 %5, 65521
%7 = icmp eq i32 %6, 128
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %3
%10 = ashr i32 %9, 1
%11 = and i32 %10, 7
%12 = load i32, i32* %4
%13 = call i32 @tubeWrite(i32 %11, i32 %12)
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @portout(i32 %0, i32 %1) {
%3 = and i32 %0, 65521
%4 = icmp eq i32 %3, 128
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = lshr i32 %0, 1
%7 = and i32 %6, 7
%8 = tail call i32 @tubeWrite(i32 %7, i32 %1)
br label %9
9: ; preds = %5, %2
ret void
}
int is_utf8(const unsigned char *data) {
  return data[0] == 0xEF && data[1] == 0xBB && data[2] == 0xBF;
}


x86 assembly (clang, -O0):
<is_utf8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xef,%ecx
mov    %al,-0x9(%rbp)
jne    114c <is_utf8+0x4c>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0xbb,%ecx
mov    %al,-0x9(%rbp)
jne    114c <is_utf8+0x4c>
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0xbf,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_utf8>:
xor    %eax,%eax
cmpb   $0xef,(%rdi)
jne    1116 <is_utf8+0x16>
cmpb   $0xbb,0x1(%rdi)
jne    1116 <is_utf8+0x16>
xor    %eax,%eax
cmpb   $0xbf,0x2(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_utf8(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 = icmp eq i32 %6, 239
br i1 %7, label %8, label %20
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 187
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = icmp eq i32 %18, 191
br label %20
20: ; preds = %14, %8, %1
%21 = phi i1 [ false, %8 ], [ false, %1 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_utf8(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, -17
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, -69
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, -65
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %4, %1
%14 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %12, %8 ]
ret i32 %14
}
double rq_pricing_fx(double S, double K, double df_dom, double df_for) {
  double c = K * df_dom / df_for;
  return c - S;
}


x86 assembly (clang, -O0):
<rq_pricing_fx>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_pricing_fx>:
mulsd  %xmm2,%xmm1
divsd  %xmm3,%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @rq_pricing_fx(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %6
%11 = load double, double* %7
%12 = fmul double %10, %11
%13 = load double, double* %8
%14 = fdiv double %12, %13
store double %14, double* %9
%15 = load double, double* %9
%16 = load double, double* %5
%17 = fsub double %15, %16
ret double %17
}

LLVM IR (-O2):
define double @rq_pricing_fx(double %0, double %1, double %2, double %3) {
%5 = fmul double %1, %2
%6 = fdiv double %5, %3
%7 = fsub double %6, %0
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void le32_to_cpus(uint32_t *p) {}


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

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

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

LLVM IR (-O2):
define void @le32_to_cpus(i32* nocapture %0) {
ret void
}
int ft_strlen(char *str) {
  int i;
  i = 0;
  if (!str)
    return (i);
  while (str[i])
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1125 <ft_strlen+0x25>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <ft_strlen+0x50>
jmp    112a <ft_strlen+0x2a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114a <ft_strlen+0x4a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <ft_strlen+0x2a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
test   %rdi,%rdi
je     111d <ft_strlen+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int STDOUT_FILENO;
int /*<<< orphan*/ WIFEXITED(int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ wait(int *);
void close_stream(int fd) {
  if (fd != STDOUT_FILENO) {
    close(fd);
    int status;
    do {
      wait(&status);
    } while (!WIFEXITED(status));
  }
}


x86 assembly (clang, -O0):
<close_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
je     117b <close_stream+0x4b>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
lea    -0x8(%rbp),%rdi
call   1050 <wait@plt>
mov    -0x8(%rbp),%edi
call   1040 <WIFEXITED@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1155 <close_stream+0x25>
jmp    117b <close_stream+0x4b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_stream>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eb4(%rip),%rax
cmp    %edi,(%rax)
je     1165 <close_stream+0x35>
call   1030 <close@plt>
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <wait@plt>
mov    0xc(%rsp),%edi
call   1040 <WIFEXITED@plt>
test   %eax,%eax
je     1150 <close_stream+0x20>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @close_stream(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @STDOUT_FILENO
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %18
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @close(i32 %8)
br label %10
10: ; preds = %12, %7
%11 = call i32 @wait(i32* %3)
br label %12
12: ; preds = %10
%13 = load i32, i32* %3
%14 = call i32 @WIFEXITED(i32 %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %10, label %17
17: ; preds = %12
br label %18
18: ; preds = %17, %1
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @close_stream(i32 %0) {
%2 = alloca i32
%3 = load i32, i32* @STDOUT_FILENO
%4 = icmp eq i32 %3, %0
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = tail call i32 @close(i32 %0)
%7 = bitcast i32* %2 to i8*
br label %8
8: ; preds = %8, %5
%9 = call i32 @wait(i32* %2)
%10 = load i32, i32* %2
%11 = call i32 @WIFEXITED(i32 %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %8, label %13
13: ; preds = %8
br label %14
14: ; preds = %13, %1
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int __socketcall(int, unsigned long *);
int __libc_accept(int s, struct sockaddr *addr, socklen_t *addrlen) {
  unsigned long args[3];
  args[0] = s;
  args[1] = (unsigned long)addr;
  args[2] = (unsigned long)addrlen;
  return __socketcall(5, args);
}


x86 assembly (clang, -O0):
<__libc_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x5,%edi
call   1030 <__socketcall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_accept>:
sub    $0x18,%rsp
movslq %edi,%rax
mov    %rax,(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
call   1030 <__socketcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @__libc_accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
%7 = alloca [3 x i64]
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
store i64 %9, i64* %10
%11 = load %struct.sockaddr*, %struct.sockaddr** %5
%12 = ptrtoint %struct.sockaddr* %11 to i64
%13 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 1
store i64 %12, i64* %13
%14 = load i32*, i32** %6
%15 = ptrtoint i32* %14 to i64
%16 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 2
store i64 %15, i64* %16
%17 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
%18 = call i32 @__socketcall(i32 5, i64* %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @__libc_accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca [3 x i64]
%5 = bitcast [3 x i64]* %4 to i8*
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 0
store i64 %6, i64* %7
%8 = ptrtoint %struct.sockaddr* %1 to i64
%9 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 1
store i64 %8, i64* %9
%10 = ptrtoint i32* %2 to i64
%11 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 2
store i64 %10, i64* %11
%12 = call i32 @__socketcall(i32 5, i64* %7)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *run3(void *arg) {
  printf("this is thread 3\n");
  printf("Debugging involves backwards reasoning, like solving murder "
         "mysteries.\n");
  printf("thread 3 exits\n");
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<run3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run3>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"this is thread 3\0A\00"
@.str.1 = [72 x i8] c"Debugging involves backwards reasoning, like solving murder mysteries.\0A\00"
@.str.2 = [16 x i8] c"thread 3 exits\0A\00"
define i8* @run3(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @pthread_exit(i32* null)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@str = [17 x i8] c"this is thread 3\00"
@str.3 = [71 x i8] c"Debugging involves backwards reasoning, like solving murder mysteries.\00"
@str.4 = [15 x i8] c"thread 3 exits\00"
define noalias i8* @run3(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
void wl12xx_op_remove_interface(struct ieee80211_hw *hw,
                                struct ieee80211_if_init_conf *conf) {
  {
    {
      while (1) {
      while_18_continue:;
        goto while_18_break;
      }
    while_18_break:;
    }
    return;
  }
}


x86 assembly (clang, -O0):
<wl12xx_op_remove_interface>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1111 <wl12xx_op_remove_interface+0x11>
jmp    1116 <wl12xx_op_remove_interface+0x16>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ieee80211_hw = type opaque
%struct.ieee80211_if_init_conf = type opaque
define void @wl12xx_op_remove_interface(%struct.ieee80211_hw* %0, %struct.ieee80211_if_init_conf* %1) {
%3 = alloca %struct.ieee80211_hw*
%4 = alloca %struct.ieee80211_if_init_conf*
store %struct.ieee80211_hw* %0, %struct.ieee80211_hw** %3
store %struct.ieee80211_if_init_conf* %1, %struct.ieee80211_if_init_conf** %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.ieee80211_hw = type opaque
%struct.ieee80211_if_init_conf = type opaque
define void @wl12xx_op_remove_interface(%struct.ieee80211_hw* nocapture %0, %struct.ieee80211_if_init_conf* nocapture %1) {
ret void
}
int ocl_hw_atomic16_postdec(int index) {}


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

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

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

LLVM IR (-O2):
define i32 @ocl_hw_atomic16_postdec(i32 %0) {
ret i32 undef
}
void test4(unsigned int x) {
  if (!((0U << x) == 0U || (1U << x) == 8U || (2U << x) == 16U ||
        (3U << x) == 24U || (4U << x) == 32U || (5U << x) == 40U ||
        (6U << x) == 48U || (7U << x) == 56U || (8U << x) == 64U ||
        (9U << x) == 72U || (10U << x) == 80U))
    __builtin_abort();
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
shl    %cl,%eax
cmp    $0x0,%eax
je     11ee <test4+0xde>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    $0x8,%eax
je     11ee <test4+0xde>
mov    -0x4(%rbp),%ecx
mov    $0x2,%eax
shl    %cl,%eax
cmp    $0x10,%eax
je     11ee <test4+0xde>
mov    -0x4(%rbp),%ecx
mov    $0x3,%eax
shl    %cl,%eax
cmp    $0x18,%eax
je     11ee <test4+0xde>
mov    -0x4(%rbp),%ecx
mov    $0x4,%eax
shl    %cl,%eax
cmp    $0x20,%eax
je     11ee <test4+0xde>
mov    -0x4(%rbp),%ecx
mov    $0x5,%eax
shl    %cl,%eax
cmp    $0x28,%eax
je     11ee <test4+0xde>
mov    -0x4(%rbp),%ecx
mov    $0x6,%eax
shl    %cl,%eax
cmp    $0x30,%eax
je     11ee <test4+0xde>
mov    -0x4(%rbp),%ecx
mov    $0x7,%eax
shl    %cl,%eax
cmp    $0x38,%eax
je     11ee <test4+0xde>
mov    -0x4(%rbp),%ecx
mov    $0x8,%eax
shl    %cl,%eax
cmp    $0x40,%eax
je     11ee <test4+0xde>
mov    -0x4(%rbp),%ecx
mov    $0x9,%eax
shl    %cl,%eax
cmp    $0x48,%eax
je     11ee <test4+0xde>
mov    -0x4(%rbp),%ecx
mov    $0xa,%eax
shl    %cl,%eax
cmp    $0x50,%eax
je     11ee <test4+0xde>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 0, %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %47, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = shl i32 1, %7
%9 = icmp eq i32 %8, 8
br i1 %9, label %47, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = shl i32 2, %11
%13 = icmp eq i32 %12, 16
br i1 %13, label %47, label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = shl i32 3, %15
%17 = icmp eq i32 %16, 24
br i1 %17, label %47, label %18
18: ; preds = %14
%19 = load i32, i32* %2
%20 = shl i32 4, %19
%21 = icmp eq i32 %20, 32
br i1 %21, label %47, label %22
22: ; preds = %18
%23 = load i32, i32* %2
%24 = shl i32 5, %23
%25 = icmp eq i32 %24, 40
br i1 %25, label %47, label %26
26: ; preds = %22
%27 = load i32, i32* %2
%28 = shl i32 6, %27
%29 = icmp eq i32 %28, 48
br i1 %29, label %47, label %30
30: ; preds = %26
%31 = load i32, i32* %2
%32 = shl i32 7, %31
%33 = icmp eq i32 %32, 56
br i1 %33, label %47, label %34
34: ; preds = %30
%35 = load i32, i32* %2
%36 = shl i32 8, %35
%37 = icmp eq i32 %36, 64
br i1 %37, label %47, label %38
38: ; preds = %34
%39 = load i32, i32* %2
%40 = shl i32 9, %39
%41 = icmp eq i32 %40, 72
br i1 %41, label %47, label %42
42: ; preds = %38
%43 = load i32, i32* %2
%44 = shl i32 10, %43
%45 = icmp eq i32 %44, 80
br i1 %45, label %47, label %46
46: ; preds = %42
unreachable
47: ; preds = %42, %38, %34, %30, %26, %22, %18, %14, %10, %6, %1
ret void
}

LLVM IR (-O2):
define void @test4(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ base_test();
int /*<<< orphan*/ greth_test(int);
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
main() {
  report_start();
  base_test();
  greth_test(0x80000d00);
  report_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <report_start@plt>
mov    $0x0,%al
call   1050 <base_test@plt>
mov    $0x80000d00,%edi
call   1040 <greth_test@plt>
mov    $0x0,%al
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <report_start@plt>
xor    %eax,%eax
call   1050 <base_test@plt>
mov    $0x80000d00,%edi
call   1040 <greth_test@plt>
xor    %eax,%eax
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @report_start()
%2 = call i32 (...) @base_test()
%3 = call i32 @greth_test(i32 -2147480320)
%4 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 (...) @base_test()
%3 = tail call i32 @greth_test(i32 -2147480320)
%4 = tail call i32 (...) @report_end()
ret i32 0
}
/* Variables and functions */
int gzwrite(void *, void *, int);
int xgzwrite(void *cookie, const char *data, int size) {
  return gzwrite(cookie, (void *)data, size);
}


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

x86 assembly (clang, -O2):
<xgzwrite>:
jmp    1030 <gzwrite@plt>

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

LLVM IR (-O2):
define i32 @xgzwrite(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @gzwrite(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int asm_main();
int main() {
  int ret_status = asm_main();
  return ret_status;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @asm_main()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ unimplemented();
void maxspeed(void) { unimplemented(); }


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

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

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

LLVM IR (-O2):
define void @maxspeed() {
%1 = tail call i32 (...) @unimplemented()
ret void
}
/* Variables and functions */
double expm1(double);
double c_expm1(double arg0) { return expm1(arg0); }


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

x86 assembly (clang, -O2):
<c_expm1>:
jmp    1030 <expm1@plt>

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

LLVM IR (-O2):
define double @c_expm1(double %0) {
%2 = tail call double @expm1(double %0)
ret double %2
}
/* Variables and functions */
double fabs(double);
double sin(double);
double sinc(double val) {
  if (fabs(val) < 0.00001)
    return 1.0;
  else
    return sin(val) / val;
}


x86 assembly (clang, -O0):
<sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movaps 0xee7(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xecb(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1151 <sinc+0x41>
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1165 <sinc+0x55>
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinc>:
sub    $0x18,%rsp
movapd 0xee4(%rip),%xmm2
andpd  %xmm0,%xmm2
movsd  0xef0(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    113b <sinc+0x2b>
movsd  0xeda(%rip),%xmm0
add    $0x18,%rsp
ret
movapd %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @sinc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call double @llvm.fabs.f64(double %4)
%6 = fcmp olt double %5, 1.000000e-05
br i1 %6, label %7, label %8
7: ; preds = %1
store double 1.000000e+00, double* %2
br label %13
8: ; preds = %1
%9 = load double, double* %3
%10 = call double @sin(double %9)
%11 = load double, double* %3
%12 = fdiv double %10, %11
store double %12, double* %2
br label %13
13: ; preds = %8, %7
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @sinc(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp olt double %2, 1.000000e-05
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call double @sin(double %0)
%6 = fdiv double %5, %0
br label %7
7: ; preds = %1, %4
%8 = phi double [ %6, %4 ], [ 1.000000e+00, %1 ]
ret double %8
}
/* Variables and functions */
int SIM_power_gatecap(int, int /*<<< orphan*/);
double SIM_grp_in_cap(void) {
  return 2 *
         SIM_power_gatecap(
             (3 * ((0.8 * 0.0875) * 0.5)) + (3 * ((0.8 * 0.0875) * 0.5)), 0);
}


x86 assembly (clang, -O0):
<SIM_grp_in_cap>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <SIM_power_gatecap@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_grp_in_cap>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <SIM_power_gatecap@plt>
add    %eax,%eax
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @SIM_grp_in_cap() {
%1 = call i32 @SIM_power_gatecap(i32 0, i32 0)
%2 = mul nsw i32 2, %1
%3 = sitofp i32 %2 to double
ret double %3
}

LLVM IR (-O2):
define double @SIM_grp_in_cap() {
%1 = tail call i32 @SIM_power_gatecap(i32 0, i32 0)
%2 = shl nsw i32 %1, 1
%3 = sitofp i32 %2 to double
ret double %3
}
/* Variables and functions */
char ASCII_TO_UPPER(char);
void WSTRING_TO_UPPER(char *s) {
  while ((*s++ = ASCII_TO_UPPER(*s)))
    ;
}


x86 assembly (clang, -O0):
<WSTRING_TO_UPPER>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ASCII_TO_UPPER@plt>
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1146 <WSTRING_TO_UPPER+0x36>
jmp    111c <WSTRING_TO_UPPER+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WSTRING_TO_UPPER>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <ASCII_TO_UPPER@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <WSTRING_TO_UPPER+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @WSTRING_TO_UPPER(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = tail call signext i8 @ASCII_TO_UPPER(i8 signext %4)
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %5, i8* %3
%7 = icmp eq i8 %5, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_load1_ps(float *);
__attribute__((no)) void foo() {
  float x = 1.2345f;
  __m128 v = _mm_load1_ps(&x);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <_mm_load1_ps@plt>
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
movl   $0x3f9e0419,0x4(%rsp)
3f
lea    0x4(%rsp),%rdi
call   1030 <_mm_load1_ps@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca float
%2 = alloca i32
store float 0x3FF3C08320000000, float* %1
%3 = call i32 @_mm_load1_ps(float* %1)
store i32 %3, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 0x3FF3C08320000000, float* %1
%3 = call i32 @_mm_load1_ps(float* %1)
ret void
}