xunge/DecIR huggingface dataset:
/* Type definitions */
struct sembuf {
  int sem_op;
  int /*<<< orphan*/ sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ SEM_UNDO;
int semop(int, struct sembuf *, int);
int sem_unlock(int semid) {
  struct sembuf ops;
  ops.sem_num = 0;
  ops.sem_op = +1;
  ops.sem_flg = SEM_UNDO;
  return semop(semid, &ops, 1);
}


x86 assembly (clang, -O0):
<sem_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_unlock>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0x1,0x8(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
@SEM_UNDO = global i32 0
define i32 @sem_unlock(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sembuf
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 2
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 0
store i32 1, i32* %5
%6 = load i32, i32* @SEM_UNDO
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 1
store i32 %6, i32* %7
%8 = load i32, i32* %2
%9 = call i32 @semop(i32 %8, %struct.sembuf* %3, i32 1)
ret i32 %9
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
@SEM_UNDO = global i32 0
define i32 @sem_unlock(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 2
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 0
store i32 1, i32* %5
%6 = load i32, i32* @SEM_UNDO
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 1
store i32 %6, i32* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
ret i32 %8
}
/* Type definitions */
struct pplex {
  int dummy;
};

/* Variables and functions */
char *nextchar(struct pplex *, char const *);
scalar_t__ whitespacep(struct pplex *);
char const *skipwhite(struct pplex *cl, char const *input) {
  for (; whitespacep(cl); input = nextchar(cl, input))
    ;
  return input;
}


x86 assembly (clang, -O0):
<skipwhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <whitespacep@plt>
cmp    $0x0,%rax
je     115e <skipwhite+0x3e>
jmp    1148 <skipwhite+0x28>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <nextchar@plt>
mov    %rax,-0x10(%rbp)
jmp    1130 <skipwhite+0x10>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipwhite>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
call   1030 <whitespacep@plt>
test   %rax,%rax
je     114d <skipwhite+0x2d>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <nextchar@plt>
mov    %rax,%rbx
mov    %r14,%rdi
jmp    1130 <skipwhite+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.pplex = type { i32 }
define i8* @skipwhite(%struct.pplex* %0, i8* %1) {
%3 = alloca %struct.pplex*
%4 = alloca i8*
store %struct.pplex* %0, %struct.pplex** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %10, %2
%6 = load %struct.pplex*, %struct.pplex** %3
%7 = call i64 @whitespacep(%struct.pplex* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load %struct.pplex*, %struct.pplex** %3
%12 = load i8*, i8** %4
%13 = call i8* @nextchar(%struct.pplex* %11, i8* %12)
store i8* %13, i8** %4
br label %5
14: ; preds = %5
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
%struct.pplex = type { i32 }
define i8* @skipwhite(%struct.pplex* %0, i8* %1) {
%3 = tail call i64 @whitespacep(%struct.pplex* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %7, %5 ], [ %1, %2 ]
%7 = tail call i8* @nextchar(%struct.pplex* %0, i8* %6)
%8 = tail call i64 @whitespacep(%struct.pplex* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i8* [ %1, %2 ], [ %7, %5 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xab() {
  Assert_real((isprint(171) == 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_isprint.c",
              860, ("isprint should be 0 for 0xab"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xab>:
push   %rax
mov    $0xab,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x35c,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xab\00"
define void @t_isprint_0xab() {
%1 = call i64 @isprint(i32 171)
%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 860, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xab\00"
define void @t_isprint_0xab() {
%1 = tail call i64 @isprint(i32 171)
%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 860, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
dstroy(obj) int obj;
{ move(obj, 0); }


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

x86 assembly (clang, -O2):
<dstroy>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <move@plt>

LLVM IR (-O0):
define i32 @dstroy(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %4, i32 0)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @dstroy(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %0, i32 0)
ret i32 undef
}
void SSMR3GetU128(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetU128() {
ret void
}
/* Variables and functions */
scalar_t__ __trunc(double);
long double __truncl(long double x) {
  return ((long double)__trunc((double)x));
}


x86 assembly (clang, -O0):
<__truncl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <__trunc@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__truncl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <__trunc@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__truncl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @__trunc(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @__truncl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @__trunc(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Variables and functions */
unsigned char UCHAR_MAX;
int /*<<< orphan*/ printf(char *, unsigned char);
int main(int argc, char *argv[]) {
  unsigned char c = UCHAR_MAX;
  printf("%d\n", (unsigned char)(c + 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
add    $0x1,%eax
lea    0xec0(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%al
add    $0x1,%al
movzbl %al,%esi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@UCHAR_MAX = global i8 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8, i8* @UCHAR_MAX
store i8 %7, i8* %6
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = add nsw i32 %9, 1
%11 = trunc i32 %10 to i8
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %11)
ret i32 0
}

LLVM IR (-O2):
@UCHAR_MAX = global i8 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i8, i8* @UCHAR_MAX
%4 = add i8 %3, 1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ SmcConn;
typedef int /*<<< orphan*/ SmPointer;

/* Variables and functions */
void shutdown_cancelled(SmcConn conn, SmPointer client_data) {}


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

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

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

LLVM IR (-O2):
define void @shutdown_cancelled(i32 %0, i32 %1) {
ret void
}
long hst_djb2(void *val, void *data) {
  char *str = (char *)val;
  unsigned long hash = 5381;
  char c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hst_djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x1505,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    %al,-0x21(%rbp)
cmp    $0x0,%al
je     1155 <hst_djb2+0x55>
mov    -0x20(%rbp),%rax
shl    $0x5,%rax
add    -0x20(%rbp),%rax
movsbq -0x21(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <hst_djb2+0x1c>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @hst_djb2(i8* nocapture %0, i8* nocapture readnone %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 i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i64 [ %12, %5 ], [ 5381, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul i64 %8, 33
%11 = sext i8 %6 to i64
%12 = add i64 %10, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 5381, %2 ], [ %12, %5 ]
ret i64 %16
}
/* Type definitions */
typedef int uint8_t;
typedef int int16_t;

/* Variables and functions */
int16_t pref_to_priority(uint8_t flags) {
  flags = (flags >> 3) & 0x03;
  return (flags == 0x0)   ? 1024
         : (flags == 0x1) ? 512
         : (flags == 0x3) ? 2048
                          : -1;
}


x86 assembly (clang, -O0):
<pref_to_priority>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
and    $0x3,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112a <pref_to_priority+0x2a>
mov    $0x400,%eax
mov    %eax,-0x8(%rbp)
jmp    115d <pref_to_priority+0x5d>
cmpl   $0x1,-0x4(%rbp)
jne    1141 <pref_to_priority+0x41>
mov    $0x200,%eax
mov    %eax,-0xc(%rbp)
jmp    1157 <pref_to_priority+0x57>
mov    -0x4(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x800,%ecx
cmp    $0x3,%edx
cmove  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pref_to_priority>:
shr    $0x3,%edi
and    $0x3,%edi
je     1113 <pref_to_priority+0x13>
cmp    $0x1,%edi
jne    1119 <pref_to_priority+0x19>
mov    $0x200,%eax
ret
mov    $0x400,%eax
ret
cmp    $0x3,%edi
mov    $0x800,%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @pref_to_priority(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 3
%5 = and i32 %4, 3
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %20
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %9
br label %18
13: ; preds = %9
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 3
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 2048, i32 -1
br label %18
18: ; preds = %13, %12
%19 = phi i32 [ 512, %12 ], [ %17, %13 ]
br label %20
20: ; preds = %18, %8
%21 = phi i32 [ 1024, %8 ], [ %19, %18 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @pref_to_priority(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 3
switch i32 %3, label %4 [
i32 0, label %8
i32 1, label %7
]
4: ; preds = %1
%5 = icmp eq i32 %3, 3
%6 = select i1 %5, i32 2048, i32 -1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %4
%9 = phi i32 [ 1024, %1 ], [ %6, %4 ], [ 512, %7 ]
ret i32 %9
}
const char *str_stmt_default() { return "default"; }


x86 assembly (clang, -O0):
<str_stmt_default>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_stmt_default>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"default\00"
define i8* @str_stmt_default() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"default\00"
define i8* @str_stmt_default() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__6__GeneralIO__makeOutput();
void CC2420ControlP__VREN__makeOutput(void) {
  Msp430GpioC__6__GeneralIO__makeOutput();
}


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

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

LLVM IR (-O0):
define void @CC2420ControlP__VREN__makeOutput() {
%1 = call i32 (...) @Msp430GpioC__6__GeneralIO__makeOutput()
ret void
}

LLVM IR (-O2):
define void @CC2420ControlP__VREN__makeOutput() {
%1 = tail call i32 (...) @Msp430GpioC__6__GeneralIO__makeOutput()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int host_is_big_endian(void) {
  uint32_t tmp_u32;
  char tmp_str[sizeof(uint32_t)];
  tmp_u32 = 0x00000001;
  memcpy(tmp_str, (char *)&tmp_u32, sizeof(uint32_t));
  if (tmp_str[0] == 0x01)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<host_is_big_endian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movsbl -0xc(%rbp),%eax
cmp    $0x1,%eax
jne    114a <host_is_big_endian+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1151 <host_is_big_endian+0x41>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_is_big_endian>:
push   %rax
movl   $0x1,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
cmpb   $0x1,0x4(%rsp)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @host_is_big_endian() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x i8]
store i32 1, i32* %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = call i32 @memcpy(i8* %4, i8* %5, i32 4)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 0, i32* %1
br label %13
12: ; preds = %0
store i32 1, i32* %1
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @host_is_big_endian() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
store i32 1, i32* %1
%5 = call i32 @memcpy(i8* %4, i8* %3, i32 4)
%6 = load i8, i8* %4
%7 = icmp ne i8 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ getpid();
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int get_random(int s, int e) {
  srand((unsigned)time(NULL) + (unsigned)getpid());
  return (rand() % (e - s + 1)) + s;
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0xc(%rbp),%edi
add    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%r14d
xor    %edi,%edi
call   1050 <time@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
add    %eax,%ebx
mov    %ebx,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
sub    %r14d,%ebp
add    $0x1,%ebp
cltd
idiv   %ebp
add    %edx,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_random(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i64 @time(i32* null)
%6 = trunc i64 %5 to i32
%7 = call i64 (...) @getpid()
%8 = trunc i64 %7 to i32
%9 = add i32 %6, %8
%10 = call i32 @srand(i32 %9)
%11 = call i32 (...) @rand()
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
%15 = add nsw i32 %14, 1
%16 = srem i32 %11, %15
%17 = load i32, i32* %3
%18 = add nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_random(i32 %0, i32 %1) {
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i64 (...) @getpid()
%6 = trunc i64 %5 to i32
%7 = add i32 %6, %4
%8 = tail call i32 @srand(i32 %7)
%9 = tail call i32 (...) @rand()
%10 = sub i32 1, %0
%11 = add i32 %10, %1
%12 = srem i32 %9, %11
%13 = add nsw i32 %12, %0
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ strtol(char *, int /*<<< orphan*/ *, int);
int32_t sem_parse_int32_t(char *string) {
  return (int32_t)strtol(string, NULL, 10);
}


x86 assembly (clang, -O0):
<sem_parse_int32_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_parse_int32_t>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @sem_parse_int32_t(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strtol(i8* %3, i32* null, i32 10)
ret i32 %4
}

LLVM IR (-O2):
define i32 @sem_parse_int32_t(i8* nocapture %0) {
%2 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 10)
ret i32 %2
}
void empty_method() {}


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

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

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

LLVM IR (-O2):
define void @empty_method() {
ret void
}
/* Variables and functions */
int TimerGetMS();
unsigned long long TimerGetCS() { return TimerGetMS() / 10; }


x86 assembly (clang, -O0):
<TimerGetCS>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <TimerGetMS@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerGetCS>:
push   %rax
xor    %eax,%eax
call   1030 <TimerGetMS@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @TimerGetCS() {
%1 = call i32 (...) @TimerGetMS()
%2 = sdiv i32 %1, 10
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @TimerGetCS() {
%1 = tail call i32 (...) @TimerGetMS()
%2 = sdiv i32 %1, 10
%3 = sext i32 %2 to i64
ret i64 %3
}
int v5dSecondsToHHMMSS(int seconds) {
  int hh, mm, ss;
  hh = seconds / (60 * 60);
  mm = (seconds / 60) % 60;
  ss = seconds % 60;
  return hh * 10000 + mm * 100 + ss;
}


x86 assembly (clang, -O0):
<v5dSecondsToHHMMSS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0x2710,-0x8(%rbp),%eax
imul   $0x64,-0xc(%rbp),%ecx
add    %ecx,%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<v5dSecondsToHHMMSS>:
movslq %edi,%rax
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xb,%ecx
add    %edx,%ecx
imul   $0xffffffff88888889,%rax,%rdx
shr    $0x20,%rdx
add    %eax,%edx
mov    %edx,%esi
shr    $0x1f,%esi
sar    $0x5,%edx
add    %esi,%edx
movslq %edx,%rdx
imul   $0xffffffff88888889,%rdx,%rsi
shr    $0x20,%rsi
add    %edx,%esi
mov    %esi,%edi
shr    $0x1f,%edi
sar    $0x5,%esi
add    %edi,%esi
imul   $0x3c,%esi,%esi
imul   $0x3c,%edx,%edi
sub    %esi,%edx
sub    %edi,%eax
imul   $0x2710,%ecx,%ecx
add    %eax,%ecx
imul   $0x64,%edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @v5dSecondsToHHMMSS(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 3600
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 60
%10 = srem i32 %9, 60
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = srem i32 %11, 60
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = mul nsw i32 %13, 10000
%15 = load i32, i32* %4
%16 = mul nsw i32 %15, 100
%17 = add nsw i32 %14, %16
%18 = load i32, i32* %5
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @v5dSecondsToHHMMSS(i32 %0) {
%2 = sdiv i32 %0, 3600
%3 = sdiv i32 %0, 60
%4 = srem i32 %3, 60
%5 = srem i32 %0, 60
%6 = mul nsw i32 %2, 10000
%7 = mul nsw i32 %4, 100
%8 = add i32 %6, %5
%9 = add i32 %8, %7
ret i32 %9
}
int PrviVeci(int n, int x[], int y) {
  int i;
  for (i = 0; i < n; i++)
    if (x[i] > y)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<PrviVeci>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1153 <PrviVeci+0x53>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jle    1140 <PrviVeci+0x40>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <PrviVeci+0x5a>
jmp    1145 <PrviVeci+0x45>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <PrviVeci+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrviVeci>:
mov    $0xffffffff,%eax
test   %edi,%edi
jle    111e <PrviVeci+0x1e>
mov    %edi,%edi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rsi,%rcx,4)
jg     111f <PrviVeci+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdi
jne    1110 <PrviVeci+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @PrviVeci(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp sgt i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_string(char str[]) {
  for (int i = 0; str[i]; i++)
    putchar(str[i]);
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1154 <print_string+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_string+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8 [ %11, %5 ], [ %2, %1 ]
%8 = tail call i32 @putchar(i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %5
}
/* Variables and functions */
long __testandset(long *);
int /*<<< orphan*/ assert(long);
int main() {
  long foo = 0;
  __testandset(&foo);
  assert(foo);
  assert(__testandset(&foo));
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <__testandset@plt>
mov    0x8(%rsp),%rdi
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <__testandset@plt>
mov    %rax,%rdi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
%3 = call i64 @__testandset(i64* %2)
%4 = load i64, i64* %2
%5 = call i32 @assert(i64 %4)
%6 = call i64 @__testandset(i64* %2)
%7 = call i32 @assert(i64 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%3 = call i64 @__testandset(i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @assert(i64 %4)
%6 = call i64 @__testandset(i64* %1)
%7 = call i32 @assert(i64 %6)
ret i32 0
}
char flip_endian(char nb) {
  int i;
  char res;
  res = 0;
  i = 0;
  while (i < 7) {
    res |= (nb & 1);
    res <<= 1;
    nb >>= 1;
    i++;
  }
  res |= (nb & 1);
  return (res);
}


x86 assembly (clang, -O0):
<flip_endian>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    1151 <flip_endian+0x51>
movsbl -0x1(%rbp),%ecx
and    $0x1,%ecx
movsbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x9(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <flip_endian+0x15>
movsbl -0x1(%rbp),%ecx
and    $0x1,%ecx
movsbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip_endian>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
ret

LLVM IR (-O0):
define signext i8 @flip_endian(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %4
store i32 0, i32* %3
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 7
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = and i32 %10, 1
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = or i32 %13, %11
%15 = trunc i32 %14 to i8
store i8 %15, i8* %4
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = shl i32 %17, 1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %4
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = ashr i32 %21, 1
%23 = trunc i32 %22 to i8
store i8 %23, i8* %2
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %5
26: ; preds = %5
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = and i32 %28, 1
%30 = load i8, i8* %4
%31 = sext i8 %30 to i32
%32 = or i32 %31, %29
%33 = trunc i32 %32 to i8
store i8 %33, i8* %4
%34 = load i8, i8* %4
ret i8 %34
}

LLVM IR (-O2):
define signext i8 @flip_endian(i8 signext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void cx_UnsignedInt_print(unsigned int *const value) { printf("%uU", *value); }


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

x86 assembly (clang, -O2):
<cx_UnsignedInt_print>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%uU\00"
define void @cx_UnsignedInt_print(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void VsClearRxFifo() {
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  volatile unsigned char dummy;
  unsigned char i;
  for (i = 0; i < 8; i++)
    dummy = (*(volatile unsigned long *)(0xE0030000 + 0x08));
#pragma GCC diagnostic pop
}


x86 assembly (clang, -O0):
<VsClearRxFifo>:
push   %rbp
mov    %rsp,%rbp
movb   $0x0,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x8,%eax
jge    112d <VsClearRxFifo+0x2d>
mov    $0xe0030008,%eax
mov    (%rax),%rax
mov    %al,-0x1(%rbp)
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1108 <VsClearRxFifo+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VsClearRxFifo>:
mov    $0xe0030008,%eax
mov    (%rax),%rcx
mov    %cl,-0x1(%rsp)
mov    (%rax),%rcx
mov    %cl,-0x1(%rsp)
mov    (%rax),%rcx
mov    %cl,-0x1(%rsp)
mov    (%rax),%rcx
mov    %cl,-0x1(%rsp)
mov    (%rax),%rcx
mov    %cl,-0x1(%rsp)
mov    (%rax),%rcx
mov    %cl,-0x1(%rsp)
mov    (%rax),%rcx
mov    %cl,-0x1(%rsp)
mov    (%rax),%rax
mov    %al,-0x1(%rsp)
ret

LLVM IR (-O0):
define void @VsClearRxFifo() {
%1 = alloca i8
%2 = alloca i8
store i8 0, i8* %2
br label %3
3: ; preds = %10, %0
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load volatile i64, i64* inttoptr (i64 3758293000 to i64*)
%9 = trunc i64 %8 to i8
store volatile i8 %9, i8* %1
br label %10
10: ; preds = %7
%11 = load i8, i8* %2
%12 = add i8 %11, 1
store i8 %12, i8* %2
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @VsClearRxFifo() {
%1 = alloca i8
%2 = load volatile i64, i64* inttoptr (i64 3758293000 to i64*)
%3 = trunc i64 %2 to i8
store volatile i8 %3, i8* %1
%4 = load volatile i64, i64* inttoptr (i64 3758293000 to i64*)
%5 = trunc i64 %4 to i8
store volatile i8 %5, i8* %1
%6 = load volatile i64, i64* inttoptr (i64 3758293000 to i64*)
%7 = trunc i64 %6 to i8
store volatile i8 %7, i8* %1
%8 = load volatile i64, i64* inttoptr (i64 3758293000 to i64*)
%9 = trunc i64 %8 to i8
store volatile i8 %9, i8* %1
%10 = load volatile i64, i64* inttoptr (i64 3758293000 to i64*)
%11 = trunc i64 %10 to i8
store volatile i8 %11, i8* %1
%12 = load volatile i64, i64* inttoptr (i64 3758293000 to i64*)
%13 = trunc i64 %12 to i8
store volatile i8 %13, i8* %1
%14 = load volatile i64, i64* inttoptr (i64 3758293000 to i64*)
%15 = trunc i64 %14 to i8
store volatile i8 %15, i8* %1
%16 = load volatile i64, i64* inttoptr (i64 3758293000 to i64*)
%17 = trunc i64 %16 to i8
store volatile i8 %17, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *strdup(char *);
char *query_append_folder_name(char *folder_name, char *append_folder_name) {
  char appended_folder_name[1024];
  sprintf(appended_folder_name, "%s,%s", folder_name, append_folder_name);
  return strdup(appended_folder_name);
}


x86 assembly (clang, -O0):
<query_append_folder_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb7(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_append_folder_name>:
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s,%s\00"
define i8* @query_append_folder_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = call i8* @strdup(i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s,%s\00"
define noalias i8* @query_append_folder_name(i8* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i8* @strdup(i8* %4)
ret i8* %6
}
void security_sem_free(struct sem_array *sma) {}


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

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

LLVM IR (-O0):
%struct.sem_array = type opaque
define void @security_sem_free(%struct.sem_array* %0) {
%2 = alloca %struct.sem_array*
store %struct.sem_array* %0, %struct.sem_array** %2
ret void
}

LLVM IR (-O2):
%struct.sem_array = type opaque
define void @security_sem_free(%struct.sem_array* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
int getInfo(char *buf, int bufLen) {
  static const char *INFO = "info { name=Zahl }";
  int reqLen = strlen(INFO) + 1;
  if (buf != 0 && reqLen <= bufLen) {
    memcpy(buf, INFO, reqLen);
  }
  return reqLen;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2efa(%rip),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <getInfo+0x4b>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116b <getInfo+0x4b>
mov    -0x8(%rbp),%rdi
mov    0x2ecd(%rip),%rsi
mov    -0x10(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
test   %rbx,%rbx
je     1154 <getInfo+0x34>
cmp    %r14d,%eax
jge    1154 <getInfo+0x34>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@getInfo.INFO = internal global i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i32 0, i32 0)
@.str = [19 x i8] c"info { name=Zahl }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** @getInfo.INFO
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %20
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = load i8*, i8** @getInfo.INFO
%18 = load i32, i32* %5
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
br label %20
20: ; preds = %15, %11, %2
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@.str = [19 x i8] c"info { name=Zahl }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i32 %3, 1
%5 = icmp ne i8* %0, null
%6 = icmp slt i32 %3, %1
%7 = select i1 %5, i1 %6, i1 false
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %10
10: ; preds = %8, %2
ret i32 %4
}
/* Variables and functions */
int *malloc(int);
int *shifted_array(int array[], int count) {
  int *shifted = malloc((count - 1) * sizeof(*array));
  for (int i = 0; i < count; i++)
    shifted[i] = array[i + 1];
  return shifted;
}


x86 assembly (clang, -O0):
<shifted_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1172 <shifted_array+0x62>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113d <shifted_array+0x2d>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shifted_array>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r15
lea    -0x4(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1152 <shifted_array+0x32>
add    $0x4,%r15
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <memcpy@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i32* @shifted_array(i32* nocapture %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = add i32 %3, -4
%5 = tail call i32* @malloc(i32 %4)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = bitcast i32* %5 to i8*
%9 = getelementptr i32, i32* %0, i64 1
%10 = bitcast i32* %9 to i8*
%11 = zext i32 %1 to i64
%12 = shl nuw nsw i64 %11, 2
br label %13
13: ; preds = %7, %2
ret i32* %5
}
/* Variables and functions */
char *remove_quotes(char *, char *);
char *trim_quotes(char *d, char *s) { return remove_quotes(d, s); }


x86 assembly (clang, -O0):
<trim_quotes>:
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 <remove_quotes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_quotes>:
jmp    1030 <remove_quotes@plt>

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

LLVM IR (-O2):
define i8* @trim_quotes(i8* %0, i8* %1) {
%3 = tail call i8* @remove_quotes(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int detectPresence(char *);
int pactlPresent(void) {
  static int lPactlPresent = -1;
  if (lPactlPresent < 0) {
    lPactlPresent = detectPresence("pactl");
  }
  return lPactlPresent;
}


x86 assembly (clang, -O0):
<pactlPresent>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f0d(%rip)
jge    1133 <pactlPresent+0x23>
lea    0xed8(%rip),%rdi
call   1030 <detectPresence@plt>
mov    %eax,0x2ef5(%rip)
mov    0x2eef(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pactlPresent>:
push   %rax
mov    0x2f11(%rip),%eax
test   %eax,%eax
js     111d <pactlPresent+0xd>
pop    %rcx
ret
lea    0xedc(%rip),%rdi
call   1030 <detectPresence@plt>
mov    %eax,0x2ef9(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@pactlPresent.lPactlPresent = internal global i32 -1
@.str = [6 x i8] c"pactl\00"
define i32 @pactlPresent() {
%1 = load i32, i32* @pactlPresent.lPactlPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @pactlPresent.lPactlPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @pactlPresent.lPactlPresent
ret i32 %6
}

LLVM IR (-O2):
@pactlPresent.lPactlPresent = internal unnamed_addr global i32 -1
@.str = [6 x i8] c"pactl\00"
define i32 @pactlPresent() {
%1 = load i32, i32* @pactlPresent.lPactlPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @pactlPresent.lPactlPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int simple_top_down_merge_sorti_v2_impl(int *, int /*<<< orphan*/, int,
                                        int /*<<< orphan*/);
int simple_top_down_merge_sorti_v2(int arr[], int n) {
  return simple_top_down_merge_sorti_v2_impl(arr, 0, n, 0);
}


x86 assembly (clang, -O0):
<simple_top_down_merge_sorti_v2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1030 <simple_top_down_merge_sorti_v2_impl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_top_down_merge_sorti_v2>:
mov    %esi,%edx
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <simple_top_down_merge_sorti_v2_impl@plt>

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

LLVM IR (-O2):
define i32 @simple_top_down_merge_sorti_v2(i32* %0, i32 %1) {
%3 = tail call i32 @simple_top_down_merge_sorti_v2_impl(i32* %0, i32 0, i32 %1, i32 0)
ret i32 %3
}