xunge/DecIR huggingface dataset:
/* Variables and functions */
int SIGINT;
int SIGQUIT;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void sigHandler(int signum) {
  int reading;
  if (signum == SIGINT) {
    printf("^C");
  }
  if (signum == SIGQUIT) {
    fprintf(stderr, "Finally!\n");
  }
}


x86 assembly (clang, -O0):
<sigHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    1149 <sigHandler+0x29>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%eax
jne    1170 <sigHandler+0x50>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigHandler>:
push   %rbx
mov    %edi,%ebx
mov    0x2ebe(%rip),%rax
cmp    %edi,(%rax)
jne    113a <sigHandler+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9f(%rip),%rax
cmp    %ebx,(%rax)
jne    115b <sigHandler+0x3b>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
pop    %rbx
jmp    1040 <fprintf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [3 x i8] c"^C\00"
@SIGQUIT = global i32 0
@stderr = global i32 0
@.str.1 = [10 x i8] c"Finally!\0A\00"
define void @sigHandler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @SIGINT
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = load i32, i32* @SIGQUIT
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@.str = [3 x i8] c"^C\00"
@SIGQUIT = global i32 0
@stderr = global i32 0
@.str.1 = [10 x i8] c"Finally!\0A\00"
define void @sigHandler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = load i32, i32* @SIGQUIT
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %9, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_model();
int /*<<< orphan*/ start_simulation();
int main(void) {
  int __retres1;
  {
    {
      init_model();
      start_simulation();
    }
    __retres1 = 0;
    return (__retres1);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_model()
%2 = tail call i32 (...) @start_simulation()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void kena(int n) {
  int i;
  for (i = 0; i < n; i++)
    printf(" ");
}


x86 assembly (clang, -O0):
<kena>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <kena+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <kena+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kena>:
push   %rbx
test   %edi,%edi
jle    112f <kena+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <kena+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @kena(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @kena(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void qrtr_close(int sock) { close(sock); }


x86 assembly (clang, -O0):
<qrtr_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qrtr_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @qrtr_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
char *colon_blow(char *field) {
  int i;
  for (i = 0; field[i]; i++)
    if (field[i] == ':')
      field[i] = '.';
  return field;
}


x86 assembly (clang, -O0):
<colon_blow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <colon_blow+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1142 <colon_blow+0x42>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x2e,(%rax,%rcx,1)
jmp    1147 <colon_blow+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <colon_blow+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<colon_blow>:
mov    %rdi,%rax
mov    %rdi,%rcx
jmp    1117 <colon_blow+0x17>
nopl   0x0(%rax,%rax,1)
movb   $0x2e,(%rcx)
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x3a,%dl
je     1110 <colon_blow+0x10>
test   %dl,%dl
jne    1113 <colon_blow+0x13>
ret

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

LLVM IR (-O2):
define i8* @colon_blow(i8* returned %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 58, label %6
]
6: ; preds = %2
store i8 46, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret i8* %0
}
int sum(int x[4]) {
  int i;
  long long ret;
  ret = 0;
  for (i = 0; i < 4; i++) {
    ret = ret + x[i];
  }
  return ret;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1146 <sum+0x46>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <sum+0x17>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
movdqu (%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
void serial_flush_input_output(int ttyfd) { tcflush(ttyfd, TCIOFLUSH); }


x86 assembly (clang, -O0):
<serial_flush_input_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_flush_input_output>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIOFLUSH = global i32 0
define void @serial_flush_input_output(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @TCIOFLUSH
%5 = call i32 @tcflush(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define void @serial_flush_input_output(i32 %0) {
%2 = load i32, i32* @TCIOFLUSH
%3 = tail call i32 @tcflush(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_random_array(long *, int);
int /*<<< orphan*/ print_array(long *, int);
int /*<<< orphan*/ quicksort(long *, int /*<<< orphan*/, int);
int main() {
  long array[2000];
  create_random_array(array, 2000);
  quicksort(array, 0, 2000);
  print_array(array, 2000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3e90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3e90(%rbp),%rdi
mov    $0x7d0,%esi
call   1030 <create_random_array@plt>
lea    -0x3e90(%rbp),%rdi
xor    %esi,%esi
mov    $0x7d0,%edx
call   1050 <quicksort@plt>
lea    -0x3e90(%rbp),%rdi
mov    $0x7d0,%esi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x3e90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3e80,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7d0,%esi
call   1030 <create_random_array@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x7d0,%edx
call   1050 <quicksort@plt>
mov    %rbx,%rdi
mov    $0x7d0,%esi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x3e80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2000 x i64]
store i32 0, i32* %1
%3 = getelementptr inbounds [2000 x i64], [2000 x i64]* %2, i64 0, i64 0
%4 = call i32 @create_random_array(i64* %3, i32 2000)
%5 = getelementptr inbounds [2000 x i64], [2000 x i64]* %2, i64 0, i64 0
%6 = call i32 @quicksort(i64* %5, i32 0, i32 2000)
%7 = getelementptr inbounds [2000 x i64], [2000 x i64]* %2, i64 0, i64 0
%8 = call i32 @print_array(i64* %7, i32 2000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2000 x i64]
%2 = bitcast [2000 x i64]* %1 to i8*
%3 = getelementptr inbounds [2000 x i64], [2000 x i64]* %1, i64 0, i64 0
%4 = call i32 @create_random_array(i64* %3, i32 2000)
%5 = call i32 @quicksort(i64* %3, i32 0, i32 2000)
%6 = call i32 @print_array(i64* %3, i32 2000)
ret i32 0
}
/* Variables and functions */
float sqrtf(float);
float gb_sqrt(float a) { return sqrtf(a); }


x86 assembly (clang, -O0):
<gb_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_sqrt>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <gb_sqrt+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @gb_sqrt(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ vga_set_480_scanlines(int);
int /*<<< orphan*/ vga_set_8font();
void vga_set_80x60(void) {
  vga_set_8font();
  vga_set_480_scanlines(0xdf);
}


x86 assembly (clang, -O0):
<vga_set_80x60>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <vga_set_8font@plt>
mov    $0xdf,%edi
call   1030 <vga_set_480_scanlines@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_set_80x60>:
push   %rax
xor    %eax,%eax
call   1040 <vga_set_8font@plt>
mov    $0xdf,%edi
pop    %rax
jmp    1030 <vga_set_480_scanlines@plt>

LLVM IR (-O0):
define void @vga_set_80x60() {
%1 = call i32 (...) @vga_set_8font()
%2 = call i32 @vga_set_480_scanlines(i32 223)
ret void
}

LLVM IR (-O2):
define void @vga_set_80x60() {
%1 = tail call i32 (...) @vga_set_8font()
%2 = tail call i32 @vga_set_480_scanlines(i32 223)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_check(scalar_t__);
scalar_t__ errno;
int /*<<< orphan*/ printf(char *, int);
int test_gcd();
int main(void) {
  int x;
  errno = 0;
  x = test_gcd();
  printf("\nThe GCD is %d\n", x);
  err_check(errno);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1050 <test_gcd@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%rdi
call   1030 <err_check@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rbx
movq   $0x0,(%rbx)
xor    %eax,%eax
call   1050 <test_gcd@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    (%rbx),%rdi
call   1030 <err_check@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [16 x i8] c"\0AThe GCD is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i64 0, i64* @errno
%3 = call i32 (...) @test_gcd()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i64, i64* @errno
%7 = call i32 @err_check(i64 %6)
ret i32 0
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [16 x i8] c"\0AThe GCD is %d\0A\00"
define i32 @main() {
store i64 0, i64* @errno
%1 = tail call i32 (...) @test_gcd()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i64, i64* @errno
%4 = tail call i32 @err_check(i64 %3)
ret i32 0
}
/* Variables and functions */
int fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int usage(char *name) {
  return fprintf(stderr,
                 "usage: %s --bus=<bus> | -b <bus> --address=<addr> | -a "
                 "<addr> [-h | --humidity | -t | --temperature]\n",
                 name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [102 x i8] c"usage: %s --bus=<bus> | -b <bus> --address=<addr> | -a <addr> [-h | --humidity | -t | --temperature]\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [102 x i8] c"usage: %s --bus=<bus> | -b <bus> --address=<addr> | -a <addr> [-h | --humidity | -t | --temperature]\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %3
}
/* Type definitions */
typedef void jset_entry;

/* Variables and functions */
scalar_t__ __bset_bkey_last(void *);
struct jset_entry *jset_keys_next(struct jset_entry *j) {
  return (void *)__bset_bkey_last(j);
}


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

x86 assembly (clang, -O2):
<jset_keys_next>:
jmp    1030 <__bset_bkey_last@plt>

LLVM IR (-O0):
%struct.jset_entry = type opaque
define %struct.jset_entry* @jset_keys_next(%struct.jset_entry* %0) {
%2 = alloca %struct.jset_entry*
store %struct.jset_entry* %0, %struct.jset_entry** %2
%3 = load %struct.jset_entry*, %struct.jset_entry** %2
%4 = bitcast %struct.jset_entry* %3 to i8*
%5 = call i64 @__bset_bkey_last(i8* %4)
%6 = inttoptr i64 %5 to i8*
%7 = bitcast i8* %6 to %struct.jset_entry*
ret %struct.jset_entry* %7
}

LLVM IR (-O2):
%struct.jset_entry = type opaque
define %struct.jset_entry* @jset_keys_next(%struct.jset_entry* %0) {
%2 = bitcast %struct.jset_entry* %0 to i8*
%3 = tail call i64 @__bset_bkey_last(i8* %2)
%4 = inttoptr i64 %3 to %struct.jset_entry*
ret %struct.jset_entry* %4
}
/* Variables and functions */
scalar_t__ isalnum(int);
scalar_t__ strchr(char *, int);
int valid_char(int c) {
  return (isalnum(c) || strchr("!#$%'()-@^_`{}~", c) ||
          ((c >= 128) && (c < 256)));
}


x86 assembly (clang, -O0):
<valid_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    118b <valid_char+0x6b>
mov    -0x4(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    118b <valid_char+0x6b>
xor    %eax,%eax
cmpl   $0x80,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1185 <valid_char+0x65>
cmpl   $0x100,-0x4(%rbp)
setl   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_char>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <isalnum@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1155 <valid_char+0x35>
lea    0xec5(%rip),%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1155 <valid_char+0x35>
and    $0xffffff80,%ebp
xor    %ebx,%ebx
cmp    $0x80,%ebp
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"!#$%'()-@^_`{}~\00"
define i32 @valid_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @strchr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 128
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 256
br label %16
16: ; preds = %13, %10
%17 = phi i1 [ false, %10 ], [ %15, %13 ]
br label %18
18: ; preds = %16, %6, %1
%19 = phi i1 [ true, %6 ], [ true, %1 ], [ %17, %16 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
@.str = [16 x i8] c"!#$%'()-@^_`{}~\00"
define i32 @valid_char(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @strchr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = and i32 %0, -128
%9 = icmp eq i32 %8, 128
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int atoi(char const *);
char *om_gps_power_path();
char *om_sysfs_readfile(char const *);
int om_gps_power_get() {
  const char *path = om_gps_power_path();
  if (path == NULL)
    return -1;
  const char *val = om_sysfs_readfile(path);
  if (val == NULL)
    return -1;
  return atoi(val);
}


x86 assembly (clang, -O0):
<om_gps_power_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <om_gps_power_path@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115a <om_gps_power_get+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <om_gps_power_get+0x5a>
mov    -0x10(%rbp),%rdi
call   1030 <om_sysfs_readfile@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117e <om_gps_power_get+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <om_gps_power_get+0x5a>
mov    -0x18(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_gps_power_get>:
push   %rax
xor    %eax,%eax
call   1040 <om_gps_power_path@plt>
test   %rax,%rax
je     1153 <om_gps_power_get+0x23>
mov    %rax,%rdi
call   1030 <om_sysfs_readfile@plt>
test   %rax,%rax
je     1153 <om_gps_power_get+0x23>
mov    %rax,%rdi
pop    %rax
jmp    1050 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @om_gps_power_get() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = call i8* (...) @om_gps_power_path()
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %17
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = call i8* @om_sysfs_readfile(i8* %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 -1, i32* %1
br label %17
14: ; preds = %8
%15 = load i8*, i8** %3
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %1
br label %17
17: ; preds = %14, %13, %7
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @om_gps_power_get() {
%1 = tail call i8* (...) @om_gps_power_path()
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i8* @om_sysfs_readfile(i8* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %4)
br label %8
8: ; preds = %6, %3, %0
%9 = phi i32 [ -1, %0 ], [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
unsigned float_twice(unsigned uf) {
  if ((uf & 0x7f800000) == 0)
    uf = (uf << 1) | (0x80000000 & uf);
  else if ((uf & 0x7f800000) != 0x7f800000)
    uf = uf + 0x00800000;
  return uf;
}


x86 assembly (clang, -O0):
<float_twice>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f800000,%eax
cmp    $0x0,%eax
jne    1131 <float_twice+0x31>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x80000000,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <float_twice+0x54>
mov    -0x4(%rbp),%eax
and    $0x7f800000,%eax
cmp    $0x7f800000,%eax
je     114f <float_twice+0x4f>
mov    -0x4(%rbp),%eax
add    $0x800000,%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <float_twice+0x54>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_twice>:
mov    %edi,%eax
mov    %edi,%ecx
and    $0x7f800000,%ecx
cmp    $0x7f800000,%ecx
je     1126 <float_twice+0x26>
test   %ecx,%ecx
jne    1121 <float_twice+0x21>
lea    (%rax,%rax,1),%ecx
and    $0x80000000,%eax
or     %ecx,%eax
ret
add    $0x800000,%eax
ret

LLVM IR (-O0):
define i32 @float_twice(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 2139095040
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = shl i32 %7, 1
%9 = load i32, i32* %2
%10 = and i32 -2147483648, %9
%11 = or i32 %8, %10
store i32 %11, i32* %2
br label %20
12: ; preds = %1
%13 = load i32, i32* %2
%14 = and i32 %13, 2139095040
%15 = icmp ne i32 %14, 2139095040
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %2
%18 = add i32 %17, 8388608
store i32 %18, i32* %2
br label %19
19: ; preds = %16, %12
br label %20
20: ; preds = %19, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @float_twice(i32 %0) {
%2 = and i32 %0, 2139095040
switch i32 %2, label %7 [
i32 0, label %3
i32 2139095040, label %9
]
3: ; preds = %1
%4 = shl i32 %0, 1
%5 = and i32 %0, -2147483648
%6 = or i32 %4, %5
br label %9
7: ; preds = %1
%8 = add i32 %0, 8388608
br label %9
9: ; preds = %1, %7, %3
%10 = phi i32 [ %6, %3 ], [ %8, %7 ], [ %0, %1 ]
ret i32 %10
}
int Bematech_FI_SubTotal(Var, Retorno) {
  return Formata("\x1b|29|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_SubTotal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_SubTotal>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B|29|\1B\00"
define i32 @Bematech_FI_SubTotal(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 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B|29|\1B\00"
define i32 @Bematech_FI_SubTotal(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
#define SIGALRM 130
#define SIGCHLD 129
#define SIGUSR1 128
int /*<<< orphan*/ exit(int);
void hubo_rt_forking_sig_handler(int signum) {
  switch (signum) {
  case SIGUSR1:
    exit(0);
    break;
  case SIGALRM:
    exit(1);
    break;
  case SIGCHLD:
    exit(1);
    break;
  }
}


x86 assembly (clang, -O0):
<hubo_rt_forking_sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1157 <hubo_rt_forking_sig_handler+0x47>
jmp    1131 <hubo_rt_forking_sig_handler+0x21>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
je     1168 <hubo_rt_forking_sig_handler+0x58>
jmp    1144 <hubo_rt_forking_sig_handler+0x34>
mov    -0x8(%rbp),%eax
sub    $0x82,%eax
je     115e <hubo_rt_forking_sig_handler+0x4e>
jmp    1172 <hubo_rt_forking_sig_handler+0x62>
xor    %edi,%edi
call   1030 <exit@plt>
mov    $0x1,%edi
call   1030 <exit@plt>
mov    $0x1,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hubo_rt_forking_sig_handler>:
push   %rax
cmp    $0x82,%edi
je     112b <hubo_rt_forking_sig_handler+0x1b>
cmp    $0x81,%edi
je     112b <hubo_rt_forking_sig_handler+0x1b>
cmp    $0x80,%edi
je     1135 <hubo_rt_forking_sig_handler+0x25>
pop    %rax
ret
mov    $0x1,%edi
call   1030 <exit@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @hubo_rt_forking_sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 128, label %4
i32 130, label %6
i32 129, label %8
]
4: ; preds = %1
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %1
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @hubo_rt_forking_sig_handler(i32 %0) {
switch i32 %0, label %8 [
i32 128, label %2
i32 130, label %4
i32 129, label %6
]
2: ; preds = %1
%3 = tail call i32 @exit(i32 0)
unreachable
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
void task(int cpu[], int timerP[], int timer[]) {
  int i = 0;
  for (i; i < 1; i++) {
    cpu[i] -= timerP[i] - 1;
    timer[i] = 0 + timerP[i];
  }
}


x86 assembly (clang, -O0):
<task>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jge    1166 <task+0x66>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
sub    $0x1,%esi
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
sub    %esi,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x0,%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <task+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<task>:
mov    (%rdi),%eax
sub    (%rsi),%eax
add    $0x1,%eax
mov    %eax,(%rdi)
mov    (%rsi),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @task(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
store i32 0, i32* %7
%8 = load i32, i32* %7
br label %9
9: ; preds = %35, %3
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 1
br i1 %11, label %12, label %38
12: ; preds = %9
%13 = load i32*, i32** %5
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = sub nsw i32 %17, 1
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = sub nsw i32 %23, %18
store i32 %24, i32* %22
%25 = load i32*, i32** %5
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %28
%30 = add nsw i32 0, %29
%31 = load i32*, i32** %6
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %31, i64 %33
store i32 %30, i32* %34
br label %35
35: ; preds = %12
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %9
38: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @task(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %0
%6 = sub i32 1, %4
%7 = add i32 %6, %5
store i32 %7, i32* %0
%8 = load i32, i32* %1
store i32 %8, i32* %2
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ perror(char *);
int rfork() {
  pid_t pid;
  if ((pid = fork()) < 0) {
    perror("fork");
  }
  return (int)pid;
}


x86 assembly (clang, -O0):
<rfork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jge    1149 <rfork+0x29>
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfork>:
push   %rbx
xor    %eax,%eax
call   1040 <fork@plt>
mov    %rax,%rbx
test   %rax,%rax
js     1134 <rfork+0x14>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec5(%rip),%rdi
call   1030 <perror@plt>
jmp    1130 <rfork+0x10>

LLVM IR (-O0):
@.str = [5 x i8] c"fork\00"
define i32 @rfork() {
%1 = alloca i64
%2 = call i64 (...) @fork()
store i64 %2, i64* %1
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i64, i64* %1
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"fork\00"
define i32 @rfork() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = trunc i64 %1 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ a(int /*<<< orphan*/);
int /*<<< orphan*/ c();
int /*<<< orphan*/ d();
void e() {
  d();
  c();
  a(0);
}


x86 assembly (clang, -O0):
<e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <d@plt>
mov    $0x0,%al
call   1040 <c@plt>
xor    %edi,%edi
call   1050 <a@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e>:
push   %rax
xor    %eax,%eax
call   1030 <d@plt>
xor    %eax,%eax
call   1040 <c@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <a@plt>

LLVM IR (-O0):
define void @e() {
%1 = call i32 (...) @d()
%2 = call i32 (...) @c()
%3 = call i32 @a(i32 0)
ret void
}

LLVM IR (-O2):
define void @e() {
%1 = tail call i32 (...) @d()
%2 = tail call i32 (...) @c()
%3 = tail call i32 @a(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cputc(int /*<<< orphan*/);
void cputs(char *k) {
  while (*k)
    cputc(*k++);
}


x86 assembly (clang, -O0):
<cputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <cputs+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <cputc@plt>
jmp    111c <cputs+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <cputs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <cputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <cputs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @cputc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int rotr(int *a, int *b, int *c) {
  int help;
  help = *a;
  *a = *c;
  *c = *b;
  *b = help;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define i32 @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
store i32 %10, i32* %8
%11 = load i32*, i32** %7
%12 = load i32, i32* %11
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = load i32*, i32** %7
store i32 %15, i32* %16
%17 = load i32, i32* %8
%18 = load i32*, i32** %6
store i32 %17, i32* %18
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
store i32 %5, i32* %0
%6 = load i32, i32* %1
store i32 %6, i32* %2
store i32 %4, i32* %1
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ block128_f;
typedef int /*<<< orphan*/ AES_KEY;

/* Variables and functions */
scalar_t__ AES_encrypt;
int /*<<< orphan*/ CRYPTO_ofb128_encrypt(unsigned char const *, unsigned char *,
                                         size_t, int /*<<< orphan*/ const *,
                                         unsigned char *, int *,
                                         int /*<<< orphan*/);
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
                        size_t length, const AES_KEY *key, unsigned char *ivec,
                        int *num) {
  CRYPTO_ofb128_encrypt(in, out, length, key, ivec, num,
                        (block128_f)AES_encrypt);
}


x86 assembly (clang, -O0):
<AES_ofb128_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x2e99(%rip),%rax
mov    (%rax),%rax
mov    %eax,(%rsp)
call   1030 <CRYPTO_ofb128_encrypt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_ofb128_encrypt>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
call   1030 <CRYPTO_ofb128_encrypt@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@AES_encrypt = global i64 0
define void @AES_ofb128_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5) {
%7 = load i64, i64* @AES_encrypt
%8 = trunc i64 %7 to i32
%9 = tail call i32 @CRYPTO_ofb128_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5, i32 %8)
ret void
}
/* Type definitions */
struct sigaction {
  int /*<<< orphan*/ sa_handler;
};

/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
void cc_user_signal_handle() {
  struct sigaction sigact;
  sigact.sa_handler = SIG_IGN;
  sigaction(SIGPIPE, &sigact, NULL);
}


x86 assembly (clang, -O0):
<cc_user_signal_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_user_signal_handle>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@SIG_IGN = global i32 0
@SIGPIPE = global i32 0
define void @cc_user_signal_handle() {
%1 = alloca %struct.sigaction
%2 = load i32, i32* @SIG_IGN
%3 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
store i32 %2, i32* %3
%4 = load i32, i32* @SIGPIPE
%5 = call i32 @sigaction(i32 %4, %struct.sigaction* %1, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@SIG_IGN = global i32 0
@SIGPIPE = global i32 0
define void @cc_user_signal_handle() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = load i32, i32* @SIG_IGN
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
store i32 %3, i32* %4
%5 = load i32, i32* @SIGPIPE
%6 = call i32 @sigaction(i32 %5, %struct.sigaction* %1, i32* null)
ret void
}
/* Variables and functions */
int m_cvt_hex(char *);
char *strchr(char *, char);
unsigned long long parse_assem2(char *str) {
  int highval, lowval;
  highval = m_cvt_hex(str);
  str = strchr(str, ',');
  if (str)
    lowval = m_cvt_hex(str + 1);
  else {
    return 0;
  }
  return (unsigned long long)((highval << 16) + lowval);
}


x86 assembly (clang, -O0):
<parse_assem2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <m_cvt_hex@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116a <parse_assem2+0x4a>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <m_cvt_hex@plt>
mov    %eax,-0x18(%rbp)
jmp    1177 <parse_assem2+0x57>
movq   $0x0,-0x8(%rbp)
jmp    1186 <parse_assem2+0x66>
mov    -0x14(%rbp),%eax
shl    $0x10,%eax
add    -0x18(%rbp),%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_assem2>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <m_cvt_hex@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1155 <parse_assem2+0x35>
add    $0x1,%rax
mov    %rax,%rdi
call   1040 <m_cvt_hex@plt>
shl    $0x10,%ebp
add    %eax,%ebp
movslq %ebp,%rax
jmp    1157 <parse_assem2+0x37>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @parse_assem2(i8* %0) {
%2 = tail call i32 @m_cvt_hex(i8* %0)
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 44)
%4 = icmp eq i8* %3, null
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = tail call i32 @m_cvt_hex(i8* %6)
%8 = shl i32 %2, 16
%9 = add nsw i32 %7, %8
%10 = sext i32 %9 to i64
br label %11
11: ; preds = %1, %5
%12 = phi i64 [ %10, %5 ], [ 0, %1 ]
ret i64 %12
}
int ld_ge_rm2(long double a1, long double *a2) { return !(((a1) >= (*a2))); }


x86 assembly (clang, -O0):
<ld_ge_rm2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ge_rm2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setb   %al
ret

LLVM IR (-O0):
define i32 @ld_ge_rm2(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80*, x86_fp80** %4
%7 = load x86_fp80, x86_fp80* %6
%8 = fcmp oge x86_fp80 %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_ge_rm2(x86_fp80 %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %1
%4 = fcmp ugt x86_fp80 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void bytswp(short int *ptr1, short int *ptr2) {
  char temp, *cptr1, *cptr2;
  *ptr2 = *ptr1;
  cptr1 = ptr2;
  cptr2 = cptr1 + 1;
  temp = *cptr1;
  *cptr1 = *cptr2;
  *cptr2 = temp;
}


x86 assembly (clang, -O0):
<bytswp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytswp>:
movzwl (%rdi),%eax
rol    $0x8,%ax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @bytswp(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i8*
store i16* %0, i16** %3
store i16* %1, i16** %4
%8 = load i16*, i16** %3
%9 = load i16, i16* %8
%10 = load i16*, i16** %4
store i16 %9, i16* %10
%11 = load i16*, i16** %4
%12 = bitcast i16* %11 to i8*
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8* %14, i8** %7
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
store i8 %16, i8* %5
%17 = load i8*, i8** %7
%18 = load i8, i8* %17
%19 = load i8*, i8** %6
store i8 %18, i8* %19
%20 = load i8, i8* %5
%21 = load i8*, i8** %7
store i8 %20, i8* %21
ret void
}

LLVM IR (-O2):
define void @bytswp(i16* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %0
%4 = bitcast i16* %1 to i8*
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = trunc i16 %3 to i8
%7 = lshr i16 %3, 8
%8 = trunc i16 %7 to i8
store i8 %8, i8* %4
store i8 %6, i8* %5
ret void
}