xunge/DecIR huggingface dataset:
unsigned char f56(unsigned char x, unsigned long int y) {
  return (x << (8 - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f56>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x8,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f56>:
mov    $0x8,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f56(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = sub i64 8, %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %6, %9
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = ashr i32 %12, %14
%16 = xor i32 %10, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f56(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 8, %4
%6 = shl i32 %3, %5
%7 = lshr i32 %3, %4
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("test\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"test\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
greeting(char *temp1, char *temp2) {
  char name[400];
  memset(name, 0, 400);
  strcpy(name, temp2);
  printf("Hi %s %s\n", temp1, name);
}


x86 assembly (clang, -O0):
<greeting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x1b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1050 <memset@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rsi
lea    -0x1b0(%rbp),%rdx
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greeting>:
push   %r15
push   %r14
push   %rbx
sub    $0x190,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsp,%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1050 <memset@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0xe9a(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <printf@plt>
add    $0x190,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Hi %s %s\0A\00"
define i32 @greeting(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [400 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%8 = call i32 @memset(i8* %7, i32 0, i32 400)
%9 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%10 = load i8*, i8** %5
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hi %s %s\0A\00"
define i32 @greeting(i8* %0, i8* %1) {
%3 = alloca [400 x i8]
%4 = getelementptr inbounds [400 x i8], [400 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 400)
%6 = call i32 @strcpy(i8* %4, i8* %1)
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret i32 undef
}
void SchedulerBasicP$McuSleep$sleep(void) { McuSleepC$McuSleep$sleep(); }


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

x86 assembly (clang, -O2):
<SchedulerBasicP$McuSleep$sleep>:
xor    %eax,%eax
jmp    1030 <McuSleepC$McuSleep$sleep@plt>

LLVM IR (-O0):
define void @"SchedulerBasicP$McuSleep$sleep"() {
%1 = call i32 (...) @"McuSleepC$McuSleep$sleep"()
ret void
}

LLVM IR (-O2):
define void @"SchedulerBasicP$McuSleep$sleep"() {
%1 = tail call i32 (...) @"McuSleepC$McuSleep$sleep"()
ret void
}
int foo_add(const unsigned char *tmp, int i, int val) {
  return (unsigned char)(((tmp[i] + val) > 0xFF)
                             ? 0xFF
                             : (((tmp[i] + val) < 0) ? 0 : (tmp[i] + val)));
}


x86 assembly (clang, -O0):
<foo_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
add    -0x10(%rbp),%eax
cmp    $0xff,%eax
jle    1135 <foo_add+0x35>
mov    $0xff,%eax
mov    %eax,-0x14(%rbp)
jmp    116f <foo_add+0x6f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
add    -0x10(%rbp),%eax
cmp    $0x0,%eax
jge    1157 <foo_add+0x57>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    1169 <foo_add+0x69>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_add>:
movslq %esi,%rax
movzbl (%rdi,%rax,1),%eax
xor    %ecx,%ecx
add    %edx,%eax
movzbl %al,%edx
cmovs  %ecx,%edx
cmp    $0x100,%eax
mov    $0xff,%eax
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo_add(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = add nsw i32 %7, %2
%9 = icmp sgt i32 %8, 255
%10 = icmp slt i32 %8, 0
%11 = and i32 %8, 255
%12 = select i1 %10, i32 0, i32 %11
%13 = select i1 %9, i32 255, i32 %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M605_f(char *s) {
  debug("M605_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M605_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M605_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M605_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M605_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M605_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M605_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ getData();
int /*<<< orphan*/ printData();
int /*<<< orphan*/ sortData();
int main() {
  getData();
  sortData();
  printData();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getData()
%2 = tail call i32 (...) @sortData()
%3 = tail call i32 (...) @printData()
ret i32 0
}
void sj_onArrayComplete(char *name) {}


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

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

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

LLVM IR (-O2):
define void @sj_onArrayComplete(i8* nocapture %0) {
ret void
}
unsigned short make16color(unsigned char r, unsigned char g, unsigned char b) {
  return ((((r >> 3) & 31) << 11) | (((g >> 2) & 63) << 5) | ((b >> 3) & 31));
}


x86 assembly (clang, -O0):
<make16color>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
shl    $0xb,%eax
movzbl -0x2(%rbp),%ecx
sar    $0x2,%ecx
and    $0x3f,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
movzbl -0x3(%rbp),%ecx
sar    $0x3,%ecx
and    $0x1f,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make16color>:
shr    $0x3,%dil
movzbl %dil,%eax
shl    $0xb,%eax
shr    $0x2,%sil
movzbl %sil,%ecx
shl    $0x5,%ecx
or     %eax,%ecx
shr    $0x3,%dl
movzbl %dl,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @make16color(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 3
%10 = and i32 %9, 31
%11 = shl i32 %10, 11
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = ashr i32 %13, 2
%15 = and i32 %14, 63
%16 = shl i32 %15, 5
%17 = or i32 %11, %16
%18 = load i8, i8* %6
%19 = zext i8 %18 to i32
%20 = ashr i32 %19, 3
%21 = and i32 %20, 31
%22 = or i32 %17, %21
%23 = trunc i32 %22 to i16
ret i16 %23
}

LLVM IR (-O2):
define zeroext i16 @make16color(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = lshr i8 %0, 3
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 11
%7 = lshr i8 %1, 2
%8 = zext i8 %7 to i16
%9 = shl nuw nsw i16 %8, 5
%10 = or i16 %9, %6
%11 = lshr i8 %2, 3
%12 = zext i8 %11 to i16
%13 = or i16 %10, %12
ret i16 %13
}
void audiohw_set_lineout_vol(int vol_l, int vol_r) {}


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

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

LLVM IR (-O0):
define void @audiohw_set_lineout_vol(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 @audiohw_set_lineout_vol(i32 %0, i32 %1) {
ret void
}
int odd_ones(unsigned x) {
  unsigned p16 = (x >> 16) ^ x;
  unsigned p8 = (p16 >> 8) ^ p16;
  unsigned p4 = (p8 >> 4) ^ p8;
  unsigned p2 = (p4 >> 2) ^ p4;
  unsigned p1 = (p2 >> 1) ^ p2;
  return !!(p1 & 1u);
}


x86 assembly (clang, -O0):
<odd_ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x4,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x2,%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x1,%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<odd_ones>:
mov    %edi,%eax
shr    $0x10,%eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
xor    %ecx,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @odd_ones(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
%8 = load i32, i32* %2
%9 = lshr i32 %8, 16
%10 = load i32, i32* %2
%11 = xor i32 %9, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = lshr i32 %12, 8
%14 = load i32, i32* %3
%15 = xor i32 %13, %14
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = lshr i32 %16, 4
%18 = load i32, i32* %4
%19 = xor i32 %17, %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = lshr i32 %20, 2
%22 = load i32, i32* %5
%23 = xor i32 %21, %22
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = lshr i32 %24, 1
%26 = load i32, i32* %6
%27 = xor i32 %25, %26
store i32 %27, i32* %7
%28 = load i32, i32* %7
%29 = and i32 %28, 1
%30 = icmp ne i32 %29, 0
%31 = xor i1 %30, true
%32 = xor i1 %31, true
%33 = zext i1 %32 to i32
ret i32 %33
}

LLVM IR (-O2):
define i32 @odd_ones(i32 %0) {
%2 = lshr i32 %0, 16
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 8
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 4
%7 = xor i32 %6, %5
%8 = lshr i32 %7, 2
%9 = xor i32 %8, %7
%10 = lshr i32 %9, 1
%11 = xor i32 %10, %9
%12 = and i32 %11, 1
ret i32 %12
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
uint8_t wspr_ascii_to_alpha(uint8_t c) {
  if (c == ' ') {
    return 26;
  }
  if (c >= 'A' && c <= 'Z') {
    return c - 'A';
  }
  return 0;
}


x86 assembly (clang, -O0):
<wspr_ascii_to_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jne    1120 <wspr_ascii_to_alpha+0x20>
movb   $0x1a,-0x1(%rbp)
jmp    114d <wspr_ascii_to_alpha+0x4d>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1149 <wspr_ascii_to_alpha+0x49>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1149 <wspr_ascii_to_alpha+0x49>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    114d <wspr_ascii_to_alpha+0x4d>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wspr_ascii_to_alpha>:
lea    -0x41(%rdi),%eax
xor    %ecx,%ecx
cmp    $0x1a,%al
movzbl %al,%edx
cmovae %ecx,%edx
cmp    $0x20,%dil
mov    $0x1a,%eax
cmovne %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @wspr_ascii_to_alpha(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 26, i8* %2
br label %22
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %10, 65
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 90
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 65
%20 = trunc i32 %19 to i8
store i8 %20, i8* %2
br label %22
21: ; preds = %12, %8
store i8 0, i8* %2
br label %22
22: ; preds = %21, %16, %7
%23 = load i8, i8* %2
ret i8 %23
}

LLVM IR (-O2):
define signext i8 @wspr_ascii_to_alpha(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
%5 = select i1 %4, i8 %3, i8 0
%6 = select i1 %2, i8 26, i8 %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(
      stderr,
      "usage: brandelf [-f ELF ABI number] [-v] [-l] [-t string] file ...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [68 x i8] c"usage: brandelf [-f ELF ABI number] [-v] [-l] [-t string] file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [68 x i8] c"usage: brandelf [-f ELF ABI number] [-v] [-l] [-t string] file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void g_DUMMY_popup_set_checkmark(int cont_id, int item_id, int position,
                                 int toggle_on) {
  cont_id = cont_id;
  item_id = item_id;
  position = position;
  toggle_on = toggle_on;
}


x86 assembly (clang, -O0):
<g_DUMMY_popup_set_checkmark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @g_DUMMY_popup_set_checkmark(i32 %0, i32 %1, i32 %2, i32 %3) {
%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 %3, i32* %8
%9 = load i32, i32* %5
store i32 %9, i32* %5
%10 = load i32, i32* %6
store i32 %10, i32* %6
%11 = load i32, i32* %7
store i32 %11, i32* %7
%12 = load i32, i32* %8
store i32 %12, i32* %8
ret void
}

LLVM IR (-O2):
define void @g_DUMMY_popup_set_checkmark(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
#define EACCES 129
#define EAGAIN 128
const char *str_err(int err) {
  switch (err) {
  case EACCES:
    return "EACCES";
  case EAGAIN:
    return "EAGAIN";
  default:
    return "???";
  }
}


x86 assembly (clang, -O0):
<str_err>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80,%eax
je     1140 <str_err+0x40>
jmp    111d <str_err+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
jne    1150 <str_err+0x50>
jmp    1130 <str_err+0x30>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <str_err+0x5b>
lea    0xec0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <str_err+0x5b>
lea    0xeb7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_err>:
cmp    $0x80,%edi
lea    0xefa(%rip),%rax
lea    0xefa(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x81,%edi
lea    0xedb(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"EACCES\00"
@.str.1 = [7 x i8] c"EAGAIN\00"
@.str.2 = [4 x i8] c"???\00"
define i8* @str_err(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 129, label %5
i32 128, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"EACCES\00"
@.str.1 = [7 x i8] c"EAGAIN\00"
@.str.2 = [4 x i8] c"???\00"
define i8* @str_err(i32 %0) {
%2 = icmp eq i32 %0, 128
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 129
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
void traitement_signal(int sig) {
  printf("Signal %d recu\n", sig);
  waitpid(-1, &sig, WNOHANG);
}


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x4(%rbp),%rsi
call   1040 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
push   %rax
mov    %edi,%esi
mov    %edi,0x4(%rsp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Signal %d recu\0A\00"
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 -1, i32* %2, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Signal %d recu\0A\00"
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, float *, int);
void setR4(unsigned char *p, float r) { memcpy(p, &r, 4); }


x86 assembly (clang, -O0):
<setR4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setR4>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @setR4(i8* %0, float %1) {
%3 = alloca float
store float %1, float* %3
%4 = call i32 @memcpy(i8* %0, float* %3, i32 4)
ret void
}
/* Type definitions */
typedef int volatile uint8_t;

/* Variables and functions */
void initbutton() {
  uint8_t mask = (1 << 4);
  *(volatile uint8_t *)((0x5005 + 2)) &= ~mask;
  *(volatile uint8_t *)((0x5005 + 3)) |= mask;
  *(volatile uint8_t *)((0x5005 + 4)) &= ~mask;
}


x86 assembly (clang, -O0):
<initbutton>:
push   %rbp
mov    %rsp,%rbp
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    $0x5007,%ecx
mov    (%rcx),%ecx
and    %eax,%ecx
mov    $0x5007,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x5008,%ecx
mov    (%rcx),%ecx
or     %eax,%ecx
mov    $0x5008,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    $0x5009,%ecx
mov    (%rcx),%ecx
and    %eax,%ecx
mov    $0x5009,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initbutton>:
movl   $0x10,-0x4(%rsp)
mov    -0x4(%rsp),%eax
not    %eax
and    %eax,0x5007
mov    -0x4(%rsp),%eax
or     %eax,0x5008
mov    -0x4(%rsp),%eax
not    %eax
and    %eax,0x5009
ret

LLVM IR (-O0):
define void @initbutton() {
%1 = alloca i32
store volatile i32 16, i32* %1
%2 = load volatile i32, i32* %1
%3 = xor i32 %2, -1
%4 = load volatile i32, i32* inttoptr (i64 20487 to i32*)
%5 = and i32 %4, %3
store volatile i32 %5, i32* inttoptr (i64 20487 to i32*)
%6 = load volatile i32, i32* %1
%7 = load volatile i32, i32* inttoptr (i64 20488 to i32*)
%8 = or i32 %7, %6
store volatile i32 %8, i32* inttoptr (i64 20488 to i32*)
%9 = load volatile i32, i32* %1
%10 = xor i32 %9, -1
%11 = load volatile i32, i32* inttoptr (i64 20489 to i32*)
%12 = and i32 %11, %10
store volatile i32 %12, i32* inttoptr (i64 20489 to i32*)
ret void
}

LLVM IR (-O2):
define void @initbutton() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 16, i32* %1
%3 = load volatile i32, i32* %1
%4 = xor i32 %3, -1
%5 = load volatile i32, i32* inttoptr (i64 20487 to i32*)
%6 = and i32 %5, %4
store volatile i32 %6, i32* inttoptr (i64 20487 to i32*)
%7 = load volatile i32, i32* %1
%8 = load volatile i32, i32* inttoptr (i64 20488 to i32*)
%9 = or i32 %8, %7
store volatile i32 %9, i32* inttoptr (i64 20488 to i32*)
%10 = load volatile i32, i32* %1
%11 = xor i32 %10, -1
%12 = load volatile i32, i32* inttoptr (i64 20489 to i32*)
%13 = and i32 %12, %11
store volatile i32 %13, i32* inttoptr (i64 20489 to i32*)
ret void
}
/* Variables and functions */
int strncasecmp(char *, char *, int);
int uwsgi_strnicmp(char *src, int slen, char *dst, int dlen) {
  if (slen != dlen)
    return 1;
  return strncasecmp(src, dst, dlen);
}


x86 assembly (clang, -O0):
<uwsgi_strnicmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     113e <uwsgi_strnicmp+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1151 <uwsgi_strnicmp+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <strncasecmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_strnicmp>:
cmp    %ecx,%esi
jne    1120 <uwsgi_strnicmp+0x10>
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <strncasecmp@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @uwsgi_strnicmp(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = icmp eq i32 %1, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @strncasecmp(i8* %0, i8* %2, i32 %1)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ 1, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ sig_catch(int /*<<< orphan*/, int /*<<< orphan*/);
void sig_pipeignore(void) { sig_catch(SIGPIPE, SIG_IGN); }


x86 assembly (clang, -O0):
<sig_pipeignore>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
call   1030 <sig_catch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_pipeignore>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
jmp    1030 <sig_catch@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @sig_pipeignore() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @sig_catch(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @sig_pipeignore() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @sig_catch(i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA13_DMA29_DriverIRQHandler();
__attribute__((weak)) void DMA13_DMA29_IRQHandler(void) {
  DMA13_DMA29_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @DMA13_DMA29_IRQHandler() {
%1 = tail call i32 (...) @DMA13_DMA29_DriverIRQHandler()
ret void
}
int XoMonochrome(pdepthlist, numdepths)
int *pdepthlist;
int numdepths;
{
  int i;
  for (i = 0; i < numdepths; i++) {
    if (pdepthlist[i] >= 8)
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<XoMonochrome>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114f <XoMonochrome+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x8,(%rax,%rcx,4)
jl     113c <XoMonochrome+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1156 <XoMonochrome+0x56>
jmp    1141 <XoMonochrome+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <XoMonochrome+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<XoMonochrome>:
mov    $0x1,%eax
test   %esi,%esi
jle    111f <XoMonochrome+0x1f>
mov    %esi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpl   $0x8,(%rdi,%rdx,4)
jge    1120 <XoMonochrome+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <XoMonochrome+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @XoMonochrome(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp sgt i32 %11, 7
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %14, label %6
14: ; preds = %8, %6, %2
%15 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ ArdBir1(int, int);
int /*<<< orphan*/ Presentazione(int, int);
void ArdBir() {
  Presentazione(2, 1);
  ArdBir1(6, 1);
}


x86 assembly (clang, -O0):
<ArdBir>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <Presentazione@plt>
mov    $0x6,%edi
mov    $0x1,%esi
call   1030 <ArdBir1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ArdBir>:
push   %rax
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <Presentazione@plt>
mov    $0x6,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <ArdBir1@plt>

LLVM IR (-O0):
define void @ArdBir() {
%1 = call i32 @Presentazione(i32 2, i32 1)
%2 = call i32 @ArdBir1(i32 6, i32 1)
ret void
}

LLVM IR (-O2):
define void @ArdBir() {
%1 = tail call i32 @Presentazione(i32 2, i32 1)
%2 = tail call i32 @ArdBir1(i32 6, i32 1)
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
};
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int sem_timedwait(int /*<<< orphan*/ *, struct timespec *);
int sem_twait(sem_t *sem, int t) {
  struct timespec ts;
  clock_gettime(CLOCK_REALTIME, &ts);
  ts.tv_sec += t;
  return (sem_timedwait(sem, &ts));
}


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

x86 assembly (clang, -O2):
<sem_twait>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%r15
mov    %r15,%rsi
call   1030 <clock_gettime@plt>
add    %ebx,0x8(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <sem_timedwait@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @sem_twait(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca %struct.timespec
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* @CLOCK_REALTIME
%7 = call i32 @clock_gettime(i32 %6, %struct.timespec* %5)
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
store i32 %11, i32* %9
%12 = load i32*, i32** %3
%13 = call i32 @sem_timedwait(i32* %12, %struct.timespec* %5)
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @sem_twait(i32* %0, i32 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to i8*
%5 = load i32, i32* @CLOCK_REALTIME
%6 = call i32 @clock_gettime(i32 %5, %struct.timespec* %3)
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %8, %1
store i32 %9, i32* %7
%10 = call i32 @sem_timedwait(i32* %0, %struct.timespec* %3)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _chmod_error(char const *message, int ret) {
  fputs("chmod"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_chmod_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_chmod_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"chmod: \00"
@stderr = global i32 0
define i32 @_chmod_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"chmod: \00"
@stderr = global i32 0
define i32 @_chmod_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
int adds_si_test1(int a, int b, int c) {
  int d = a + b;
  if (d == 0)
    return a + c;
  else
    return d;
}


x86 assembly (clang, -O0):
<adds_si_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    112e <adds_si_test1+0x2e>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <adds_si_test1+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adds_si_test1>:
lea    (%rsi,%rdi,1),%ecx
lea    (%rdx,%rdi,1),%eax
test   %ecx,%ecx
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @adds_si_test1(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %2, %0
%7 = select i1 %5, i32 %6, i32 %4
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_sll_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_sll_epi16(__m128i A, __m128i B) { return _mm_sll_epi16(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_sll_epi16>:
jmp    1030 <_mm_sll_epi16@plt>

LLVM IR (-O0):
define i32 @test_mm_sll_epi16(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 @_mm_sll_epi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_sll_epi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sll_epi16(i32 %0, i32 %1)
ret i32 %3
}
__attribute__((const)) int render_point(int x0, int y0, int x1, int y1, int x) {
  return y0 + ((y1 - y0) * (x - x0) / (x1 - x0));
}


x86 assembly (clang, -O0):
<render_point>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0x4(%rbp),%ecx
imul   %ecx,%eax
mov    -0xc(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_point>:
mov    %r8d,%eax
mov    %edx,%r8d
sub    %esi,%ecx
sub    %edi,%eax
imul   %ecx,%eax
sub    %edi,%r8d
cltd
idiv   %r8d
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @render_point(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %7
%12 = load i32, i32* %9
%13 = load i32, i32* %7
%14 = sub nsw i32 %12, %13
%15 = load i32, i32* %10
%16 = load i32, i32* %6
%17 = sub nsw i32 %15, %16
%18 = mul nsw i32 %14, %17
%19 = load i32, i32* %8
%20 = load i32, i32* %6
%21 = sub nsw i32 %19, %20
%22 = sdiv i32 %18, %21
%23 = add nsw i32 %11, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @render_point(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sub nsw i32 %3, %1
%7 = sub nsw i32 %4, %0
%8 = mul nsw i32 %7, %6
%9 = sub nsw i32 %2, %0
%10 = sdiv i32 %8, %9
%11 = add nsw i32 %10, %1
ret i32 %11
}
/* Variables and functions */
int log2f(float);
int /*<<< orphan*/ printf(char *, int);
void fft_throughput(double time_ms, float fftlen) {
  printf("Throughput : %lf GFlops\n",
         5 * fftlen * log2f(fftlen) / (time_ms * 1e6));
}


x86 assembly (clang, -O0):
<fft_throughput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  0xece(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <log2f@plt>
movss  -0x10(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe99(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fft_throughput>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movss  0xece(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
movaps %xmm1,%xmm0
call   1040 <log2f@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0xea5(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xe9e(%rip),%rdi
add    $0x18,%rsp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Throughput : %lf GFlops\0A\00"
define void @fft_throughput(double %0, float %1) {
%3 = alloca double
%4 = alloca float
store double %0, double* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fmul float 5.000000e+00, %5
%7 = load float, float* %4
%8 = call i32 @log2f(float %7)
%9 = sitofp i32 %8 to float
%10 = fmul float %6, %9
%11 = fpext float %10 to double
%12 = load double, double* %3
%13 = fmul double %12, 1.000000e+06
%14 = fdiv double %11, %13
%15 = fptosi double %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Throughput : %lf GFlops\0A\00"
define void @fft_throughput(double %0, float %1) {
%3 = fmul float %1, 5.000000e+00
%4 = tail call i32 @log2f(float %1)
%5 = sitofp i32 %4 to float
%6 = fmul float %3, %5
%7 = fpext float %6 to double
%8 = fmul double %0, 1.000000e+06
%9 = fdiv double %7, %8
%10 = fptosi double %9 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int arr[], int m) {
  for (int i = 0; i < m; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}