xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *, double *);
void scan_data(char *operator, double * right_operand) {
  scanf(" %c %lf", operator, right_operand);
}


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

x86 assembly (clang, -O2):
<scan_data>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <scanf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c" %c %lf\00"
define void @scan_data(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
store i8* %0, i8** %3
store double* %1, double** %4
%5 = load i8*, i8** %3
%6 = load double*, double** %4
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5, double* %6)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c" %c %lf\00"
define void @scan_data(i8* %0, double* %1) {
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, double* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x03() {
  Assert_real((isalnum(3) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              20, ("isalnum should be 0 for 0x03"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x03>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x14,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x03>:
push   %rax
mov    $0x3,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x14,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x03\00"
define void @t_isalnum_0x03() {
%1 = call i64 @isalnum(i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x03\00"
define void @t_isalnum_0x03() {
%1 = tail call i64 @isalnum(i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ imprime_matrices();
int /*<<< orphan*/ imprime_matriz_resultado();
int /*<<< orphan*/ multiplica_matrices();
int main(void) {
  imprime_matrices();
  multiplica_matrices();
  imprime_matriz_resultado();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @imprime_matrices()
%2 = tail call i32 (...) @multiplica_matrices()
%3 = tail call i32 (...) @imprime_matriz_resultado()
ret i32 0
}
/* Variables and functions */
float floorf(float);
float __glsl_floor(float x) { return floorf(x); }


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

x86 assembly (clang, -O2):
<__glsl_floor>:
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define float @__glsl_floor(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.floor.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @__glsl_floor(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
ret float %2
}
/* Variables and functions */
float sqrtf(float const);
float inverseSQRT(const float in_S) { return 1.0f / sqrtf(in_S); }


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

x86 assembly (clang, -O2):
<inverseSQRT>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111f <inverseSQRT+0xf>
sqrtss %xmm0,%xmm0
jmp    1124 <inverseSQRT+0x14>
call   1030 <sqrtf@plt>
movss  0xed4(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @inverseSQRT(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrtf(float %3)
%5 = fdiv float 1.000000e+00, %4
ret float %5
}

LLVM IR (-O2):
define float @inverseSQRT(float %0) {
%2 = tail call float @sqrtf(float %0)
%3 = fdiv float 1.000000e+00, %2
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushreal8array_(char *x, unsigned int *n) { pushNarray(x, (*n * 8)); }


x86 assembly (clang, -O0):
<pushreal8array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x3,%esi
call   1030 <pushNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushreal8array_>:
mov    (%rsi),%esi
shl    $0x3,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushreal8array_(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
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 8
%9 = call i32 @pushNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushreal8array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 3
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
int rl_vi_append_eol(count, key)
int count __attribute__((unused)), key;
{
  rl_end_of_line(1, key);
  rl_vi_append_mode(1, key);
  return (0);
}


x86 assembly (clang, -O0):
<rl_vi_append_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <rl_end_of_line@plt>
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <rl_vi_append_mode@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_vi_append_eol>:
push   %rbx
mov    %esi,%ebx
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <rl_end_of_line@plt>
mov    $0x1,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <rl_vi_append_mode@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rl_vi_append_eol(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_end_of_line to i32 (i32, i32, ...)*)(i32 1, i32 %5)
%7 = load i32, i32* %4
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_vi_append_mode to i32 (i32, i32, ...)*)(i32 1, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @rl_vi_append_eol(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_end_of_line to i32 (i32, i32, ...)*)(i32 1, i32 %1)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_vi_append_mode to i32 (i32, i32, ...)*)(i32 1, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BFS_traversal(int);
int /*<<< orphan*/ create_graph(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int no_of_vertices;
  printf("enter no of vertices : ");
  scanf("%d", &no_of_vertices);
  create_graph(no_of_vertices);
  BFS_traversal(no_of_vertices);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1060 <create_graph@plt>
mov    -0x4(%rbp),%edi
call   1040 <BFS_traversal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1060 <create_graph@plt>
mov    0x4(%rsp),%edi
call   1040 <BFS_traversal@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"enter no of vertices : \00"
@.str.1 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @create_graph(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @BFS_traversal(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"enter no of vertices : \00"
@.str.1 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @create_graph(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @BFS_traversal(i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets_or_exit(char *, int, int /*<<< orphan*/ *);
void skip_headers(FILE *client) {
  char buf[1024];
  while (buf[0] != '\r' && buf[1] != '\n') {
    fgets_or_exit(buf, sizeof(buf), client);
  }
}


x86 assembly (clang, -O0):
<skip_headers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
movsbl -0x410(%rbp),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x411(%rbp)
je     114a <skip_headers+0x3a>
movsbl -0x40f(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x411(%rbp)
mov    -0x411(%rbp),%al
test   $0x1,%al
jne    115d <skip_headers+0x4d>
jmp    1177 <skip_headers+0x67>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1030 <fgets_or_exit@plt>
jmp    111f <skip_headers+0xf>
add    $0x420,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @skip_headers(i32* %0) {
%2 = alloca i32*
%3 = alloca [1024 x i8]
store i32* %0, i32** %2
br label %4
4: ; preds = %16, %1
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 13
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 10
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %20
16: ; preds = %14
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%18 = load i32*, i32** %2
%19 = call i32 @fgets_or_exit(i8* %17, i32 1024, i32* %18)
br label %4
20: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @skip_headers(i32* %0) {
ret void
}
void ath9k_debug_remove_root(void) {}


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

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

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

LLVM IR (-O2):
define void @ath9k_debug_remove_root() {
ret void
}
void writew(unsigned short val, void *addr) {
  *(volatile unsigned short *)addr = val;
}


x86 assembly (clang, -O0):
<writew>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writew>:
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @writew(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i16*
store volatile i16 %5, i16* %7
ret void
}

LLVM IR (-O2):
define void @writew(i16 zeroext %0, i8* %1) {
%3 = bitcast i8* %1 to i16*
store volatile i16 %0, i16* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
unsigned long I2STxFIFOLimitGet(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  return ((*((volatile unsigned long *)(ulBase + 0x0000000C))));
}


x86 assembly (clang, -O0):
<I2STxFIFOLimitGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxFIFOLimitGet>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0xc(%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @I2STxFIFOLimitGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074085888
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 12
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @I2STxFIFOLimitGet(i64 %0) {
%2 = icmp eq i64 %0, 1074085888
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 12
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
ret i64 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t xorshift32(uint32_t *state) {
  uint32_t x = *state;
  x ^= x << 13;
  x ^= x >> 17;
  x ^= x << 5;
  *state = x;
  return x;
}


x86 assembly (clang, -O0):
<xorshift32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0xd,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x11,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorshift32>:
mov    (%rdi),%eax
mov    %eax,%ecx
shl    $0xd,%ecx
xor    %eax,%ecx
mov    %ecx,%edx
sar    $0x11,%edx
xor    %ecx,%edx
mov    %edx,%eax
shl    $0x5,%eax
xor    %edx,%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @xorshift32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 13
%4 = xor i32 %3, %2
%5 = ashr i32 %4, 17
%6 = xor i32 %5, %4
%7 = shl i32 %6, 5
%8 = xor i32 %7, %6
store i32 %8, i32* %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: plmpower -d device \n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: plmpower -d device \0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: plmpower -d device \0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help() {
  printf("vfdctl v0.7.1 - usage:\n\tvfdctl [[-c] text] [-s speed] [-b file] "
         "[+sym] [-sym] ...\n\t-c\tcentered output\n\t-s\tset animation speed "
         "in milliseconds for -b output\n\t-b\toutput content of bitmap "
         "file\n\t-x\tplay vfdx file (animated)\n\tto set symbols use e.g. "
         "+usb or -usb\n\tavailable symbols are "
         "usb,hd,hdd,lock,bt,mp3,music,dd,mail,mute,play,pause,ff,fr,rec,"
         "clock\n\tspecial modes are: \n\tvfdctl demomode to start demo "
         "loop\n\tvfdctl input [text] for remote control input mode\n\tvfdctl "
         "iconstate [iconname] to get the current icon state\n");
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [518 x i8] c"vfdctl v0.7.1 - usage:\0A\09vfdctl [[-c] text] [-s speed] [-b file] [+sym] [-sym] ...\0A\09-c\09centered output\0A\09-s\09set animation speed in milliseconds for -b output\0A\09-b\09output content of bitmap file\0A\09-x\09play vfdx file (animated)\0A\09to set symbols use e.g. +usb or -usb\0A\09available symbols are usb,hd,hdd,lock,bt,mp3,music,dd,mail,mute,play,pause,ff,fr,rec,clock\0A\09special modes are: \0A\09vfdctl demomode to start demo loop\0A\09vfdctl input [text] for remote control input mode\0A\09vfdctl iconstate [iconname] to get the current icon state\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([518 x i8], [518 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [517 x i8] c"vfdctl v0.7.1 - usage:\0A\09vfdctl [[-c] text] [-s speed] [-b file] [+sym] [-sym] ...\0A\09-c\09centered output\0A\09-s\09set animation speed in milliseconds for -b output\0A\09-b\09output content of bitmap file\0A\09-x\09play vfdx file (animated)\0A\09to set symbols use e.g. +usb or -usb\0A\09available symbols are usb,hd,hdd,lock,bt,mp3,music,dd,mail,mute,play,pause,ff,fr,rec,clock\0A\09special modes are: \0A\09vfdctl demomode to start demo loop\0A\09vfdctl input [text] for remote control input mode\0A\09vfdctl iconstate [iconname] to get the current icon state\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([517 x i8], [517 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *parson_strndup(const char *string, size_t n) {
  char *output_string = (char *)malloc(n + 1);
  if (!output_string) {
    return NULL;
  }
  output_string[n] = '\0';
  strncpy(output_string, string, n);
  return output_string;
}


x86 assembly (clang, -O0):
<parson_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <parson_strndup+0x39>
movq   $0x0,-0x8(%rbp)
jmp    117e <parson_strndup+0x5e>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parson_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1151 <parson_strndup+0x31>
mov    %rax,%rbx
movb   $0x0,(%rax,%r14,1)
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
jmp    1153 <parson_strndup+0x33>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @parson_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %8
%9 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %1)
br label %10
10: ; preds = %2, %7
%11 = phi i8* [ %5, %7 ], [ null, %2 ]
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stderr;
int vfprintf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int test_vprintf_stderr(const char *fmt, va_list ap) {
  return vfprintf(stderr, fmt, ap);
}


x86 assembly (clang, -O0):
<test_vprintf_stderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vprintf_stderr>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
define i32 @test_vprintf_stderr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @vfprintf(i32 %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @test_vprintf_stderr(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
void log_trace(char *message) {
  printf("\n  %s", message);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<log_trace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_trace>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\0A %s\00"
@stdout = global i32 0
define void @log_trace(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
__attribute__((always_)) void clear_bit_unlock(unsigned nr,
                                               volatile unsigned long *addr) {
  __asm__ __volatile__("" : : : "memory");
  clear_bit(nr, addr);
}


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

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

LLVM IR (-O0):
define void @clear_bit_unlock(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = load i64*, i64** %4
%7 = call i32 (i32, i64*, ...) bitcast (i32 (...)* @clear_bit to i32 (i32, i64*, ...)*)(i32 %5, i64* %6)
ret void
}

LLVM IR (-O2):
define void @clear_bit_unlock(i32 %0, i64* %1) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%3 = tail call i32 (i32, i64*, ...) bitcast (i32 (...)* @clear_bit to i32 (i32, i64*, ...)*)(i32 %0, i64* %1)
ret void
}
int getNum(long long int num, unsigned int n) {
  while (n != 0) {
    num /= 10;
    n--;
  }
  return num % 10;
}


x86 assembly (clang, -O0):
<getNum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1135 <getNum+0x35>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <getNum+0xb>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNum>:
movabs $0x6666666666666667,%r9
66 66 66
test   %esi,%esi
je     117c <getNum+0x7c>
lea    -0x1(%rsi),%r8d
mov    %esi,%r10d
and    $0x3,%r10d
je     1141 <getNum+0x41>
xor    %ecx,%ecx
nopl   (%rax)
mov    %rdi,%rax
imul   %r9
mov    %rdx,%rdi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdi
add    %rax,%rdi
add    $0x1,%ecx
cmp    %ecx,%r10d
jne    1120 <getNum+0x20>
sub    %ecx,%esi
cmp    $0x3,%r8d
jb     117c <getNum+0x7c>
movabs $0x346dc5d63886594b,%rcx
c5 6d 34
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rdi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xb,%rdi
add    %rax,%rdi
add    $0xfffffffc,%esi
jne    1160 <getNum+0x60>
mov    %rdi,%rax
imul   %r9
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x2,%rdx
add    %eax,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @getNum(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i64, i64* %3
%10 = sdiv i64 %9, 10
store i64 %10, i64* %3
%11 = load i32, i32* %4
%12 = add i32 %11, -1
store i32 %12, i32* %4
br label %5
13: ; preds = %5
%14 = load i64, i64* %3
%15 = srem i64 %14, 10
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @getNum(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %27, label %4
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 3
%7 = icmp eq i32 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %4, %8
%9 = phi i32 [ %13, %8 ], [ %1, %4 ]
%10 = phi i64 [ %12, %8 ], [ %0, %4 ]
%11 = phi i32 [ %14, %8 ], [ 0, %4 ]
%12 = sdiv i64 %10, 10
%13 = add i32 %9, -1
%14 = add i32 %11, 1
%15 = icmp eq i32 %14, %6
br i1 %15, label %16, label %8
16: ; preds = %8, %4
%17 = phi i64 [ undef, %4 ], [ %12, %8 ]
%18 = phi i32 [ %1, %4 ], [ %13, %8 ]
%19 = phi i64 [ %0, %4 ], [ %12, %8 ]
%20 = icmp ult i32 %5, 3
br i1 %20, label %27, label %21
21: ; preds = %16, %21
%22 = phi i32 [ %25, %21 ], [ %18, %16 ]
%23 = phi i64 [ %24, %21 ], [ %19, %16 ]
%24 = sdiv i64 %23, 10000
%25 = add i32 %22, -4
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %21
27: ; preds = %16, %21, %2
%28 = phi i64 [ %0, %2 ], [ %17, %16 ], [ %24, %21 ]
%29 = srem i64 %28, 10
%30 = trunc i64 %29 to i32
ret i32 %30
}
long long bit29() { return 0x0000000020000000LL; }


x86 assembly (clang, -O0):
<bit29>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20000000,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @bit29() {
ret i64 536870912
}

LLVM IR (-O2):
define i64 @bit29() {
ret i64 536870912
}
/* Variables and functions */
scalar_t__ ceil(int /*<<< orphan*/);
scalar_t__ isPow2(unsigned int);
int /*<<< orphan*/ log2(double);
unsigned int ceilPow2(unsigned int x) {
  return (isPow2(x)) ? x : 1u << (int)ceil(log2((double)x));
}


x86 assembly (clang, -O0):
<ceilPow2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isPow2@plt>
cmp    $0x0,%rax
je     1158 <ceilPow2+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1178 <ceilPow2+0x48>
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
call   1030 <log2@plt>
mov    %eax,%edi
call   1050 <ceil@plt>
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilPow2>:
push   %rbx
mov    %edi,%ebx
call   1040 <isPow2@plt>
test   %rax,%rax
jne    1159 <ceilPow2+0x29>
mov    %ebx,%eax
cvtsi2sd %rax,%xmm0
call   1030 <log2@plt>
mov    %eax,%edi
call   1050 <ceil@plt>
mov    $0x1,%ebx
mov    %eax,%ecx
shl    %cl,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ceilPow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isPow2(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %15
8: ; preds = %1
%9 = load i32, i32* %2
%10 = uitofp i32 %9 to double
%11 = call i32 @log2(double %10)
%12 = call i64 @ceil(i32 %11)
%13 = trunc i64 %12 to i32
%14 = shl i32 1, %13
br label %15
15: ; preds = %8, %6
%16 = phi i32 [ %7, %6 ], [ %14, %8 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @ceilPow2(i32 %0) {
%2 = tail call i64 @isPow2(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = uitofp i32 %0 to double
%6 = tail call i32 @log2(double %5)
%7 = tail call i64 @ceil(i32 %6)
%8 = trunc i64 %7 to i32
%9 = shl nuw i32 1, %8
br label %10
10: ; preds = %1, %4
%11 = phi i32 [ %9, %4 ], [ %0, %1 ]
ret i32 %11
}
void trocaAnterior(int *v, int pos) {
  int aux = v[pos];
  v[pos] = v[pos - 1];
  v[pos - 1] = aux;
}


x86 assembly (clang, -O0):
<trocaAnterior>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<trocaAnterior>:
movslq %esi,%rax
rolq   $0x20,-0x4(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @trocaAnterior(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = add nsw i32 %1, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %4
store i32 %5, i32* %8
ret void
}
double atan2(double x, double y) {
  double r;
  __asm__ __volatile__("fpatan" : "=t"(r) : "0"(x), "u"(y));
  return r;
}


x86 assembly (clang, -O0):
<atan2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
fldl   -0x20(%rbp)
fldl   -0x28(%rbp)
fxch   %st(1)
fpatan
fstp   %st(1)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan2>:
movsd  %xmm0,-0x8(%rsp)
movsd  %xmm1,-0x10(%rsp)
fldl   -0x8(%rsp)
fldl   -0x10(%rsp)
fxch   %st(1)
fpatan
fstp   %st(1)
fstpl  -0x18(%rsp)
movsd  -0x18(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double asm sideeffect "fpatan", "={st},0,{st(1)},~{dirflag},~{fpsr},~{flags}"(double %6, double %7)
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @atan2(double %0, double %1) {
%3 = tail call double asm sideeffect "fpatan", "={st},0,{st(1)},~{dirflag},~{fpsr},~{flags}"(double %0, double %1)
ret double %3
}
void decrementsv(sv, class) register int *sv;
register int class;
{
  register int svi;
  while ((svi = *sv++) != 0) {
    if (svi == class && *sv < class) {
      sv[-1] = svi - 1;
      break;
    }
  }
}


x86 assembly (clang, -O0):
<decrementsv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     115a <decrementsv+0x5a>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1155 <decrementsv+0x55>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jge    1155 <decrementsv+0x55>
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,-0x4(%rax)
jmp    115a <decrementsv+0x5a>
jmp    110b <decrementsv+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrementsv>:
mov    (%rdi),%eax
test   %eax,%eax
je     1128 <decrementsv+0x28>
add    $0x4,%rdi
jmp    1118 <decrementsv+0x18>
nopl   0x0(%rax)
add    $0x4,%rdi
test   %eax,%eax
je     1128 <decrementsv+0x28>
cmp    %esi,%eax
mov    (%rdi),%eax
jne    1110 <decrementsv+0x10>
cmp    %esi,%eax
jge    1110 <decrementsv+0x10>
add    $0xffffffff,%esi
mov    %esi,-0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @decrementsv(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %15
%6 = phi i32 [ %10, %15 ], [ %3, %2 ]
%7 = phi i32* [ %8, %15 ], [ %0, %2 ]
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = icmp eq i32 %6, %1
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, %1
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %13, label %15
13: ; preds = %5
%14 = add nsw i32 %1, -1
store i32 %14, i32* %7
br label %17
15: ; preds = %5
%16 = icmp eq i32 %10, 0
br i1 %16, label %17, label %5
17: ; preds = %15, %2, %13
ret void
}
/* Type definitions */
struct evloop {
  int dummy;
};
struct ev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _stop_ev(struct evloop *, struct ev *);
void evtm_stop(struct evloop *loop, struct ev *ev) { _stop_ev(loop, ev); }


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

x86 assembly (clang, -O2):
<evtm_stop>:
jmp    1030 <_stop_ev@plt>

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

LLVM IR (-O2):
%struct.evloop = type { i32 }
%struct.ev = type { i32 }
define void @evtm_stop(%struct.evloop* %0, %struct.ev* %1) {
%3 = tail call i32 @_stop_ev(%struct.evloop* %0, %struct.ev* %1)
ret void
}
int closetoint(double x) {
  if (x < 0.0)
    x = -x;
  x -= (int)(x + 0.5);
  return (x < 1e-8 && x > -1e-8);
}


x86 assembly (clang, -O0):
<closetoint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1138 <closetoint+0x38>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xec8(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
xor    %eax,%eax
movsd  0xe9b(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x9(%rbp)
jbe    118a <closetoint+0x8a>
movsd  -0x8(%rbp),%xmm0
movsd  0xe90(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<closetoint>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm0,%xmm3
orpd   %xmm1,%xmm3
movsd  0xee3(%rip),%xmm0
addsd  %xmm3,%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
subsd  %xmm0,%xmm3
movsd  0xed3(%rip),%xmm0
ucomisd %xmm3,%xmm0
seta   %al
ucomisd 0xecc(%rip),%xmm3
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @closetoint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
%10 = fadd double %9, 5.000000e-01
%11 = fptosi double %10 to i32
%12 = sitofp i32 %11 to double
%13 = load double, double* %2
%14 = fsub double %13, %12
store double %14, double* %2
%15 = load double, double* %2
%16 = fcmp olt double %15, 1.000000e-08
br i1 %16, label %17, label %20
17: ; preds = %8
%18 = load double, double* %2
%19 = fcmp ogt double %18, -1.000000e-08
br label %20
20: ; preds = %17, %8
%21 = phi i1 [ false, %8 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @closetoint(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i32
%7 = sitofp i32 %6 to double
%8 = fsub double %4, %7
%9 = fcmp olt double %8, 1.000000e-08
%10 = fcmp ogt double %8, -1.000000e-08
%11 = and i1 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
regx0adr1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((p0[x0]) <= (*((unsigned int *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx),%eax
ja     113c <regx0adr1+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <regx0adr1+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adr1>:
movslq %edx,%rax
mov    (%r8,%rax,4),%ecx
xor    %eax,%eax
cmp    0xa98ac7,%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @regx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = load i32, i32* inttoptr (i64 11111111 to i32*)
%11 = icmp ule i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ min32u(int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t min3x32u(uint32_t a, uint32_t b, uint32_t c) {
  return min32u(min32u(a, b), c);
}


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

x86 assembly (clang, -O2):
<min3x32u>:
push   %rbx
mov    %edx,%ebx
call   1030 <min32u@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <min32u@plt>

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

LLVM IR (-O2):
define i32 @min3x32u(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @min32u(i32 %0, i32 %1)
%5 = tail call i32 @min32u(i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_set_monitor_stream() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_set_monitor_stream"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_stream_set_monitor_stream\00"
define i32 @pa_stream_set_monitor_stream() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}