xunge/DecIR huggingface dataset:
unsigned long ntohlk(unsigned long source) {
  unsigned long result;
  unsigned char *bytes_s;
  unsigned char *bytes_r;
  bytes_s = (unsigned char *)(&source);
  bytes_r = (unsigned char *)(&result);
  bytes_r[0] = bytes_s[3];
  bytes_r[1] = bytes_s[2];
  bytes_r[2] = bytes_s[1];
  bytes_r[3] = bytes_s[0];
  return result;
}


x86 assembly (clang, -O0):
<ntohlk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @ntohlk(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ sector;

/* Variables and functions */
int _get_result(int);
int /*<<< orphan*/ _write_crc(int, int /*<<< orphan*/ *, int, int *);
int /*<<< orphan*/ _write_crc_byte(int, int, int *);
int /*<<< orphan*/ write(int, int *, int);
int cmd_erase(int fd, uint32_t sector) {
  uint8_t crc = 0xFF;
  _write_crc_byte(fd, 'e', &crc);
  _write_crc_byte(fd, sizeof(sector), &crc);
  _write_crc(fd, &sector, sizeof(sector), &crc);
  write(fd, &crc, 1);
  return _get_result(fd);
}


x86 assembly (clang, -O0):
<cmd_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xff,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x65,%esi
lea    -0xc(%rbp),%rdx
call   1040 <_write_crc_byte@plt>
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
lea    -0xc(%rbp),%rdx
call   1040 <_write_crc_byte@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
lea    -0xc(%rbp),%rcx
call   1050 <_write_crc@plt>
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
call   1060 <_get_result@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_erase>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %esi,0x4(%rsp)
movl   $0xff,(%rsp)
mov    %rsp,%r14
mov    $0x65,%esi
mov    %r14,%rdx
call   1040 <_write_crc_byte@plt>
mov    %ebx,%edi
mov    $0x4,%esi
mov    %r14,%rdx
call   1040 <_write_crc_byte@plt>
lea    0x4(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
mov    %r14,%rcx
call   1050 <_write_crc@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
call   1060 <_get_result@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @cmd_erase(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 255, i32* %5
%6 = load i32, i32* %3
%7 = call i32 @_write_crc_byte(i32 %6, i32 101, i32* %5)
%8 = load i32, i32* %3
%9 = call i32 @_write_crc_byte(i32 %8, i32 4, i32* %5)
%10 = load i32, i32* %3
%11 = call i32 @_write_crc(i32 %10, i32* %4, i32 4, i32* %5)
%12 = load i32, i32* %3
%13 = call i32 @write(i32 %12, i32* %5, i32 1)
%14 = load i32, i32* %3
%15 = call i32 @_get_result(i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmd_erase(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %1, i32* %3
%5 = bitcast i32* %4 to i8*
store i32 255, i32* %4
%6 = call i32 @_write_crc_byte(i32 %0, i32 101, i32* %4)
%7 = call i32 @_write_crc_byte(i32 %0, i32 4, i32* %4)
%8 = call i32 @_write_crc(i32 %0, i32* %3, i32 4, i32* %4)
%9 = call i32 @write(i32 %0, i32* %4, i32 1)
%10 = call i32 @_get_result(i32 %0)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ omp_display_env(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  omp_display_env(0);
  printf("passed\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"passed\00"
define i32 @main() {
%1 = tail call i32 @omp_display_env(i32 0)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
__attribute__((weak)) void fd_nrf8001_setup_complete(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_setup_complete() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM7_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TIM7_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM7_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
void PAN_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @PAN_RestoreConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ count_array_elements_times(int *, int, int **);
int main() {
  int array[6] = {22, 23, 22, 23, 5, 6};
  int array_count[2][6] = {};
  count_array_elements_times(array, 6, array_count);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rdi
lea    -0x50(%rbp),%rdx
mov    $0x6,%esi
call   1030 <count_array_elements_times@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rdx
mov    $0x6,%esi
call   1030 <count_array_elements_times@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [6 x i32] [i32 22, i32 23, i32 22, i32 23, i32 5, i32 6]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca [2 x [6 x i32]]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [2 x [6 x i32]]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [2 x [6 x i32]], [2 x [6 x i32]]* %2, i64 0, i64 0
%7 = bitcast [6 x i32]* %6 to i32**
%8 = call i32 @count_array_elements_times(i32* %5, i32 6, i32** %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [6 x i32] [i32 22, i32 23, i32 22, i32 23, i32 5, i32 6]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca [2 x [6 x i32]]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [2 x [6 x i32]]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = bitcast [2 x [6 x i32]]* %2 to i32**
%7 = call i32 @count_array_elements_times(i32* %5, i32 6, i32** %6)
ret i32 0
}
void switch_function() {
  int i = 34;
  switch (i) {
  case (0):
  case (1):
    return;
  case (2):
    (void)(i);
    return;
  case 3: {
    int c;
    return;
  }
  case 4:
    break;
  case 5: {
    break;
  }
  case 6: {
  }
  case 7: {
    int d;
    break;
  }
  }
}


x86 assembly (clang, -O0):
<switch_function>:
push   %rbp
mov    %rsp,%rbp
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x7,%rax
ja     1153 <switch_function+0x53>
mov    -0x18(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1153 <switch_function+0x53>
jmp    1153 <switch_function+0x53>
jmp    1153 <switch_function+0x53>
jmp    1153 <switch_function+0x53>
jmp    1153 <switch_function+0x53>
jmp    114e <switch_function+0x4e>
jmp    1153 <switch_function+0x53>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @switch_function() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 34, i32* %1
%4 = load i32, i32* %1
switch i32 %4, label %13 [
i32 0, label %5
i32 1, label %5
i32 2, label %6
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
]
5: ; preds = %0, %0
br label %13
6: ; preds = %0
%7 = load i32, i32* %1
br label %13
8: ; preds = %0
br label %13
9: ; preds = %0
br label %13
10: ; preds = %0
br label %13
11: ; preds = %0
br label %12
12: ; preds = %0, %11
br label %13
13: ; preds = %5, %6, %8, %0, %12, %10, %9
ret void
}

LLVM IR (-O2):
define void @switch_function() {
ret void
}
/* Variables and functions */
float usa_tax_calculator(int);
int main(int argc, char *argv[]) {
  float tax;
  tax = usa_tax_calculator(3201);
  ("income=%u, tax=%f\n", 3201, tax);
  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)
mov    $0xc81,%edi
call   1030 <usa_tax_calculator@plt>
movss  %xmm0,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc81,%edi
call   1030 <usa_tax_calculator@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"income=%u, tax=%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call float @usa_tax_calculator(i32 3201)
store float %7, float* %6
%8 = load float, float* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float @usa_tax_calculator(i32 3201)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(char *, int /*<<< orphan*/);
void test_hash(void) {
  f("this", 0);
  f("this", 0);
  f("is", 0);
  f("a", 0);
  f("test", 0);
}


x86 assembly (clang, -O0):
<test_hash>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
call   1030 <f@plt>
lea    0xed7(%rip),%rdi
xor    %esi,%esi
call   1030 <f@plt>
lea    0xecb(%rip),%rdi
xor    %esi,%esi
call   1030 <f@plt>
lea    0xec0(%rip),%rdi
xor    %esi,%esi
call   1030 <f@plt>
lea    0xeb4(%rip),%rdi
xor    %esi,%esi
call   1030 <f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hash>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <f@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <f@plt>
lea    0xecf(%rip),%rdi
xor    %esi,%esi
call   1030 <f@plt>
lea    0xec4(%rip),%rdi
xor    %esi,%esi
call   1030 <f@plt>
lea    0xeb8(%rip),%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <f@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"this\00"
@.str.1 = [3 x i8] c"is\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [5 x i8] c"test\00"
define void @test_hash() {
%1 = call i32 @f(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = call i32 @f(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = call i32 @f(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
%4 = call i32 @f(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 0)
%5 = call i32 @f(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"this\00"
@.str.1 = [3 x i8] c"is\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [5 x i8] c"test\00"
define void @test_hash() {
%1 = tail call i32 @f(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @f(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 @f(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
%4 = tail call i32 @f(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 0)
%5 = tail call i32 @f(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
long int hashString(char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hashString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hashString+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashString+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashString>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hashString+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashString+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hashString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_UNBLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void unblock_sig(int sig) {
  sigset_t mask, omask;
  sigemptyset(&mask);
  sigaddset(&mask, sig);
  sigprocmask(SIG_UNBLOCK, &mask, &omask);
}


x86 assembly (clang, -O0):
<unblock_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unblock_sig>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
mov    %r14,%rsi
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_UNBLOCK = global i32 0
define void @unblock_sig(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @sigemptyset(i32* %3)
%6 = load i32, i32* %2
%7 = call i32 @sigaddset(i32* %3, i32 %6)
%8 = load i32, i32* @SIG_UNBLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
@SIG_UNBLOCK = global i32 0
define void @unblock_sig(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @sigemptyset(i32* %2)
%7 = call i32 @sigaddset(i32* %2, i32 %0)
%8 = load i32, i32* @SIG_UNBLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void fct_dotted_line_end(char const *endswith) { printf(" %s\n", endswith); }


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

x86 assembly (clang, -O2):
<fct_dotted_line_end>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c" %s\0A\00"
define void @fct_dotted_line_end(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2c_ClearSTAT(int, unsigned char);
void i2c1_ClearSTAT(unsigned char i2cstats) { i2c_ClearSTAT(1, i2cstats); }


x86 assembly (clang, -O0):
<i2c1_ClearSTAT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
movzbl -0x1(%rbp),%esi
call   1030 <i2c_ClearSTAT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c1_ClearSTAT>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <i2c_ClearSTAT@plt>

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

LLVM IR (-O2):
define void @i2c1_ClearSTAT(i8 zeroext %0) {
%2 = tail call i32 @i2c_ClearSTAT(i32 1, i8 zeroext %0)
ret void
}
/* Variables and functions */
unsigned long long __data2host8(unsigned long long);
int /*<<< orphan*/ read_or_die(unsigned long long *, int);
unsigned long long read8(void) {
  unsigned long long data;
  read_or_die(&data, 8);
  return __data2host8(data);
}


x86 assembly (clang, -O0):
<read8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1040 <read_or_die@plt>
mov    -0x8(%rbp),%rdi
call   1030 <__data2host8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read8>:
push   %rax
mov    %rsp,%rdi
mov    $0x8,%esi
call   1040 <read_or_die@plt>
mov    (%rsp),%rdi
call   1030 <__data2host8@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @read8() {
%1 = alloca i64
%2 = call i32 @read_or_die(i64* %1, i32 8)
%3 = load i64, i64* %1
%4 = call i64 @__data2host8(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @read8() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @read_or_die(i64* %1, i32 8)
%4 = load i64, i64* %1
%5 = call i64 @__data2host8(i64 %4)
ret i64 %5
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
double bench_elapsed_s(struct timespec const *, struct timespec *);
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double bench_end(const struct timespec *start_t) {
  struct timespec end_t;
  clock_gettime(CLOCK_REALTIME, &end_t);
  return bench_elapsed_s(start_t, &end_t);
}


x86 assembly (clang, -O0):
<bench_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <bench_elapsed_s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench_end>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%r14
mov    %r14,%rsi
call   1030 <clock_gettime@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <bench_elapsed_s@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define double @bench_end(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca %struct.timespec
store %struct.timespec* %0, %struct.timespec** %2
%4 = load i32, i32* @CLOCK_REALTIME
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %3)
%6 = load %struct.timespec*, %struct.timespec** %2
%7 = call double @bench_elapsed_s(%struct.timespec* %6, %struct.timespec* %3)
ret double %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define double @bench_end(%struct.timespec* %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = load i32, i32* @CLOCK_REALTIME
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %2)
%6 = call double @bench_elapsed_s(%struct.timespec* %0, %struct.timespec* %2)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char command[50];
  strcpy(command, "ls -l");
  system(command);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xed4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ls -l\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"ls -l\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @system(i8* %2)
ret i32 0
}
void rop3_100_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T | S;
  stk2 = *D & stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
or     %esi,%edx
and    (%rdi),%dl
xor    %sil,%dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_100_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int embed_quaddobl_system(int d) {
  int fail;
  int *b;
  double *c;
  fail = _ada_use_c2phc(260, &d, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<embed_quaddobl_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x104,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<embed_quaddobl_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x104,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @embed_quaddobl_system(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 260, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @embed_quaddobl_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 260, i32* %2, i32* undef, double* undef)
ret i32 %3
}
void rk29_sdmmc_set_iomux_mmc2(unsigned int bus_width) { ; }


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

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

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

LLVM IR (-O2):
define void @rk29_sdmmc_set_iomux_mmc2(i32 %0) {
ret void
}
/* Variables and functions */
int get_frame_height();
int get_frame_width();
int get_frame_size(void) {
  return get_frame_width() * get_frame_height() * 3 / 2;
}


x86 assembly (clang, -O0):
<get_frame_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_frame_width@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_frame_height@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
imul   %ecx,%eax
imul   $0x3,%eax,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_frame_size>:
push   %rbx
xor    %eax,%eax
call   1030 <get_frame_width@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <get_frame_height@plt>
imul   %ebx,%eax
lea    (%rax,%rax,2),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_frame_size() {
%1 = call i32 (...) @get_frame_width()
%2 = call i32 (...) @get_frame_height()
%3 = mul nsw i32 %1, %2
%4 = mul nsw i32 %3, 3
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_frame_size() {
%1 = tail call i32 (...) @get_frame_width()
%2 = tail call i32 (...) @get_frame_height()
%3 = mul i32 %1, 3
%4 = mul i32 %3, %2
%5 = sdiv i32 %4, 2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegReadMAC(int /*<<< orphan*/, int,
                                    int /*<<< orphan*/ *);
void wiznetGetSocketDestMAC(uint8_t socket, uint8_t *mac) {
  wiznetRegReadMAC(socket, (0x0000 + 0x0006), mac);
}


x86 assembly (clang, -O0):
<wiznetGetSocketDestMAC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x6,%esi
call   1030 <wiznetRegReadMAC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiznetGetSocketDestMAC>:
mov    %rsi,%rdx
mov    $0x6,%esi
jmp    1030 <wiznetRegReadMAC@plt>

LLVM IR (-O0):
define void @wiznetGetSocketDestMAC(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 @wiznetRegReadMAC(i32 %5, i32 6, i32* %6)
ret void
}

LLVM IR (-O2):
define void @wiznetGetSocketDestMAC(i32 %0, i32* %1) {
%3 = tail call i32 @wiznetRegReadMAC(i32 %0, i32 6, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(unsigned char);
void mov_m8_imm8(unsigned char *m8, unsigned char imm8) {
  put8(0xC6);
  put8(0x05);
  put32((unsigned int)(m8));
  put8(imm8);
}


x86 assembly (clang, -O0):
<mov_m8_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0xc6,%edi
call   1030 <put8@plt>
mov    $0x5,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
movzbl -0x9(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_m8_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xc6,%edi
call   1030 <put8@plt>
mov    $0x5,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
call   1040 <put32@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @mov_m8_imm8(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = call i32 @put8(i8 zeroext -58)
%6 = call i32 @put8(i8 zeroext 5)
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i32
%9 = call i32 @put32(i32 %8)
%10 = load i8, i8* %4
%11 = call i32 @put8(i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @mov_m8_imm8(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -58)
%4 = tail call i32 @put8(i8 zeroext 5)
%5 = ptrtoint i8* %0 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @put32(i32 %6)
%8 = tail call i32 @put8(i8 zeroext %1)
ret void
}
/* Variables and functions */
int readlink(char const *, char *, int);
int slate_ReadSymbolicLinkInto(const char *path, char *buffer, int bufferSize) {
  return readlink(path, buffer, bufferSize);
}


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

x86 assembly (clang, -O2):
<slate_ReadSymbolicLinkInto>:
jmp    1030 <readlink@plt>

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

LLVM IR (-O2):
define i32 @slate_ReadSymbolicLinkInto(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @readlink(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
int /*<<< orphan*/ g2_set_background(int /*<<< orphan*/, int /*<<< orphan*/);
void g2_set_background_(float *dev, float *color) {
  g2_set_background(dtoi(*dev), dtoi(*color));
}


x86 assembly (clang, -O0):
<g2_set_background_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <dtoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <dtoi@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <g2_set_background@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_set_background_>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <dtoi@plt>
mov    %eax,%ebp
movss  (%rbx),%xmm0
call   1030 <dtoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <g2_set_background@plt>

LLVM IR (-O0):
define void @g2_set_background_(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = call i32 @dtoi(float %6)
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = call i32 @dtoi(float %9)
%11 = call i32 @g2_set_background(i32 %7, i32 %10)
ret void
}

LLVM IR (-O2):
define void @g2_set_background_(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = tail call i32 @dtoi(float %3)
%5 = load float, float* %1
%6 = tail call i32 @dtoi(float %5)
%7 = tail call i32 @g2_set_background(i32 %4, i32 %6)
ret void
}
main() {
  int a;
  {
    int b;
    { int c, b; }
    { int d, a; }
  }
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ property;
};
typedef TYPE_1__ XSelectionRequestEvent;

/* Variables and functions */
unsigned long get_XSelectionRequestEvent_property(void *_p) {
  return (unsigned long)((XSelectionRequestEvent *)_p)->property;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XSelectionRequestEvent_property(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XSelectionRequestEvent_property(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
IR0A1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((*p0) <= (*((unsigned char *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    $0xa98ac7,%ecx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jg     1141 <IR0A1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <IR0A1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0A1>:
mov    (%r8),%cl
xor    %eax,%eax
cmp    0xa98ac7,%cl
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @IR0A1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = load i8, i8* %4
%8 = load i8, i8* inttoptr (i64 11111111 to i8*)
%9 = icmp ule i8 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void print_cpu_stall_fast_no_hz(char *cp, int cpu) { *cp = '\0'; }


x86 assembly (clang, -O0):
<print_cpu_stall_fast_no_hz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cpu_stall_fast_no_hz>:
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @print_cpu_stall_fast_no_hz(i8* nocapture writeonly %0, i32 %1) {
store i8 0, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int get_cpu_num(void) {
  long nprocs = -1;
  long nprocs_max = -1;
  printf("Could not determine number of CPUs\n");
  return 0;
}


x86 assembly (clang, -O0):
<get_cpu_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"Could not determine number of CPUs\0A\00"
define i32 @get_cpu_num() {
%1 = alloca i64
%2 = alloca i64
store i64 -1, i64* %1
store i64 -1, i64* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"Could not determine number of CPUs\00"
define i32 @get_cpu_num() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct S_MULTI_ARRAY {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destructor_multiarray1(void *);
void destructor_multiarray1_const(struct S_MULTI_ARRAY const *const A) {
  destructor_multiarray1((void *)A);
}


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

x86 assembly (clang, -O2):
<destructor_multiarray1_const>:
jmp    1030 <destructor_multiarray1@plt>

LLVM IR (-O0):
%struct.S_MULTI_ARRAY = type { i32 }
define void @destructor_multiarray1_const(%struct.S_MULTI_ARRAY* %0) {
%2 = alloca %struct.S_MULTI_ARRAY*
store %struct.S_MULTI_ARRAY* %0, %struct.S_MULTI_ARRAY** %2
%3 = load %struct.S_MULTI_ARRAY*, %struct.S_MULTI_ARRAY** %2
%4 = bitcast %struct.S_MULTI_ARRAY* %3 to i8*
%5 = call i32 @destructor_multiarray1(i8* %4)
ret void
}

LLVM IR (-O2):
%struct.S_MULTI_ARRAY = type { i32 }
define void @destructor_multiarray1_const(%struct.S_MULTI_ARRAY* %0) {
%2 = bitcast %struct.S_MULTI_ARRAY* %0 to i8*
%3 = tail call i32 @destructor_multiarray1(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: bandwidth [--slow] [--fast] [--faster] [--fastest] [--title "
         "string]\n");
  printf("Usage for starting network tests: bandwidth --network <ipaddr1> "
         "[<ipaddr2...] [--port <port#>]\n");
  printf("Usage for receiving network tests: bandwidth --transponder [--port "
         "<port#>]\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
call   1030 <printf@plt>
lea    0xf69(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6a(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"Usage: bandwidth [--slow] [--fast] [--faster] [--fastest] [--title string]\0A\00"
@.str.1 = [96 x i8] c"Usage for starting network tests: bandwidth --network <ipaddr1> [<ipaddr2...] [--port <port#>]\0A\00"
@.str.2 = [77 x i8] c"Usage for receiving network tests: bandwidth --transponder [--port <port#>]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [75 x i8] c"Usage: bandwidth [--slow] [--fast] [--faster] [--fastest] [--title string]\00"
@str.3 = [95 x i8] c"Usage for starting network tests: bandwidth --network <ipaddr1> [<ipaddr2...] [--port <port#>]\00"
@str.4 = [76 x i8] c"Usage for receiving network tests: bandwidth --transponder [--port <port#>]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
void freeStrings(char **strings, int size) {
  for (int i = 0; i < size; i++)
    if (strings[i])
      free(strings[i]);
  free(strings);
}


x86 assembly (clang, -O0):
<freeStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <freeStrings+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1156 <freeStrings+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    115b <freeStrings+0x4b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeStrings+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeStrings>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1149 <freeStrings+0x39>
mov    %esi,%r15d
xor    %ebx,%ebx
jmp    1139 <freeStrings+0x29>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     1149 <freeStrings+0x39>
mov    (%r14,%rbx,8),%rdi
test   %rdi,%rdi
je     1130 <freeStrings+0x20>
call   1030 <free@plt>
jmp    1130 <freeStrings+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeStrings(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %14, %2
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %14
%9 = phi i64 [ 0, %4 ], [ %15, %14 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %8
tail call void @free(i8* %11)
br label %14
14: ; preds = %8, %13
%15 = add nuw nsw i64 %9, 1
%16 = icmp eq i64 %15, %5
br i1 %16, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ SingleVersion();
int /*<<< orphan*/ ThreeVersionsSameAttr();
int /*<<< orphan*/ TwoVersions();
int /*<<< orphan*/ TwoVersionsSameAttr();
void usages() {
  SingleVersion();
  TwoVersions();
  TwoVersionsSameAttr();
  ThreeVersionsSameAttr();
}


x86 assembly (clang, -O0):
<usages>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <SingleVersion@plt>
mov    $0x0,%al
call   1060 <TwoVersions@plt>
mov    $0x0,%al
call   1050 <TwoVersionsSameAttr@plt>
mov    $0x0,%al
call   1030 <ThreeVersionsSameAttr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usages>:
push   %rax
xor    %eax,%eax
call   1040 <SingleVersion@plt>
xor    %eax,%eax
call   1060 <TwoVersions@plt>
xor    %eax,%eax
call   1050 <TwoVersionsSameAttr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ThreeVersionsSameAttr@plt>

LLVM IR (-O0):
define void @usages() {
%1 = call i32 (...) @SingleVersion()
%2 = call i32 (...) @TwoVersions()
%3 = call i32 (...) @TwoVersionsSameAttr()
%4 = call i32 (...) @ThreeVersionsSameAttr()
ret void
}

LLVM IR (-O2):
define void @usages() {
%1 = tail call i32 (...) @SingleVersion()
%2 = tail call i32 (...) @TwoVersions()
%3 = tail call i32 (...) @TwoVersionsSameAttr()
%4 = tail call i32 (...) @ThreeVersionsSameAttr()
ret void
}
/* Variables and functions */
int *malloc(int /*<<< orphan*/);
void bug(char t) {
  int *array = malloc(0);
  array[0] = t;
}


x86 assembly (clang, -O0):
<bug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movsbl -0x1(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bug(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32*
store i8 %0, i8* %2
%4 = call i32* @malloc(i32 0)
store i32* %4, i32** %3
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @bug(i8 signext %0) {
%2 = tail call i32* @malloc(i32 0)
ret void
}