xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void lobpcg_errorMessage(int verbosityLevel, char *message) {
  if (verbosityLevel) {
    fprintf(stderr, "Error in LOBPCG:\n");
    fprintf(stderr, "%s", message);
  }
}


x86 assembly (clang, -O0):
<lobpcg_errorMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115b <lobpcg_errorMessage+0x4b>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lobpcg_errorMessage>:
test   %edi,%edi
je     114e <lobpcg_errorMessage+0x3e>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2ebe(%rip),%r14
mov    (%r14),%edi
lea    0xed4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xed5(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Error in LOBPCG:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @lobpcg_errorMessage(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %4
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Error in LOBPCG:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @lobpcg_errorMessage(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_244() {
  Assert_real((isqrt(244) == 15),
              "/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/stdlib/isqrt.c",
              1225, ("Integer square root of 244 should be 15"));
}


x86 assembly (clang, -O0):
<t_sqrt_244>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf4,%edi
call   1030 <isqrt@plt>
cmp    $0xf,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x4c9,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_244>:
push   %rax
mov    $0xf4,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x4c9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 244 should be 15\00"
define void @t_sqrt_244() {
%1 = call i32 @isqrt(i32 244)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1225, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 244 should be 15\00"
define void @t_sqrt_244() {
%1 = tail call i32 @isqrt(i32 244)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1225, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void my_hash_callback(void *key, void *value, void *user_data) {
  int *d = value;
  *d = 1;
}


x86 assembly (clang, -O0):
<my_hash_callback>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_hash_callback>:
movl   $0x1,(%rsi)
ret

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

LLVM IR (-O2):
define void @my_hash_callback(i8* nocapture readnone %0, i8* nocapture writeonly %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %1 to i32*
store i32 1, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int _fds_add(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int _fds_cpy(fd_set *lhs, fd_set *rhs, int nfds) {
  FD_ZERO(lhs);
  return _fds_add(lhs, rhs, nfds);
}


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

x86 assembly (clang, -O2):
<_fds_cpy>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <FD_ZERO@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <_fds_add@plt>

LLVM IR (-O0):
define i32 @_fds_cpy(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 = call i32 @FD_ZERO(i32* %7)
%9 = load i32*, i32** %4
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
%12 = call i32 @_fds_add(i32* %9, i32* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @_fds_cpy(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @FD_ZERO(i32* %0)
%5 = tail call i32 @_fds_add(i32* %0, i32* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DrawText125(char const *);
void drawtext(const char *s) { DrawText125(s); }


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

x86 assembly (clang, -O2):
<drawtext>:
jmp    1030 <DrawText125@plt>

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

LLVM IR (-O2):
define void @drawtext(i8* %0) {
%2 = tail call i32 @DrawText125(i8* %0)
ret void
}
extern void vscp_app_reg_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @vscp_app_reg_init() {
ret void
}
int count_char_occurences(const char *str, char c) {
  int res = 0;
  while (*str != '\0') {
    if (*str == c)
      res++;
    str++;
  }
  return res;
}


x86 assembly (clang, -O0):
<count_char_occurences>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1152 <count_char_occurences+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1141 <count_char_occurences+0x41>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <count_char_occurences+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_char_occurences>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <count_char_occurences+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_char_occurences+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_char_occurences(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
/* Variables and functions */
void *Cyc_Absyn_compress(void *);
int Cyc_Tcutil_is_pointer_type(void *t) {
  int *_T0;
  int _T1;
  void *_T2 = Cyc_Absyn_compress(t);
  _T0 = (int *)_T2;
  _T1 = *_T0;
  if (_T1 != 4)
    goto _TLA;
  return 1;
_TLA:
  return 0;
  ;
}


x86 assembly (clang, -O0):
<Cyc_Tcutil_is_pointer_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Cyc_Absyn_compress@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
je     1149 <Cyc_Tcutil_is_pointer_type+0x39>
jmp    1155 <Cyc_Tcutil_is_pointer_type+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115c <Cyc_Tcutil_is_pointer_type+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Tcutil_is_pointer_type>:
push   %rax
call   1030 <Cyc_Absyn_compress@plt>
xor    %ecx,%ecx
cmpl   $0x4,(%rax)
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Cyc_Tcutil_is_pointer_type(i8* %0) {
%2 = tail call i8* @Cyc_Absyn_compress(i8* %0)
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ wlWriteBit(char, int /*<<< orphan*/ *, unsigned char *,
                              unsigned char *);
int wlFillByte(char bit, FILE *file, unsigned char *dataByte,
               unsigned char *dataMask) {
  while (*dataMask) {
    if (!wlWriteBit(bit, file, dataByte, dataMask))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<wlFillByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <wlFillByte+0x58>
mov    -0x5(%rbp),%al
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
movsbl %al,%edi
call   1030 <wlWriteBit@plt>
cmp    $0x0,%eax
jne    1163 <wlFillByte+0x53>
movl   $0x0,-0x4(%rbp)
jmp    116f <wlFillByte+0x5f>
jmp    112a <wlFillByte+0x1a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wlFillByte>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
movsbl %dil,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,(%rbx)
je     114d <wlFillByte+0x3d>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1030 <wlWriteBit@plt>
test   %eax,%eax
jne    1130 <wlFillByte+0x20>
xor    %eax,%eax
jmp    1152 <wlFillByte+0x42>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @wlFillByte(i8 signext %0, i32* %1, i8* %2, i8* %3) {
br label %5
5: ; preds = %8, %4
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i32 @wlWriteBit(i8 signext %0, i32* %1, i8* %2, i8* %3)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %5, %8
%12 = phi i32 [ 0, %8 ], [ 1, %5 ]
ret i32 %12
}
void kernel_3_a_acoustic_cuda_(long *Mesh_pointer) {}


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

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

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

LLVM IR (-O2):
define void @kernel_3_a_acoustic_cuda_(i64* nocapture %0) {
ret void
}
/* Variables and functions */
void *aligned_alloc(size_t, size_t);
void *_aligned_malloc(size_t size, size_t alignment) {
  return aligned_alloc(alignment, size);
}


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

x86 assembly (clang, -O2):
<_aligned_malloc>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <aligned_alloc@plt>

LLVM IR (-O0):
define i8* @_aligned_malloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = call i8* @aligned_alloc(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @_aligned_malloc(i64 %0, i64 %1) {
%3 = tail call i8* @aligned_alloc(i64 %1, i64 %0)
ret i8* %3
}
/* Type definitions */
struct swbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *swbuf_lead(struct swbuf *);
int swbuf_error(struct swbuf *b) { return swbuf_lead(b) == NULL; }


x86 assembly (clang, -O0):
<swbuf_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <swbuf_lead@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swbuf_error>:
push   %rax
call   1030 <swbuf_lead@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.swbuf = type { i32 }
define i32 @swbuf_error(%struct.swbuf* %0) {
%2 = alloca %struct.swbuf*
store %struct.swbuf* %0, %struct.swbuf** %2
%3 = load %struct.swbuf*, %struct.swbuf** %2
%4 = call i32* @swbuf_lead(%struct.swbuf* %3)
%5 = icmp eq i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.swbuf = type { i32 }
define i32 @swbuf_error(%struct.swbuf* %0) {
%2 = tail call i32* @swbuf_lead(%struct.swbuf* %0)
%3 = icmp eq i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ japi_sleep(int);
void j_sleep(int arg0) { japi_sleep(arg0); }


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

x86 assembly (clang, -O2):
<j_sleep>:
jmp    1030 <japi_sleep@plt>

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

LLVM IR (-O2):
define void @j_sleep(i32 %0) {
%2 = tail call i32 @japi_sleep(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ *newwin(int, int, int, int);
WINDOW *create_msgbox(void) { return newwin(2, 80 - 7, 20, 7); }


x86 assembly (clang, -O0):
<create_msgbox>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x49,%esi
mov    $0x14,%edx
mov    $0x7,%ecx
call   1030 <newwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_msgbox>:
mov    $0x2,%edi
mov    $0x49,%esi
mov    $0x14,%edx
mov    $0x7,%ecx
jmp    1030 <newwin@plt>

LLVM IR (-O0):
define i32* @create_msgbox() {
%1 = call i32* @newwin(i32 2, i32 73, i32 20, i32 7)
ret i32* %1
}

LLVM IR (-O2):
define i32* @create_msgbox() {
%1 = tail call i32* @newwin(i32 2, i32 73, i32 20, i32 7)
ret i32* %1
}
int test_imm_06int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x06 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_06int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 393216
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void w11(void *x, double y) { *(double *)(x + 32757) = y; }


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

x86 assembly (clang, -O2):
<w11>:
movsd  %xmm0,0x7ff5(%rdi)
ret

LLVM IR (-O0):
define void @w11(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32757
%8 = bitcast i8* %7 to double*
store double %5, double* %8
ret void
}

LLVM IR (-O2):
define void @w11(i8* nocapture writeonly %0, double %1) {
%3 = getelementptr i8, i8* %0, i64 32757
%4 = bitcast i8* %3 to double*
store double %1, double* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar_v1(void) { printf("weak_as_needed_c: bar_v1\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"weak_as_needed_c: bar_v1\0A\00"
define void @bar_v1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"weak_as_needed_c: bar_v1\00"
define void @bar_v1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
float pcircle(float r) { return (3.141592 * 2 * r); }


x86 assembly (clang, -O0):
<pcircle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcircle>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @pcircle(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 0x401921FAFC8B007A, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @pcircle(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x401921FAFC8B007A
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
double ceil(double);
double fabs(double);
int main() {
  double x = ceil(2.4);
  if (fabs(x) - 3.0 < 0.01)
    return EXIT_SUCCESS;
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xef5(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movaps 0xeec(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xed8(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xec4(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1157 <main+0x57>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <main+0x63>
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call double @llvm.ceil.f64(double 2.400000e+00)
store double %3, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fabs.f64(double %4)
%6 = fsub double %5, 3.000000e+00
%7 = fcmp olt double %6, 1.000000e-02
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load i32, i32* @EXIT_SUCCESS
store i32 %9, i32* %1
br label %12
10: ; preds = %0
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %1
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = load i32, i32* @EXIT_SUCCESS
ret i32 %1
}
/* Variables and functions */
long double expl(float);
int /*<<< orphan*/ powl(long double, float);
float sqrtl(int /*<<< orphan*/);
long double do_energyfactor(long double v, float lambda, float power) {
  return expl(-lambda * sqrtl(powl(v, power)));
}


x86 assembly (clang, -O0):
<do_energyfactor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movaps 0xeb1(%rip),%xmm1
movss  -0x14(%rbp),%xmm0
pxor   %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
fldt   -0x10(%rbp)
movss  -0x18(%rbp),%xmm0
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <powl@plt>
mov    %eax,%edi
call   1050 <sqrtl@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1040 <expl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_energyfactor>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
xorps  0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
fstpt  (%rsp)
movaps %xmm1,%xmm0
call   1030 <powl@plt>
mov    %eax,%edi
call   1050 <sqrtl@plt>
mulss  0x10(%rsp),%xmm0
add    $0x28,%rsp
jmp    1040 <expl@plt>

LLVM IR (-O0):
define x86_fp80 @do_energyfactor(x86_fp80 %0, float %1, float %2) {
%4 = alloca x86_fp80
%5 = alloca float
%6 = alloca float
store x86_fp80 %0, x86_fp80* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = fneg float %7
%9 = load x86_fp80, x86_fp80* %4
%10 = load float, float* %6
%11 = call i32 @powl(x86_fp80 %9, float %10)
%12 = call float @sqrtl(i32 %11)
%13 = fmul float %8, %12
%14 = call x86_fp80 @expl(float %13)
ret x86_fp80 %14
}

LLVM IR (-O2):
define x86_fp80 @do_energyfactor(x86_fp80 %0, float %1, float %2) {
%4 = fneg float %1
%5 = tail call i32 @powl(x86_fp80 %0, float %2)
%6 = tail call float @sqrtl(i32 %5)
%7 = fmul float %6, %4
%8 = tail call x86_fp80 @expl(float %7)
ret x86_fp80 %8
}
void DCSMGrabRAMBlocks(void) {
  volatile unsigned long temp;
  temp = (*((volatile unsigned long *)(0x00200000 + 0x0000001C)));
  temp = (*((volatile unsigned long *)(0x00200000 + 0x002FFFE0)));
}


x86 assembly (clang, -O0):
<DCSMGrabRAMBlocks>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20001c,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    $0x4fffe0,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCSMGrabRAMBlocks>:
mov    0x20001c,%rax
mov    %rax,-0x8(%rsp)
mov    0x4fffe0,%rax
mov    %rax,-0x8(%rsp)
ret

LLVM IR (-O0):
define void @DCSMGrabRAMBlocks() {
%1 = alloca i64
%2 = load volatile i64, i64* inttoptr (i64 2097180 to i64*)
store volatile i64 %2, i64* %1
%3 = load volatile i64, i64* inttoptr (i64 5242848 to i64*)
store volatile i64 %3, i64* %1
ret void
}

LLVM IR (-O2):
define void @DCSMGrabRAMBlocks() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load volatile i64, i64* inttoptr (i64 2097180 to i64*)
store volatile i64 %3, i64* %1
%4 = load volatile i64, i64* inttoptr (i64 5242848 to i64*)
store volatile i64 %4, i64* %1
ret void
}
/* Variables and functions */
int FD_CLOEXEC;
int /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ F_SETFD;
int fcntl(int, int /*<<< orphan*/, ...);
void util_set_fd_cloexec(int fd) {
  int flags;
  flags = fcntl(fd, F_GETFD);
  if (flags < 0)
    flags = FD_CLOEXEC;
  else
    flags |= FD_CLOEXEC;
  fcntl(fd, F_SETFD, flags);
}


x86 assembly (clang, -O0):
<util_set_fd_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114c <util_set_fd_cloexec+0x3c>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    115b <util_set_fd_cloexec+0x4b>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_set_fd_cloexec>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
test   %eax,%eax
mov    $0x0,%edx
cmovns %eax,%edx
or     (%rcx),%edx
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFD = global i32 0
@FD_CLOEXEC = global i32 0
@F_SETFD = global i32 0
define void @util_set_fd_cloexec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFD
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* @FD_CLOEXEC
store i32 %10, i32* %3
br label %15
11: ; preds = %1
%12 = load i32, i32* @FD_CLOEXEC
%13 = load i32, i32* %3
%14 = or i32 %13, %12
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %9
%16 = load i32, i32* %2
%17 = load i32, i32* @F_SETFD
%18 = load i32, i32* %3
%19 = call i32 (i32, i32, ...) @fcntl(i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
@F_GETFD = global i32 0
@FD_CLOEXEC = global i32 0
@F_SETFD = global i32 0
define void @util_set_fd_cloexec(i32 %0) {
%2 = load i32, i32* @F_GETFD
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = load i32, i32* @FD_CLOEXEC
%5 = icmp sgt i32 %3, 0
%6 = select i1 %5, i32 %3, i32 0
%7 = or i32 %6, %4
%8 = load i32, i32* @F_SETFD
%9 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %8, i32 %7)
ret void
}
int EverySoOften(int frameNum, int HowOften) {
  if (frameNum < 0 || HowOften < 0)
    return -1;
  if (HowOften == 0)
    return 0;
  if ((frameNum % HowOften) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<EverySoOften>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111e <EverySoOften+0x1e>
cmpl   $0x0,-0xc(%rbp)
jge    112a <EverySoOften+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <EverySoOften+0x63>
cmpl   $0x0,-0xc(%rbp)
jne    1140 <EverySoOften+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1163 <EverySoOften+0x63>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    115c <EverySoOften+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <EverySoOften+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EverySoOften>:
mov    %esi,%eax
or     %edi,%eax
js     1117 <EverySoOften+0x17>
test   %esi,%esi
je     111d <EverySoOften+0x1d>
mov    %edi,%eax
cltd
idiv   %esi
xor    %eax,%eax
test   %edx,%edx
sete   %al
ret
mov    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @EverySoOften(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = icmp eq i32 %1, 0
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = srem i32 %0, %1
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %5, %2
%12 = phi i32 [ -1, %2 ], [ 0, %5 ], [ %10, %7 ]
ret i32 %12
}
void BGRAToYRow_SSSE3() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ bcm2835_i2c_setClockDivider(int /*<<< orphan*/);
void bcm2835_i2c_set_baudrate(uint32_t baudrate) {
  uint32_t divider;
  divider = (250000000 / baudrate) & 0xFFFE;
  bcm2835_i2c_setClockDivider((uint16_t)divider);
}


x86 assembly (clang, -O0):
<bcm2835_i2c_set_baudrate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xee6b280,%eax
cltd
idivl  -0x4(%rbp)
and    $0xfffe,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <bcm2835_i2c_setClockDivider@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcm2835_i2c_set_baudrate>:
mov    $0xee6b280,%eax
xor    %edx,%edx
idiv   %edi
and    $0xfffe,%eax
mov    %eax,%edi
jmp    1030 <bcm2835_i2c_setClockDivider@plt>

LLVM IR (-O0):
define void @bcm2835_i2c_set_baudrate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 250000000, %4
%6 = and i32 %5, 65534
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @bcm2835_i2c_setClockDivider(i32 %7)
ret void
}

LLVM IR (-O2):
define void @bcm2835_i2c_set_baudrate(i32 %0) {
%2 = sdiv i32 250000000, %0
%3 = and i32 %2, 65534
%4 = tail call i32 @bcm2835_i2c_setClockDivider(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void print_usage() {
  puts("Usage: BogoSort [-s | -t trials] [-b beginning-length] [-n "
       "number-of-items] [-o filename] [-v]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [96 x i8] c"Usage: BogoSort [-s | -t trials] [-b beginning-length] [-n number-of-items] [-o filename] [-v]\0A\00"
define void @print_usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [96 x i8] c"Usage: BogoSort [-s | -t trials] [-b beginning-length] [-n number-of-items] [-o filename] [-v]\0A\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int write(int fd, void *buff, unsigned int size) {
  int ret;
  asm("movl $4, %%eax\n\t"
      "movl %1, %%ebx\n\t"
      "movl %2, %%ecx\n\t"
      "movl %3, %%edx\n\t"
      "int $0x80\n\t"
      "movl %%eax, %0"
      : "=m"(ret)
      : "m"(fd), "m"(buff), "m"(size));
  return ret;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x4,%eax
mov    -0x4(%rbp),%ebx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%edx
int    $0x80
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    %edi,-0xc(%rsp)
mov    %rsi,-0x8(%rsp)
mov    %edx,-0x10(%rsp)
mov    $0x4,%eax
mov    -0xc(%rsp),%ebx
mov    -0x8(%rsp),%ecx
mov    -0x10(%rsp),%edx
int    $0x80
mov    %eax,-0x14(%rsp)
mov    -0x14(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = bitcast i32* %7 to i8*
%9 = load i32, i32* %7
ret i32 %9
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c))
    return c - 'a' + 'A';
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113e <toupper+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <toupper+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @islower(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 97
%10 = add nsw i32 %9, 65
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SIOCDELRT;
int route_manip(int /*<<< orphan*/, char *, int, char *, char *, char *);
int route_del(char *name, int metric, char *dst, char *gateway, char *genmask) {
  return route_manip(SIOCDELRT, name, metric, dst, gateway, genmask);
}


x86 assembly (clang, -O0):
<route_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <route_manip@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<route_del>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <route_manip@plt>

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

LLVM IR (-O2):
@SIOCDELRT = global i32 0
define i32 @route_del(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = load i32, i32* @SIOCDELRT
%7 = tail call i32 @route_manip(i32 %6, i8* %0, i32 %1, i8* %2, i8* %3, i8* %4)
ret i32 %7
}
/* Variables and functions */
char *_X3D_makeShortCommand(char);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ sscanf(char *, char *, float *);
float X3D_getCurrentSpeed() {
  char *ptr;
  float curspeed;
  ptr = _X3D_makeShortCommand('M');
  if (sscanf(ptr, "%f", &curspeed) == 0) {
    printf("client, error - problem reading float from %s\n", ptr);
    exit(0);
  }
  return curspeed;
}


x86 assembly (clang, -O0):
<X3D_getCurrentSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4d,%edi
call   1040 <_X3D_makeShortCommand@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <sscanf@plt>
cmp    $0x0,%rax
jne    118b <X3D_getCurrentSpeed+0x4b>
mov    -0x8(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X3D_getCurrentSpeed>:
push   %rbx
sub    $0x10,%rsp
mov    $0x4d,%edi
call   1040 <_X3D_makeShortCommand@plt>
mov    %rax,%rbx
lea    0xea7(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1050 <sscanf@plt>
test   %rax,%rax
je     1177 <X3D_getCurrentSpeed+0x37>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe85(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [47 x i8] c"client, error - problem reading float from %s\0A\00"
define float @X3D_getCurrentSpeed() {
%1 = alloca i8*
%2 = alloca float
%3 = call i8* @_X3D_makeShortCommand(i8 signext 77)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i8*, i8** %1
%9 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %0
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [47 x i8] c"client, error - problem reading float from %s\0A\00"
define float @X3D_getCurrentSpeed() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i8* @_X3D_makeShortCommand(i8 signext 77)
%4 = call i64 @sscanf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %0
%10 = load float, float* %1
ret float %10
}
void openlog(const char *ident, int option, int facility) { ; }


x86 assembly (clang, -O0):
<openlog>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @openlog(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int open(char const *, int, int /*<<< orphan*/);
int creat(const char *pathname, mode_t mode) {
  return open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
}


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
mov    0x2e95(%rip),%rax
or     (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
mov    0x2ee1(%rip),%rcx
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(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* @O_CREAT
%7 = load i32, i32* @O_WRONLY
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = call i32 @open(i8* %5, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_CREAT
%4 = load i32, i32* @O_WRONLY
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @open(i8* %0, i32 %7, i32 %1)
ret i32 %8
}
int fltcompare(const void *_i, const void *_j) {
  const float *i = (const float *)_i;
  const float *j = (const float *)_j;
  if (*i > *j)
    return (1);
  if (*i < *j)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<fltcompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    113d <fltcompare+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1169 <fltcompare+0x69>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1162 <fltcompare+0x62>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <fltcompare+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fltcompare>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fltcompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
%8 = fcmp olt float %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int IPC_CREAT;
int shmget(int /*<<< orphan*/, size_t, int);
int shmem_create(key_t key, size_t mem_size_bytes) {
  return shmget(key, mem_size_bytes, IPC_CREAT | 0644);
}


x86 assembly (clang, -O0):
<shmem_create>:
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    0x2eb3(%rip),%rax
mov    (%rax),%edx
or     $0x1a4,%edx
call   1030 <shmget@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmem_create>:
mov    0x2ec9(%rip),%rax
mov    $0x1a4,%edx
or     (%rax),%edx
jmp    1030 <shmget@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
define i32 @shmem_create(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 = load i32, i32* @IPC_CREAT
%8 = or i32 %7, 420
%9 = call i32 @shmget(i32 %5, i64 %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
define i32 @shmem_create(i32 %0, i64 %1) {
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 420
%5 = tail call i32 @shmget(i32 %0, i64 %1, i32 %4)
ret i32 %5
}