xunge/DecIR huggingface dataset:
void gtk_tree_view_append_column() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_append_column() {
ret void
}
int handle_server_message() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @handle_server_message() {
ret i32 0
}
float vf(int i) {
  register __attribute__((vector_size(16))) float a;
  return a[0];
}


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

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

LLVM IR (-O0):
define float @vf(i32 %0) {
%2 = alloca i32
%3 = alloca <4 x float>
store i32 %0, i32* %2
%4 = load <4 x float>, <4 x float>* %3
%5 = extractelement <4 x float> %4, i32 0
ret float %5
}

LLVM IR (-O2):
define float @vf(i32 %0) {
ret float undef
}
/* Variables and functions */
int iterate_number(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int qtdseq;
  printf("Digite a quantidade de seq..\n");
  scanf("%d", &qtdseq);
  printf("Somatorio da sequencia = %d\n", iterate_number(qtdseq));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1030 <iterate_number@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <iterate_number@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Digite a quantidade de seq..\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"Somatorio da sequencia = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 @iterate_number(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"Somatorio da sequencia = %d\0A\00"
@str = [29 x i8] c"Digite a quantidade de seq..\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @iterate_number(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
long INT_MAX;
int RAND_load_file(const char *path, long num) {
  if (num < 0) {
    return 1;
  } else if (num <= INT_MAX) {
    return (int)num;
  } else {
    return INT_MAX;
  }
}


x86 assembly (clang, -O0):
<RAND_load_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    1123 <RAND_load_file+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1150 <RAND_load_file+0x50>
mov    -0x18(%rbp),%rax
mov    0x2eba(%rip),%rcx
cmp    (%rcx),%rax
jg     1143 <RAND_load_file+0x43>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1150 <RAND_load_file+0x50>
mov    0x2e9e(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RAND_load_file>:
test   %rsi,%rsi
js     111a <RAND_load_file+0x1a>
mov    %rsi,%rax
mov    0x2ed9(%rip),%rcx
mov    (%rcx),%rcx
cmp    %rsi,%rcx
jge    1119 <RAND_load_file+0x19>
mov    %ecx,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i64 0
define i32 @RAND_load_file(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %19
9: ; preds = %2
%10 = load i64, i64* %5
%11 = load i64, i64* @INT_MAX
%12 = icmp sle i64 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i64, i64* %5
%15 = trunc i64 %14 to i32
store i32 %15, i32* %3
br label %19
16: ; preds = %9
%17 = load i64, i64* @INT_MAX
%18 = trunc i64 %17 to i32
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %13, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@INT_MAX = global i64 0
define i32 @RAND_load_file(i8* nocapture readnone %0, i64 %1) {
%3 = icmp slt i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = load i64, i64* @INT_MAX
%6 = icmp slt i64 %5, %1
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = trunc i64 %1 to i32
br label %11
9: ; preds = %4
%10 = trunc i64 %5 to i32
br label %11
11: ; preds = %2, %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ], [ 1, %2 ]
ret i32 %12
}
int processa_argumentos(int argc, char *argv[]) {
  int erro = 0;
  return erro;
}


x86 assembly (clang, -O0):
<processa_argumentos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @processa_argumentos(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
float __wasm_float_min_f32(float lhs, float rhs) {
  if (lhs != lhs)
    return lhs;
  if (rhs != rhs)
    return rhs;
  return lhs < rhs ? lhs : rhs;
}


x86 assembly (clang, -O0):
<__wasm_float_min_f32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    1128 <__wasm_float_min_f32+0x28>
jp     1128 <__wasm_float_min_f32+0x28>
jmp    1137 <__wasm_float_min_f32+0x37>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1196 <__wasm_float_min_f32+0x96>
movss  -0xc(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    1151 <__wasm_float_min_f32+0x51>
jp     1151 <__wasm_float_min_f32+0x51>
jmp    1160 <__wasm_float_min_f32+0x60>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1196 <__wasm_float_min_f32+0x96>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1182 <__wasm_float_min_f32+0x82>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    118c <__wasm_float_min_f32+0x8c>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wasm_float_min_f32>:
ucomiss %xmm0,%xmm0
jp     110e <__wasm_float_min_f32+0xe>
ucomiss %xmm1,%xmm1
jp     110f <__wasm_float_min_f32+0xf>
minss  %xmm1,%xmm0
ret
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__wasm_float_min_f32(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %4
%8 = fcmp une float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %27
11: ; preds = %2
%12 = load float, float* %5
%13 = load float, float* %5
%14 = fcmp une float %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load float, float* %5
store float %16, float* %3
br label %27
17: ; preds = %11
%18 = load float, float* %4
%19 = load float, float* %5
%20 = fcmp olt float %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load float, float* %4
br label %25
23: ; preds = %17
%24 = load float, float* %5
br label %25
25: ; preds = %23, %21
%26 = phi float [ %22, %21 ], [ %24, %23 ]
store float %26, float* %3
br label %27
27: ; preds = %25, %15, %9
%28 = load float, float* %3
ret float %28
}

LLVM IR (-O2):
define float @__wasm_float_min_f32(float %0, float %1) {
%3 = fcmp uno float %0, 0.000000e+00
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = fcmp uno float %1, 0.000000e+00
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = fcmp olt float %0, %1
%8 = select i1 %7, float %0, float %1
br label %9
9: ; preds = %4, %2, %6
%10 = phi float [ %8, %6 ], [ %0, %2 ], [ %1, %4 ]
ret float %10
}
int pointer_hash(void *self, int seed, void *obj) {
  int hash = seed;
  hash *= 31;
  hash += (int)obj;
  return hash;
}


x86 assembly (clang, -O0):
<pointer_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
imul   $0x1f,-0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointer_hash>:
mov    %esi,%eax
shl    $0x5,%eax
sub    %esi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @pointer_hash(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %5
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = mul nsw i32 %9, 31
store i32 %10, i32* %7
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i32
%13 = load i32, i32* %7
%14 = add nsw i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @pointer_hash(i8* nocapture readnone %0, i32 %1, i8* %2) {
%4 = mul nsw i32 %1, 31
%5 = ptrtoint i8* %2 to i64
%6 = trunc i64 %5 to i32
%7 = add nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void lwg_parse_yyfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<lwg_parse_yyfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @lwg_parse_yyfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void manchester_advance_space(int *buf, int *len, unsigned length) {
  if (*len % 2)
    buf[*len] += length;
  else
    buf[++(*len)] = length;
}


x86 assembly (clang, -O0):
<manchester_advance_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     113f <manchester_advance_space+0x3f>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
jmp    1157 <manchester_advance_space+0x57>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    (%rsi),%ecx
add    $0x1,%ecx
mov    %ecx,(%rsi)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<manchester_advance_space>:
movslq (%rsi),%rax
test   $0x1,%al
jne    1111 <manchester_advance_space+0x11>
lea    0x1(%rax),%ecx
mov    %ecx,(%rsi)
mov    %edx,0x4(%rdi,%rax,4)
ret
add    %edx,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @manchester_advance_space(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = sext i32 %4 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = add i32 %10, %2
store i32 %11, i32* %9
br label %16
12: ; preds = %3
%13 = add nuw nsw i32 %4, 1
store i32 %13, i32* %1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %0, i64 %14
store i32 %2, i32* %15
br label %16
16: ; preds = %12, %7
ret void
}
int close_os_random(void *user_data) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @close_os_random(i8* nocapture readnone %0) {
ret i32 0
}
void HibernateRTCDisable(void) {
  (*((volatile unsigned long *)(0x400FC010))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<HibernateRTCDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCDisable>:
andq   $0xfffffffffffffffe,0x400fc010
40 fe
ret

LLVM IR (-O0):
define void @HibernateRTCDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
ret void
}

LLVM IR (-O2):
define void @HibernateRTCDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
ret void
}
unsigned int peak_transfer_forward(struct peak_transfer *x) {
  (void)x;
  return (1);
}


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

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

LLVM IR (-O0):
%struct.peak_transfer = type opaque
define i32 @peak_transfer_forward(%struct.peak_transfer* %0) {
%2 = alloca %struct.peak_transfer*
store %struct.peak_transfer* %0, %struct.peak_transfer** %2
%3 = load %struct.peak_transfer*, %struct.peak_transfer** %2
ret i32 1
}

LLVM IR (-O2):
%struct.peak_transfer = type opaque
define i32 @peak_transfer_forward(%struct.peak_transfer* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf9(int f, int n) { return (cbuf(f, n, 9)); }


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

x86 assembly (clang, -O2):
<cbuf9>:
mov    $0x9,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf9(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 9)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t nrf_drv_radio802154_tx_duration_get(uint8_t psdu_length, bool cca,
                                             bool ack_requested) {
  uint16_t result = 10 + (psdu_length + 1) * 2;
  if (ack_requested) {
    result += (20 + 12 + 10 + (6 * 2));
  }
  result *= 16;
  result += 6 + 40;
  if (cca) {
    result += 40 + (8 * 16) + 0;
  }
  return result;
}


x86 assembly (clang, -O0):
<nrf_drv_radio802154_tx_duration_get>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
shl    $0x1,%eax
add    $0xa,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112f <nrf_drv_radio802154_tx_duration_get+0x2f>
mov    -0x10(%rbp),%eax
add    $0x36,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x2e,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1156 <nrf_drv_radio802154_tx_duration_get+0x56>
mov    -0x10(%rbp),%eax
add    $0xa8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_drv_radio802154_tx_duration_get>:
test   %edx,%edx
lea    0xc(%rdi,%rdi,1),%ecx
lea    0x42(%rdi,%rdi,1),%eax
cmove  %ecx,%eax
shl    $0x4,%eax
lea    0xd6(%rax),%ecx
add    $0x2e,%eax
test   %esi,%esi
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @nrf_drv_radio802154_tx_duration_get(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 1
%5 = icmp eq i32 %2, 0
%6 = select i1 %5, i32 12, i32 66
%7 = add i32 %6, %4
%8 = shl nsw i32 %7, 4
%9 = icmp eq i32 %1, 0
%10 = select i1 %9, i32 46, i32 214
%11 = add nsw i32 %8, %10
ret i32 %11
}
void set_string(char **s, char *to) { *s = to; }


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

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

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

LLVM IR (-O2):
define void @set_string(i8** nocapture writeonly %0, i8* %1) {
store i8* %1, i8** %0
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int waitpid(int, int *, int);
pid_t xwaitpid(pid_t wpid, int *status, int option) {
  pid_t val;
  if ((val = waitpid(wpid, status, option)) == -1)
    fprintf(stderr, "Problem in waitpid function.\n");
  return (val);
}


x86 assembly (clang, -O0):
<xwaitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <waitpid@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    1162 <xwaitpid+0x42>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xwaitpid>:
push   %rbx
call   1040 <waitpid@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1142 <xwaitpid+0x22>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Problem in waitpid function.\0A\00"
define i32 @xwaitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i32 @waitpid(i32 %8, i32* %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %13, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Problem in waitpid function.\0A\00"
define i32 @xwaitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @waitpid(i32 %0, i32* %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int n = 0;
  char ch;
  printf("Enter a String!! \n");
  while ((ch = getchar()) != '\n')
    n++;
  printf("Length of the String: %d \n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1168 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
mov    -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
add    $0x1,%ebx
cmp    $0xa,%al
jne    1150 <main+0x20>
lea    0xe9b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter a String!! \0A\00"
@.str.1 = [27 x i8] c"Length of the String: %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %9, %0
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %5
12: ; preds = %5
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"Length of the String: %d \0A\00"
@str = [18 x i8] c"Enter a String!! \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
long hex6CharToLong(unsigned char b0, unsigned char b1, unsigned char b2,
                    unsigned char b3, unsigned char b4, unsigned char b5) {
  return (b0 << 20) + (b1 << 16) + (b2 << 12) + (b3 << 8) + (b4 << 4) + b5;
}


x86 assembly (clang, -O0):
<hex6CharToLong>:
push   %rbp
mov    %rsp,%rbp
mov    %r8d,-0x18(%rbp)
mov    %ecx,%eax
mov    -0x18(%rbp),%ecx
mov    %eax,-0x14(%rbp)
mov    %edx,%eax
mov    -0x14(%rbp),%edx
mov    %eax,-0x10(%rbp)
mov    %esi,%eax
mov    -0x10(%rbp),%esi
mov    %eax,-0xc(%rbp)
mov    %edi,%r8d
mov    -0xc(%rbp),%edi
mov    %r9b,%al
mov    %r8b,-0x1(%rbp)
mov    %dil,-0x2(%rbp)
mov    %sil,-0x3(%rbp)
mov    %dl,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x14,%eax
movzbl -0x2(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
movzbl -0x3(%rbp),%ecx
shl    $0xc,%ecx
add    %ecx,%eax
movzbl -0x4(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
movzbl -0x5(%rbp),%ecx
shl    $0x4,%ecx
add    %ecx,%eax
movzbl -0x6(%rbp),%ecx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex6CharToLong>:
mov    %edi,%eax
shl    $0x14,%rax
mov    %esi,%esi
shl    $0x10,%rsi
add    %rax,%rsi
mov    %edx,%eax
shl    $0xc,%rax
add    %rsi,%rax
mov    %ecx,%ecx
shl    $0x8,%rcx
add    %rax,%rcx
mov    %r8d,%edx
shl    $0x4,%rdx
add    %rcx,%rdx
mov    %r9d,%eax
add    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @hex6CharToLong(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5) {
%7 = zext i8 %0 to i64
%8 = shl nuw nsw i64 %7, 20
%9 = zext i8 %1 to i64
%10 = shl nuw nsw i64 %9, 16
%11 = add nuw nsw i64 %10, %8
%12 = zext i8 %2 to i64
%13 = shl nuw nsw i64 %12, 12
%14 = add nuw nsw i64 %11, %13
%15 = zext i8 %3 to i64
%16 = shl nuw nsw i64 %15, 8
%17 = add nuw nsw i64 %14, %16
%18 = zext i8 %4 to i64
%19 = shl nuw nsw i64 %18, 4
%20 = add nuw nsw i64 %17, %19
%21 = zext i8 %5 to i64
%22 = add nuw nsw i64 %20, %21
ret i64 %22
}
/* Variables and functions */
void foo(void) {
  unsigned long l = 100;
  unsigned long long ll = 100;
  unsigned int i = 100;
  unsigned short s = 100;
  unsigned char c = 1;
  l = ll >> 32;
  i = ll >> 32;
  s = ll >> 48;
  c = ll >> 56;
  s = i >> 16;
  c = i >> 24;
  c = s >> 8;
  (void)&ll;
  (void)&l;
  (void)&i;
  (void)&s;
  (void)&c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movq   $0x64,-0x8(%rbp)
movq   $0x64,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
movw   $0x64,-0x16(%rbp)
movb   $0x1,-0x17(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x20,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x20,%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x30,%rax
mov    %ax,-0x16(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x38,%rax
mov    %al,-0x17(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x10,%eax
mov    %ax,-0x16(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x18,%eax
mov    %al,-0x17(%rbp)
movzwl -0x16(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x17(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i32
%4 = alloca i16
%5 = alloca i8
store i64 100, i64* %1
store i64 100, i64* %2
store i32 100, i32* %3
store i16 100, i16* %4
store i8 1, i8* %5
%6 = load i64, i64* %2
%7 = lshr i64 %6, 32
store i64 %7, i64* %1
%8 = load i64, i64* %2
%9 = lshr i64 %8, 32
%10 = trunc i64 %9 to i32
store i32 %10, i32* %3
%11 = load i64, i64* %2
%12 = lshr i64 %11, 48
%13 = trunc i64 %12 to i16
store i16 %13, i16* %4
%14 = load i64, i64* %2
%15 = lshr i64 %14, 56
%16 = trunc i64 %15 to i8
store i8 %16, i8* %5
%17 = load i32, i32* %3
%18 = lshr i32 %17, 16
%19 = trunc i32 %18 to i16
store i16 %19, i16* %4
%20 = load i32, i32* %3
%21 = lshr i32 %20, 24
%22 = trunc i32 %21 to i8
store i8 %22, i8* %5
%23 = load i16, i16* %4
%24 = zext i16 %23 to i32
%25 = ashr i32 %24, 8
%26 = trunc i32 %25 to i8
store i8 %26, i8* %5
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_palindrome(char const *, int, int);
void test11(void) {
  const char a[] = {'b', 'o', 't', 't', 'o', 'm'};
  test_palindrome(a, sizeof(a), 1);
  test_palindrome(a, sizeof(a), 2);
  printf("\n");
}


x86 assembly (clang, -O0):
<test11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x6(%rbp),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
lea    -0x6(%rbp),%rdi
mov    $0x6,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test11>:
push   %rbx
sub    $0x10,%rsp
movw   $0x6d6f,0xc(%rsp)
movl   $0x74746f62,0x8(%rsp)
74
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test11.a = [6 x i8] c"bottom"
@.str = [2 x i8] c"\0A\00"
define void @test11() {
%1 = alloca [6 x i8]
%2 = bitcast [6 x i8]* %1 to i8*
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = call i32 @test_palindrome(i8* %3, i32 6, i32 1)
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%6 = call i32 @test_palindrome(i8* %5, i32 6, i32 2)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.test11.a = [6 x i8] c"bottom"
define void @test11() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @test_palindrome(i8* %2, i32 6, i32 1)
%4 = call i32 @test_palindrome(i8* %2, i32 6, i32 2)
%5 = call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int foo(int x) {
  puts("foo");
  return x * 2;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
add    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i32 @foo(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = shl nsw i32 %0, 1
ret i32 %3
}
/* Variables and functions */
char *strdup(char *);
char *handshake_response_strdup(char **p) {
  char *start = *p;
  while (*++(*p))
    if (**p == '\n')
      break;
  *(*p)++ = '\0';
  return strdup(start);
}


x86 assembly (clang, -O0):
<handshake_response_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
cmpb   $0x0,0x1(%rax)
je     115f <handshake_response_strdup+0x4f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    115a <handshake_response_strdup+0x4a>
jmp    115f <handshake_response_strdup+0x4f>
jmp    1127 <handshake_response_strdup+0x17>
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handshake_response_strdup>:
mov    %rdi,%rax
mov    (%rdi),%rdi
lea    0x1(%rdi),%rcx
nopw   0x0(%rax,%rax,1)
mov    %rcx,(%rax)
movzbl (%rcx),%edx
add    $0x1,%rcx
cmp    $0xa,%dl
je     1133 <handshake_response_strdup+0x23>
test   %dl,%dl
jne    1120 <handshake_response_strdup+0x10>
mov    %rcx,(%rax)
movb   $0x0,-0x1(%rcx)
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @handshake_response_strdup(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %5, %3 ], [ %2, %1 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %0
%6 = load i8, i8* %5
switch i8 %6, label %3 [
i8 0, label %7
i8 10, label %7
]
7: ; preds = %3, %3
%8 = getelementptr inbounds i8, i8* %4, i64 2
store i8* %8, i8** %0
store i8 0, i8* %5
%9 = tail call i8* @strdup(i8* %2)
ret i8* %9
}
/* Type definitions */
struct siginfoq {
  int dummy;
};
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int ENOSYS;
int siginfoq_enqueue(struct siginfoq *infoq, int sig, const siginfo_t *info) {
  (void)infoq;
  (void)sig;
  (void)info;
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<siginfoq_enqueue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ed0(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<siginfoq_enqueue>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.siginfoq = type { i32 }
@ENOSYS = global i32 0
define i32 @siginfoq_enqueue(%struct.siginfoq* %0, i32 %1, i32* %2) {
%4 = alloca %struct.siginfoq*
%5 = alloca i32
%6 = alloca i32*
store %struct.siginfoq* %0, %struct.siginfoq** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load %struct.siginfoq*, %struct.siginfoq** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = load i32, i32* @ENOSYS
%11 = sub nsw i32 0, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.siginfoq = type { i32 }
@ENOSYS = global i32 0
define i32 @siginfoq_enqueue(%struct.siginfoq* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ svalue;

/* Variables and functions */
int /*<<< orphan*/ opt_set_string(char const *, char const *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
void opt_set_int2(const char *section, const char *key, int p1, int p2) {
  char svalue[64];
  snprintf(svalue, sizeof(svalue), "(%d, %d)", p1, p2);
  opt_set_string(section, key, svalue);
}


x86 assembly (clang, -O0):
<opt_set_int2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x40,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1040 <opt_set_string@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_set_int2>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec5(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <opt_set_string@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"(%d, %d)\00"
define void @opt_set_int2(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [64 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @snprintf(i8* %10, i32 64, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%17 = call i32 @opt_set_string(i8* %14, i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"(%d, %d)\00"
define void @opt_set_int2(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca [64 x i8]
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 64, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%8 = call i32 @opt_set_string(i8* %0, i8* %1, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ShowCursor(int);
int /*<<< orphan*/ StandOut(int /*<<< orphan*/);
int /*<<< orphan*/ Underline(int /*<<< orphan*/);
void cleanup(void) {
  Underline(0);
  StandOut(0);
  ShowCursor(1);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <Underline@plt>
xor    %edi,%edi
call   1050 <StandOut@plt>
mov    $0x1,%edi
call   1030 <ShowCursor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
xor    %edi,%edi
call   1040 <Underline@plt>
xor    %edi,%edi
call   1050 <StandOut@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <ShowCursor@plt>

LLVM IR (-O0):
define void @cleanup() {
%1 = call i32 @Underline(i32 0)
%2 = call i32 @StandOut(i32 0)
%3 = call i32 @ShowCursor(i32 1)
ret void
}

LLVM IR (-O2):
define void @cleanup() {
%1 = tail call i32 @Underline(i32 0)
%2 = tail call i32 @StandOut(i32 0)
%3 = tail call i32 @ShowCursor(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char *, int);
char *cleanup_path(char *path) {
  if (!memcmp(path, "./", 2)) {
    path += 2;
    while (*path == '/')
      path++;
  }
  return path;
}


x86 assembly (clang, -O0):
<cleanup_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x2,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
jne    116c <cleanup_path+0x5c>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1167 <cleanup_path+0x57>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <cleanup_path+0x36>
jmp    116c <cleanup_path+0x5c>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_path>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x2,%edx
call   1030 <memcmp@plt>
test   %eax,%eax
jne    113d <cleanup_path+0x2d>
add    $0x1,%rbx
mov    %rbx,%rax
lea    0x1(%rax),%rbx
cmpb   $0x2f,0x1(%rax)
mov    %rbx,%rax
je     1130 <cleanup_path+0x20>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"./\00"
define i8* @cleanup_path(i8* %0) {
%2 = tail call i32 @memcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 2
br label %6
6: ; preds = %6, %4
%7 = phi i8* [ %5, %4 ], [ %10, %6 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 47
%10 = getelementptr inbounds i8, i8* %7, i64 1
br i1 %9, label %6, label %11
11: ; preds = %6, %1
%12 = phi i8* [ %0, %1 ], [ %7, %6 ]
ret i8* %12
}
/* Variables and functions */
int WEXITSTATUS(int);
int /*<<< orphan*/ printf(char *, int);
int wait(int *);
void il_catch_CHLD(int snum) {
  int pid;
  int status;
  pid = wait(&status);
  printf("parent: child process alerted with value %d\n", WEXITSTATUS(status));
}


x86 assembly (clang, -O0):
<il_catch_CHLD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <wait@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <WEXITSTATUS@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<il_catch_CHLD>:
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <wait@plt>
mov    0x4(%rsp),%edi
call   1040 <WEXITSTATUS@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [45 x i8] c"parent: child process alerted with value %d\0A\00"
define void @il_catch_CHLD(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @wait(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @WEXITSTATUS(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"parent: child process alerted with value %d\0A\00"
define void @il_catch_CHLD(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @wait(i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @WEXITSTATUS(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Type definitions */
struct rlimit {
  int /*<<< orphan*/ rlim_max;
  int /*<<< orphan*/ rlim_cur;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_AS;
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ setrlimit(int /*<<< orphan*/, struct rlimit *);
void sys_liftrlimit() {
  struct rlimit r;
  getrlimit(RLIMIT_AS, &r);
  r.rlim_cur = r.rlim_max;
  setrlimit(RLIMIT_AS, &r);
}


x86 assembly (clang, -O0):
<sys_liftrlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1040 <getrlimit@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <setrlimit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_liftrlimit>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%r14
mov    (%r14),%edi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <getrlimit@plt>
mov    (%rsp),%eax
mov    %eax,0x4(%rsp)
mov    (%r14),%edi
mov    %rbx,%rsi
call   1030 <setrlimit@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.rlimit = type { i32, i32 }
@RLIMIT_AS = global i32 0
define void @sys_liftrlimit() {
%1 = alloca %struct.rlimit
%2 = load i32, i32* @RLIMIT_AS
%3 = call i32 @getrlimit(i32 %2, %struct.rlimit* %1)
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 1
store i32 %5, i32* %6
%7 = load i32, i32* @RLIMIT_AS
%8 = call i32 @setrlimit(i32 %7, %struct.rlimit* %1)
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i32, i32 }
@RLIMIT_AS = global i32 0
define void @sys_liftrlimit() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_AS
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 1
store i32 %6, i32* %7
%8 = load i32, i32* @RLIMIT_AS
%9 = call i32 @setrlimit(i32 %8, %struct.rlimit* %1)
ret void
}