xunge/DecIR huggingface dataset:
int test_imm_20uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x20 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_20uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 32
%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_20uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 2097152
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printRecursion(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int x;
  printf("Numbers to print: ");
  scanf("%d", &x);
  printRecursion(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <printRecursion@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <printRecursion@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Numbers to print: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printRecursion(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Numbers to print: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printRecursion(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void print_usage(const char *prog) {
  printf("Usage: %s [-DsbdlHOLpC3]\n", prog);
  puts("  -D --device   device to use (default /dev/spidev1.0)\n"
       "  -s --speed    max speed (Hz)\n"
       "  -d --delay    delay (usec)\n"
       "  -b --bpw      bits per word \n"
       "  -l --loop     loopback\n"
       "  -H --cpha     clock phase\n"
       "  -O --cpol     clock polarity\n"
       "  -p            Send data (e.g. \"1234\\xde\\xad\")\n"
       "  -L --lsb      least significant bit first\n"
       "  -C --cs-high  chip select active high\n"
       "  -3 --3wire    SI/SO signals shared\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: %s [-DsbdlHOLpC3]\0A\00"
@.str.1 = [400 x i8] c" -D --device device to use (default /dev/spidev1.0)\0A -s --speed max speed (Hz)\0A -d --delay delay (usec)\0A -b --bpw bits per word \0A -l --loop loopback\0A -H --cpha clock phase\0A -O --cpol clock polarity\0A -p Send data (e.g. \221234\\xde\\xad\22)\0A -L --lsb least significant bit first\0A -C --cs-high chip select active high\0A -3 --3wire SI/SO signals shared\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: %s [-DsbdlHOLpC3]\0A\00"
@.str.1 = [400 x i8] c" -D --device device to use (default /dev/spidev1.0)\0A -s --speed max speed (Hz)\0A -d --delay delay (usec)\0A -b --bpw bits per word \0A -l --loop loopback\0A -H --cpha clock phase\0A -O --cpol clock polarity\0A -p Send data (e.g. \221234\\xde\\xad\22)\0A -L --lsb least significant bit first\0A -C --cs-high chip select active high\0A -3 --3wire SI/SO signals shared\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([400 x i8], [400 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
void lmh_sensor_deregister(struct lmh_sensor_ops *ops) { return; }


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

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

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

LLVM IR (-O2):
%struct.lmh_sensor_ops = type opaque
define void @lmh_sensor_deregister(%struct.lmh_sensor_ops* nocapture %0) {
ret void
}
void exit_plugin(void *handle) {
  int (*exit)(void *);
  exit = resolve_symbol("cifs_idmap_exit_plugin");
  if (exit)
    (*exit)(handle);
}


x86 assembly (clang, -O0):
<exit_plugin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <resolve_symbol@plt>
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <exit_plugin+0x35>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_plugin>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <resolve_symbol@plt>
test   %eax,%eax
je     112e <exit_plugin+0x1e>
cltq
mov    %rbx,%rdi
pop    %rbx
jmp    *%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"cifs_idmap_exit_plugin\00"
define void @exit_plugin(i8* %0) {
%2 = alloca i8*
%3 = alloca i32 (i8*)*
store i8* %0, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @resolve_symbol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32 (i8*)*
store i32 (i8*)* %6, i32 (i8*)** %3
%7 = load i32 (i8*)*, i32 (i8*)** %3
%8 = icmp ne i32 (i8*)* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32 (i8*)*, i32 (i8*)** %3
%11 = load i8*, i8** %2
%12 = call i32 %10(i8* %11)
br label %13
13: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"cifs_idmap_exit_plugin\00"
define void @exit_plugin(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @resolve_symbol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = inttoptr i64 %5 to i32 (i8*)*
%7 = tail call i32 %6(i8* %0)
br label %8
8: ; preds = %4, %1
ret void
}
void kill_time(int rep) {
  int i;
  for (i = rep; i > 0; --i)
    asm("nop");
}


x86 assembly (clang, -O0):
<kill_time>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1126 <kill_time+0x26>
nop
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110d <kill_time+0xd>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_time>:
test   %edi,%edi
jle    1119 <kill_time+0x19>
add    $0x1,%edi
nopw   0x0(%rax,%rax,1)
nop
add    $0xffffffff,%edi
cmp    $0x1,%edi
ja     1110 <kill_time+0x10>
ret

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

LLVM IR (-O2):
define void @kill_time(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%5 = add nsw i32 %4, -1
%6 = icmp ugt i32 %4, 1
br i1 %6, label %3, label %7
7: ; preds = %3, %1
ret void
}
void wifi_rsp_tcpip_dhcp_set_hostname(
    const struct wifi_msg_tcpip_dhcp_set_hostname_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_tcpip_dhcp_set_hostname_rsp_t = type opaque
define void @wifi_rsp_tcpip_dhcp_set_hostname(%struct.wifi_msg_tcpip_dhcp_set_hostname_rsp_t* nocapture %0) {
ret void
}
__attribute__((no, noclone)) signed __int128 t152_2add(unsigned __int128 y) {
  unsigned __int128 x = (0);
  signed __int128 r;
  if (__builtin_add_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t152_2add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
add    %rsi,%rdx
adc    %rax,%rcx
setb   %al
movzbl %al,%eax
mov    %eax,%esi
mov    %rsi,%rdi
neg    %rdi
mov    %rdi,%rax
xor    %rsi,%rax
or     %rdi,%rax
mov    %rcx,%rdi
shr    $0x3f,%rdi
xor    %rdi,%rsi
or     %rsi,%rax
setne  %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    1192 <t152_2add+0x82>
jmp    1199 <t152_2add+0x89>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t152_2add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rax
sar    $0x3f,%rax
je     112a <t152_2add+0x1a>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t152_2add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 0, i128* %6
%12 = load i128, i128* %6
%13 = load i128, i128* %5
%14 = zext i128 %12 to i129
%15 = zext i128 %13 to i129
%16 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 %14, i129 %15)
%17 = extractvalue { i129, i1 } %16, 1
%18 = extractvalue { i129, i1 } %16, 0
%19 = trunc i129 %18 to i128
%20 = sext i128 %19 to i129
%21 = icmp ne i129 %18, %20
%22 = or i1 %17, %21
store i128 %19, i128* %7
br i1 %22, label %23, label %25
23: ; preds = %2
%24 = call i32 (...) @bar()
br label %25
25: ; preds = %23, %2
%26 = load i128, i128* %7
store i128 %26, i128* %3
%27 = bitcast i128* %3 to { i64, i64 }*
%28 = load { i64, i64 }, { i64, i64 }* %27
ret { i64, i64 } %28
}

LLVM IR (-O2):
define { i64, i64 } @t152_2add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = sext i128 %6 to i129
%9 = icmp eq i129 %7, %8
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = insertvalue { i64, i64 } poison, i64 %0, 0
%14 = insertvalue { i64, i64 } %13, i64 %1, 1
ret { i64, i64 } %14
}
unsigned int f(unsigned int z) { return z + 2; }


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

x86 assembly (clang, -O2):
<f>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add i32 %0, 2
ret i32 %2
}
unsigned char CreateGrayScale(unsigned char *color) {
  return (unsigned char)(0.299f * color[2] + 0.587f * color[1] +
                         0.114f * color[0] + 0.5f);
}


x86 assembly (clang, -O0):
<CreateGrayScale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%ecx
cvtsi2ss %ecx,%xmm1
movzbl 0x1(%rax),%ecx
cvtsi2ss %ecx,%xmm0
movss  0xedc(%rip),%xmm2
mulss  %xmm2,%xmm0
movss  0xed4(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movzbl (%rax),%eax
cvtsi2ss %eax,%xmm0
movss  0xec1(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xeb5(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateGrayScale>:
movzbl 0x2(%rdi),%eax
cvtsi2ss %eax,%xmm0
movzbl 0x1(%rdi),%eax
cvtsi2ss %eax,%xmm1
mulss  0xee8(%rip),%xmm1
mulss  0xee4(%rip),%xmm0
movzbl (%rdi),%eax
cvtsi2ss %eax,%xmm2
addss  %xmm1,%xmm0
mulss  0xed5(%rip),%xmm2
addss  %xmm0,%xmm2
addss  0xecd(%rip),%xmm2
cvttss2si %xmm2,%eax
ret

LLVM IR (-O0):
define zeroext i8 @CreateGrayScale(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = sitofp i32 %6 to float
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = sitofp i32 %11 to float
%13 = fmul float 0x3FE2C8B440000000, %12
%14 = call float @llvm.fmuladd.f32(float 0x3FD322D0E0000000, float %7, float %13)
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = sitofp i32 %18 to float
%20 = call float @llvm.fmuladd.f32(float 0x3FBD2F1AA0000000, float %19, float %14)
%21 = fadd float %20, 5.000000e-01
%22 = fptoui float %21 to i8
ret i8 %22
}

LLVM IR (-O2):
define zeroext i8 @CreateGrayScale(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = uitofp i8 %3 to float
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = uitofp i8 %6 to float
%8 = fmul float %7, 0x3FE2C8B440000000
%9 = tail call float @llvm.fmuladd.f32(float %4, float 0x3FD322D0E0000000, float %8)
%10 = load i8, i8* %0
%11 = uitofp i8 %10 to float
%12 = tail call float @llvm.fmuladd.f32(float %11, float 0x3FBD2F1AA0000000, float %9)
%13 = fadd float %12, 5.000000e-01
%14 = fptoui float %13 to i8
ret i8 %14
}
/* Variables and functions */
char *gettext(char *);
int /*<<< orphan*/ print_header();
int /*<<< orphan*/ print_help();
int /*<<< orphan*/ printf(char *);
void print_unknown_arg(void) {
  print_header();
  printf(gettext("invalid or unknown argument\n"));
  print_help();
}


x86 assembly (clang, -O0):
<print_unknown_arg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <print_header@plt>
lea    0xeae(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <print_help@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_unknown_arg>:
push   %rax
xor    %eax,%eax
call   1050 <print_header@plt>
lea    0xeb1(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <print_help@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"invalid or unknown argument\0A\00"
define void @print_unknown_arg() {
%1 = call i32 (...) @print_header()
%2 = call i8* @gettext(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* %2)
%4 = call i32 (...) @print_help()
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"invalid or unknown argument\0A\00"
define void @print_unknown_arg() {
%1 = tail call i32 (...) @print_header()
%2 = tail call i8* @gettext(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) %2)
%4 = tail call i32 (...) @print_help()
ret void
}
/* Variables and functions */
size_t ZLIBH_compress(char *, char const *, int);
size_t BMK_ZLIBH_compress(void *dst, size_t dstSize, const void *src,
                          size_t srcSize, unsigned nbSymbols,
                          unsigned tableLog) {
  (void)nbSymbols;
  (void)tableLog;
  (void)dstSize;
  return ZLIBH_compress((char *)dst, (const char *)src, (int)srcSize);
}


x86 assembly (clang, -O0):
<BMK_ZLIBH_compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rax
mov    %eax,%edx
call   1030 <ZLIBH_compress@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMK_ZLIBH_compress>:
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <ZLIBH_compress@plt>

LLVM IR (-O0):
define i64 @BMK_ZLIBH_compress(i8* %0, i64 %1, i8* %2, i64 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %11
%14 = load i32, i32* %12
%15 = load i64, i64* %8
%16 = load i8*, i8** %7
%17 = load i8*, i8** %9
%18 = load i64, i64* %10
%19 = trunc i64 %18 to i32
%20 = call i64 @ZLIBH_compress(i8* %16, i8* %17, i32 %19)
ret i64 %20
}

LLVM IR (-O2):
define i64 @BMK_ZLIBH_compress(i8* %0, i64 %1, i8* %2, i64 %3, i32 %4, i32 %5) {
%7 = trunc i64 %3 to i32
%8 = tail call i64 @ZLIBH_compress(i8* %0, i8* %2, i32 %7)
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int errno;
int pthread_sigmask(int, int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int sigprocmask(int how, const sigset_t *set, sigset_t *old) {
  int r = pthread_sigmask(how, set, old);
  if (!r)
    return r;
  errno = r;
  return -1;
}


x86 assembly (clang, -O0):
<sigprocmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <pthread_sigmask@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    114b <sigprocmask+0x3b>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <sigprocmask+0x4e>
mov    -0x1c(%rbp),%ecx
mov    0x2e8b(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigprocmask>:
push   %rax
call   1030 <pthread_sigmask@plt>
test   %eax,%eax
je     112a <sigprocmask+0x1a>
mov    0x2ebf(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @sigprocmask(i32 %0, i32* %1, i32* %2) {
%4 = tail call i32 @pthread_sigmask(i32 %0, i32* %1, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3
store i32 %4, i32* @errno
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ -1, %6 ], [ 0, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ p18_adc();
int /*<<< orphan*/ p18_eeprom();
int /*<<< orphan*/ p18_int_pin();
int /*<<< orphan*/ p18_int_portb();
int /*<<< orphan*/ p18_mssp();
int /*<<< orphan*/ p18_tmr0();
int /*<<< orphan*/ p18_tmr1();
int /*<<< orphan*/ p18_tmr2();
int /*<<< orphan*/ p18_tmr3();
int /*<<< orphan*/ p18_wdt();
int /*<<< orphan*/ serial(int /*<<< orphan*/);
void PIC18F4550_periferic(void) {
  p18_mssp();
  p18_adc();
  p18_int_pin();
  p18_int_portb();
  p18_tmr0();
  p18_wdt();
  p18_eeprom();
  p18_tmr1();
  p18_tmr2();
  p18_tmr3();
  serial(0);
  ;
}


x86 assembly (clang, -O0):
<PIC18F4550_periferic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   10c0 <p18_mssp@plt>
mov    $0x0,%al
call   1030 <p18_adc@plt>
mov    $0x0,%al
call   1070 <p18_int_pin@plt>
mov    $0x0,%al
call   1080 <p18_int_portb@plt>
mov    $0x0,%al
call   1050 <p18_tmr0@plt>
mov    $0x0,%al
call   1090 <p18_wdt@plt>
mov    $0x0,%al
call   10d0 <p18_eeprom@plt>
mov    $0x0,%al
call   10a0 <p18_tmr1@plt>
mov    $0x0,%al
call   1040 <p18_tmr2@plt>
mov    $0x0,%al
call   10b0 <p18_tmr3@plt>
xor    %edi,%edi
call   1060 <serial@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC18F4550_periferic>:
push   %rax
xor    %eax,%eax
call   10c0 <p18_mssp@plt>
xor    %eax,%eax
call   1030 <p18_adc@plt>
xor    %eax,%eax
call   1070 <p18_int_pin@plt>
xor    %eax,%eax
call   1080 <p18_int_portb@plt>
xor    %eax,%eax
call   1050 <p18_tmr0@plt>
xor    %eax,%eax
call   1090 <p18_wdt@plt>
xor    %eax,%eax
call   10d0 <p18_eeprom@plt>
xor    %eax,%eax
call   10a0 <p18_tmr1@plt>
xor    %eax,%eax
call   1040 <p18_tmr2@plt>
xor    %eax,%eax
call   10b0 <p18_tmr3@plt>
xor    %edi,%edi
pop    %rax
jmp    1060 <serial@plt>

LLVM IR (-O0):
define void @PIC18F4550_periferic() {
%1 = call i32 (...) @p18_mssp()
%2 = call i32 (...) @p18_adc()
%3 = call i32 (...) @p18_int_pin()
%4 = call i32 (...) @p18_int_portb()
%5 = call i32 (...) @p18_tmr0()
%6 = call i32 (...) @p18_wdt()
%7 = call i32 (...) @p18_eeprom()
%8 = call i32 (...) @p18_tmr1()
%9 = call i32 (...) @p18_tmr2()
%10 = call i32 (...) @p18_tmr3()
%11 = call i32 @serial(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC18F4550_periferic() {
%1 = tail call i32 (...) @p18_mssp()
%2 = tail call i32 (...) @p18_adc()
%3 = tail call i32 (...) @p18_int_pin()
%4 = tail call i32 (...) @p18_int_portb()
%5 = tail call i32 (...) @p18_tmr0()
%6 = tail call i32 (...) @p18_wdt()
%7 = tail call i32 (...) @p18_eeprom()
%8 = tail call i32 (...) @p18_tmr1()
%9 = tail call i32 (...) @p18_tmr2()
%10 = tail call i32 (...) @p18_tmr3()
%11 = tail call i32 @serial(i32 0)
ret void
}
int nsatlit(int l) {
  if (l < 0)
    return ((-l - 1) << 1) | 1;
  return ((l - 1) << 1);
}


x86 assembly (clang, -O0):
<nsatlit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1127 <nsatlit+0x27>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
sub    $0x1,%eax
shl    $0x1,%eax
or     $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <nsatlit+0x33>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsatlit>:
test   %edi,%edi
js     110b <nsatlit+0xb>
lea    (%rdi,%rdi,1),%eax
add    $0xfffffffe,%eax
ret
not    %edi
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @nsatlit(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = xor i32 %0, -1
%5 = shl i32 %4, 1
%6 = or i32 %5, 1
br label %10
7: ; preds = %1
%8 = shl nuw i32 %0, 1
%9 = add i32 %8, -2
br label %10
10: ; preds = %7, %3
%11 = phi i32 [ %6, %3 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
double pow(double, int);
double cbrt(double x) { return pow(x, 1. / 3.); }


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

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

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

LLVM IR (-O2):
define double @cbrt(double %0) {
%2 = tail call double @pow(double %0, i32 0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_proplist_to_string_sep() {
  printf("NOT IMPLEMENTED:"
         "pa_proplist_to_string_sep"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_proplist_to_string_sep\00"
define i32 @pa_proplist_to_string_sep() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
char *basename(char *);
char *fatx_basename(char *path) { return basename(path); }


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

x86 assembly (clang, -O2):
<fatx_basename>:
jmp    1030 <basename@plt>

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

LLVM IR (-O2):
define i8* @fatx_basename(i8* %0) {
%2 = tail call i8* @basename(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ printf(char *, long, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_testcancel();
int /*<<< orphan*/ sleep(int);
void *thread(void *arg) {
  printf("thread %ld %d\n", (long)arg, getpid());
  sleep(1);
  while (1) {
    pthread_testcancel();
  }
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1050 <pthread_testcancel@plt>
jmp    1177 <thread+0x37>

x86 assembly (clang, -O2):
<thread>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <pthread_testcancel@plt>
jmp    1170 <thread+0x30>

LLVM IR (-O0):
@.str = [15 x i8] c"thread %ld %d\0A\00"
define i8* @thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i32 (...) @getpid()
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %4, i32 %5)
%7 = call i32 @sleep(i32 1)
br label %8
8: ; preds = %1, %8
%9 = call i32 (...) @pthread_testcancel()
br label %8
}

LLVM IR (-O2):
@.str = [15 x i8] c"thread %ld %d\0A\00"
define noalias i8* @thread(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %2, i32 %3)
%5 = tail call i32 @sleep(i32 1)
br label %6
6: ; preds = %1, %6
%7 = tail call i32 (...) @pthread_testcancel()
br label %6
}
/* Variables and functions */
int SIGQUIT;
int /*<<< orphan*/ printf(char *);
void my_quit_handler(int sigval) {
  if (sigval == SIGQUIT) {
    printf("SIGQUIT won't do\n");
    return;
  }
  return;
}


x86 assembly (clang, -O0):
<my_quit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    113e <my_quit_handler+0x2e>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    1143 <my_quit_handler+0x33>
jmp    1143 <my_quit_handler+0x33>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_quit_handler>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1127 <my_quit_handler+0x17>
lea    0xede(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@SIGQUIT = global i32 0
@.str = [18 x i8] c"SIGQUIT won't do\0A\00"
define void @my_quit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGQUIT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@SIGQUIT = global i32 0
@str = [17 x i8] c"SIGQUIT won't do\00"
define void @my_quit_handler(i32 %0) {
%2 = load i32, i32* @SIGQUIT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret void
}
/* Variables and functions */
unsigned char _BitScanForward(unsigned int *, unsigned int);
unsigned char test_BitScanForward(unsigned int *Index, unsigned int Mask) {
  return _BitScanForward(Index, Mask);
}


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

x86 assembly (clang, -O2):
<test_BitScanForward>:
jmp    1030 <_BitScanForward@plt>

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

LLVM IR (-O2):
define zeroext i8 @test_BitScanForward(i32* %0, i32 %1) {
%3 = tail call zeroext i8 @_BitScanForward(i32* %0, i32 %1)
ret i8 %3
}
/* Type definitions */
typedef int ulong;

/* Variables and functions */
unsigned int bits(ulong n) {
  unsigned int b = 0;
  while (n) {
    b++;
    n >>= 1;
  }
  return b;
}


x86 assembly (clang, -O0):
<bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <bits+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bits+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @bits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %4, 1
%7 = ashr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ lib_set_live_filter(char const *);
int /*<<< orphan*/ update_filterline();
void filters_set_live(const char *val) {
  lib_set_live_filter(val);
  update_filterline();
}


x86 assembly (clang, -O0):
<filters_set_live>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lib_set_live_filter@plt>
mov    $0x0,%al
call   1030 <update_filterline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filters_set_live>:
push   %rax
call   1040 <lib_set_live_filter@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <update_filterline@plt>

LLVM IR (-O0):
define void @filters_set_live(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @lib_set_live_filter(i8* %3)
%5 = call i32 (...) @update_filterline()
ret void
}

LLVM IR (-O2):
define void @filters_set_live(i8* %0) {
%2 = tail call i32 @lib_set_live_filter(i8* %0)
%3 = tail call i32 (...) @update_filterline()
ret void
}
void ff_hevc_put_hevc_bi_epel_hv6_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv6_12_sse4() {
ret void
}
int getdtablesize(void) {
  int tableSize = -1;
  if (tableSize >= 0)
    return tableSize;
  return sizeof(short) * 8;
}


x86 assembly (clang, -O0):
<getdtablesize>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1120 <getdtablesize+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <getdtablesize+0x27>
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getdtablesize() {
%1 = alloca i32
%2 = alloca i32
store i32 -1, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* %2
store i32 %6, i32* %1
br label %8
7: ; preds = %0
store i32 16, i32* %1
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @getdtablesize() {
ret i32 16
}
/* Variables and functions */
int check(int success, const char **str, const char *descr,
          const char *reason) {
  if (success) {
    if (str != NULL)
      *str = descr;
    return (0);
  } else {
    if (str != NULL)
      *str = reason;
    return (-1);
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113f <check+0x3f>
cmpq   $0x0,-0x10(%rbp)
je     1133 <check+0x33>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    115c <check+0x5c>
cmpq   $0x0,-0x10(%rbp)
je     1155 <check+0x55>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %rsi,%rsi
je     110e <check+0xe>
test   %edi,%edi
cmove  %rcx,%rdx
mov    %rdx,(%rsi)
cmp    $0x1,%edi
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @check(i32 %0, i8** writeonly %1, i8* %2, i8* %3) {
%5 = icmp eq i32 %0, 0
%6 = icmp eq i8** %1, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = select i1 %5, i8* %3, i8* %2
store i8* %8, i8** %1
br label %9
9: ; preds = %4, %7
%10 = sext i1 %5 to i32
ret i32 %10
}
char *op1(void) {
  return "passage dans op1 de "
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/elekmad/dlopen/refs/heads/master/lib1.c";
}


x86 assembly (clang, -O0):
<op1>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op1>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [150 x i8] c"passage dans op1 de /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/elekmad/dlopen/refs/heads/master/lib1.c\00"
define i8* @op1() {
ret i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [150 x i8] c"passage dans op1 de /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/elekmad/dlopen/refs/heads/master/lib1.c\00"
define i8* @op1() {
ret i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0)
}
void foo153() {}


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

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

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

LLVM IR (-O2):
define void @foo153() {
ret void
}
int test_imm_4Aint32_mem(int *val) {
  return ((*val) & (0x4A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Aint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 74
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci) {}


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

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

LLVM IR (-O0):
%struct.usb_hcd = type opaque
%struct.xhci_hcd = type opaque
define %struct.usb_hcd* @xhci_to_hcd(%struct.xhci_hcd* %0) {
%2 = alloca %struct.usb_hcd*
%3 = alloca %struct.xhci_hcd*
store %struct.xhci_hcd* %0, %struct.xhci_hcd** %3
%4 = load %struct.usb_hcd*, %struct.usb_hcd** %2
ret %struct.usb_hcd* %4
}

LLVM IR (-O2):
%struct.usb_hcd = type opaque
%struct.xhci_hcd = type opaque
define noalias %struct.usb_hcd* @xhci_to_hcd(%struct.xhci_hcd* nocapture readnone %0) {
ret %struct.usb_hcd* undef
}
void destroy_timer_on_stack(struct timer_list *timer) {}


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

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

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

LLVM IR (-O2):
%struct.timer_list = type opaque
define void @destroy_timer_on_stack(%struct.timer_list* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int time_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ hotp(int /*<<< orphan*/ const *, size_t const, int,
                        int const);
int32_t totp(const uint8_t *K, const size_t Klen, const time_t T,
             const int digits) {
  uint64_t C = (T - 0) / 30;
  return hotp(K, Klen, C, digits);
}


x86 assembly (clang, -O0):
<totp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x0,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <hotp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<totp>:
movslq %edx,%rdx
imul   $0xffffffff88888889,%rdx,%rax
shr    $0x20,%rax
add    %eax,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0x4,%edx
add    %eax,%edx
jmp    1030 <hotp@plt>

LLVM IR (-O0):
define i32 @totp(i32* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = sub nsw i32 %10, 0
%12 = sdiv i32 %11, 30
store i32 %12, i32* %9
%13 = load i32*, i32** %5
%14 = load i64, i64* %6
%15 = load i32, i32* %9
%16 = load i32, i32* %8
%17 = call i32 @hotp(i32* %13, i64 %14, i32 %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @totp(i32* %0, i64 %1, i32 %2, i32 %3) {
%5 = sdiv i32 %2, 30
%6 = tail call i32 @hotp(i32* %0, i64 %1, i32 %5, i32 %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  double nota1, nota2, media;
  scanf("%lf%lf", &nota1, &nota2);
  media = (3.5 * nota1 + 7.5 * nota2) / 11.0;
  printf("MEDIA = %.5lf\n", media);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xeab(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeed(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xeb2(%rip),%xmm1
mulsd  0xeb2(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xeae(%rip),%xmm0
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%lf%lf\00"
@.str.1 = [15 x i8] c"MEDIA = %.5lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%6 = load double, double* %2
%7 = load double, double* %3
%8 = fmul double 7.500000e+00, %7
%9 = call double @llvm.fmuladd.f64(double 3.500000e+00, double %6, double %8)
%10 = fdiv double %9, 1.100000e+01
store double %10, double* %4
%11 = load double, double* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%lf%lf\00"
@.str.1 = [15 x i8] c"MEDIA = %.5lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fmul double %7, 7.500000e+00
%9 = call double @llvm.fmuladd.f64(double %6, double 3.500000e+00, double %8)
%10 = fdiv double %9, 1.100000e+01
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}
/* Variables and functions */
unsigned char *hmac_haval160(unsigned char *, unsigned char const *, size_t,
                             unsigned char const *, size_t);
unsigned char *mac_hmac_haval160(unsigned char *out, const unsigned char *key,
                                 size_t key_len, const unsigned char *msg,
                                 size_t msg_len) {
  return hmac_haval160(out, key, key_len, msg, msg_len);
}


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

x86 assembly (clang, -O2):
<mac_hmac_haval160>:
jmp    1030 <hmac_haval160@plt>

LLVM IR (-O0):
define i8* @mac_hmac_haval160(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = call i8* @hmac_haval160(i8* %11, i8* %12, i64 %13, i8* %14, i64 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @mac_hmac_haval160(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_haval160(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}