xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test(int k) { printf("%d", k); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @test(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
unsigned short qConvertRgb32To16(unsigned int c) {
  return (((c) >> 3) & 0x001f) | (((c) >> 5) & 0x07e0) | (((c) >> 8) & 0xf800);
}


x86 assembly (clang, -O0):
<qConvertRgb32To16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x3,%eax
and    $0x1f,%eax
mov    -0x4(%rbp),%ecx
shr    $0x5,%ecx
and    $0x7e0,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xf800,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qConvertRgb32To16>:
mov    %edi,%ecx
shr    $0x3,%ecx
and    $0x1f,%ecx
mov    %edi,%eax
shr    $0x5,%eax
and    $0x7e0,%eax
or     %ecx,%eax
shr    $0x8,%edi
and    $0xf800,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @qConvertRgb32To16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 3
%5 = and i32 %4, 31
%6 = load i32, i32* %2
%7 = lshr i32 %6, 5
%8 = and i32 %7, 2016
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = lshr i32 %10, 8
%12 = and i32 %11, 63488
%13 = or i32 %9, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @qConvertRgb32To16(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 31
%4 = lshr i32 %0, 5
%5 = and i32 %4, 2016
%6 = or i32 %3, %5
%7 = lshr i32 %0, 8
%8 = and i32 %7, 63488
%9 = or i32 %6, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *);
int myinit(void) {
  pr_info("vermagic_fail\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<myinit>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <pr_info@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"vermagic_fail\0A\00"
define i32 @myinit() {
%1 = call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"vermagic_fail\0A\00"
define i32 @myinit() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ uart_printf(char *);
int main(int argc, char **argv) {
  int i = 0;
  uart_printf("carter is basic\n");
  while (1) {
    i = i;
  }
  return i;
}


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)
movl   $0x0,-0x14(%rbp)
lea    0xecc(%rip),%rdi
call   1030 <uart_printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <main+0x29>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <uart_printf@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [17 x i8] c"carter is basic\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 @uart_printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %8
%9 = load i32, i32* %6
store i32 %9, i32* %6
br label %8
}

LLVM IR (-O2):
@.str = [17 x i8] c"carter is basic\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @uart_printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %4, %2
br label %4
}
short FIX_MPY(short a, short b) {
  int c = ((int)a * (int)b) >> 14;
  b = c & 0x01;
  a = (c >> 1) + b;
  return a;
}


x86 assembly (clang, -O0):
<FIX_MPY>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
imul   %ecx,%eax
sar    $0xe,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIX_MPY>:
imul   %esi,%edi
mov    %edi,%eax
shr    $0xe,%eax
and    $0x1,%eax
shr    $0xf,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @FIX_MPY(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
%8 = load i16, i16* %4
%9 = sext i16 %8 to i32
%10 = mul nsw i32 %7, %9
%11 = ashr i32 %10, 14
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = and i32 %12, 1
%14 = trunc i32 %13 to i16
store i16 %14, i16* %4
%15 = load i32, i32* %5
%16 = ashr i32 %15, 1
%17 = load i16, i16* %4
%18 = sext i16 %17 to i32
%19 = add nsw i32 %16, %18
%20 = trunc i32 %19 to i16
store i16 %20, i16* %3
%21 = load i16, i16* %3
ret i16 %21
}

LLVM IR (-O2):
define signext i16 @FIX_MPY(i16 signext %0, i16 signext %1) {
%3 = sext i16 %0 to i32
%4 = sext i16 %1 to i32
%5 = mul nsw i32 %4, %3
%6 = lshr i32 %5, 14
%7 = and i32 %6, 1
%8 = lshr i32 %5, 15
%9 = add nuw nsw i32 %7, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}
void swap(int *v1, int *v2) {
  int tempValue = *v1;
  *v1 = *v2;
  *v2 = tempValue;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ calcVarianceFromSums(double, double, unsigned long long);
double sqrt(int /*<<< orphan*/);
double calcStdFromSums(double sum, double sumSquares, unsigned long long n) {
  return sqrt(calcVarianceFromSums(sum, sumSquares, n));
}


x86 assembly (clang, -O0):
<calcStdFromSums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rdi
call   1040 <calcVarianceFromSums@plt>
mov    %eax,%edi
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcStdFromSums>:
push   %rax
call   1040 <calcVarianceFromSums@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @calcStdFromSums(double %0, double %1, i64 %2) {
%4 = tail call i32 @calcVarianceFromSums(double %0, double %1, i64 %2)
%5 = tail call double @sqrt(i32 %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led0Toggle();
void TelosbBaseStationC__Leds__led0Toggle(void) { LedsP__Leds__led0Toggle(); }


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

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

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

LLVM IR (-O2):
define void @TelosbBaseStationC__Leds__led0Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led0Toggle()
ret void
}
/* Variables and functions */
int scan_for_uintN(char const *, int, unsigned long long *, char const **);
int scan_for_uint16(const char *_str, unsigned short *ret_, const char **end_) {
  unsigned long long ret;
  int b_err = scan_for_uintN(_str, 16, &ret, end_);
  if (ret_) {
    *ret_ = (unsigned short)ret;
  }
  return b_err;
}


x86 assembly (clang, -O0):
<scan_for_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x10,%esi
lea    -0x20(%rbp),%rdx
call   1030 <scan_for_uintN@plt>
mov    %eax,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1156 <scan_for_uint16+0x46>
mov    -0x20(%rbp),%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_for_uint16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rcx
mov    %rsi,%rbx
lea    0x8(%rsp),%rdx
mov    $0x10,%esi
call   1030 <scan_for_uintN@plt>
test   %rbx,%rbx
je     1137 <scan_for_uint16+0x27>
movzwl 0x8(%rsp),%ecx
mov    %cx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @scan_for_uint16(i8* %0, i16* writeonly %1, i8** %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i32 @scan_for_uintN(i8* %0, i32 16, i64* %4, i8** %2)
%7 = icmp eq i16* %1, null
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i16
store i16 %10, i16* %1
br label %11
11: ; preds = %8, %3
ret i32 %6
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __NR_epoll_wait;
int syscall(int /*<<< orphan*/, int, struct epoll_event *, int, int);
int epoll_wait(int epfd, struct epoll_event *events, int maxevents,
               int timeout) {
  return (syscall(__NR_epoll_wait, epfd, events, maxevents, timeout));
}


x86 assembly (clang, -O0):
<epoll_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoll_wait>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
@__NR_epoll_wait = global i32 0
define i32 @epoll_wait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.epoll_event*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.epoll_event* %1, %struct.epoll_event** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @__NR_epoll_wait
%10 = load i32, i32* %5
%11 = load %struct.epoll_event*, %struct.epoll_event** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @syscall(i32 %9, i32 %10, %struct.epoll_event* %11, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
@__NR_epoll_wait = global i32 0
define i32 @epoll_wait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3) {
%5 = load i32, i32* @__NR_epoll_wait
%6 = tail call i32 @syscall(i32 %5, i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int read16(int /*<<< orphan*/ *);
int read32(FILE *f) {
  int i, j, k;
  i = read16(f);
  j = read16(f);
  k = 65536 * j + i;
  return (k);
}


x86 assembly (clang, -O0):
<read32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read16@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read16@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read32>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <read16@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <read16@plt>
shl    $0x10,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read32(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 = call i32 @read16(i32* %6)
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = call i32 @read16(i32* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = mul nsw i32 65536, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @read32(i32* %0) {
%2 = tail call i32 @read16(i32* %0)
%3 = tail call i32 @read16(i32* %0)
%4 = shl nsw i32 %3, 16
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ svalue;

/* Variables and functions */
int /*<<< orphan*/ opt_set_string(char const *, char const *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, double, int, double);
void opt_set_double2(const char *section, const char *key, double p1, double p2,
                     int places) {
  char svalue[64];
  snprintf(svalue, sizeof(svalue), "(%.*f, %.*f)", places, p1, places, p2);
  opt_set_string(section, key, svalue);
}


x86 assembly (clang, -O0):
<opt_set_double2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x24(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
mov    -0x24(%rbp),%r8d
movsd  -0x20(%rbp),%xmm1
mov    $0x40,%esi
lea    0xea2(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1040 <opt_set_string@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_set_double2>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %edx,%ecx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec8(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x40,%esi
mov    %ecx,%r8d
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <opt_set_string@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"(%.*f, %.*f)\00"
define void @opt_set_double2(i8* %0, i8* %1, double %2, double %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca [64 x i8]
store i8* %0, i8** %6
store i8* %1, i8** %7
store double %2, double* %8
store double %3, double* %9
store i32 %4, i32* %10
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%13 = load i32, i32* %10
%14 = load double, double* %8
%15 = load i32, i32* %10
%16 = load double, double* %9
%17 = call i32 @snprintf(i8* %12, i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %13, double %14, i32 %15, double %16)
%18 = load i8*, i8** %6
%19 = load i8*, i8** %7
%20 = getelementptr inbounds [64 x i8], [64 x i8]* %11, i64 0, i64 0
%21 = call i32 @opt_set_string(i8* %18, i8* %19, i8* %20)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"(%.*f, %.*f)\00"
define void @opt_set_double2(i8* %0, i8* %1, double %2, double %3, i32 %4) {
%6 = alloca [64 x i8]
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%8 = call i32 @snprintf(i8* %7, i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4, double %2, i32 %4, double %3)
%9 = call i32 @opt_set_string(i8* %0, i8* %1, i8* %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ diminuto_ipc_stream_read(int, void *, size_t);
ssize_t diminuto_ipcl_stream_read(int fd, void *buffer, size_t size) {
  return diminuto_ipc_stream_read(fd, buffer, size);
}


x86 assembly (clang, -O0):
<diminuto_ipcl_stream_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <diminuto_ipc_stream_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_ipcl_stream_read>:
jmp    1030 <diminuto_ipc_stream_read@plt>

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

LLVM IR (-O2):
define i32 @diminuto_ipcl_stream_read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @diminuto_ipc_stream_read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int);
void DoRshift(void) { InlineWords(2, 36, 34); }


x86 assembly (clang, -O0):
<DoRshift>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x24,%esi
mov    $0x22,%edx
call   1030 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoRshift>:
mov    $0x2,%edi
mov    $0x24,%esi
mov    $0x22,%edx
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoRshift() {
%1 = call i32 @InlineWords(i32 2, i32 36, i32 34)
ret void
}

LLVM IR (-O2):
define void @DoRshift() {
%1 = tail call i32 @InlineWords(i32 2, i32 36, i32 34)
ret void
}
/* Variables and functions */
int random();
int /*<<< orphan*/ srandom(int);
int time(int /*<<< orphan*/ *);
int getCapacity() {
  srandom(time(NULL) * random());
  return random() % (50 + 1 - 10) + 10;
}


x86 assembly (clang, -O0):
<getCapacity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <random@plt>
mov    -0x4(%rbp),%edi
imul   %eax,%edi
call   1030 <srandom@plt>
mov    $0x0,%al
call   1050 <random@plt>
mov    $0x29,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0xa,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCapacity>:
push   %rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <random@plt>
imul   %eax,%ebx
mov    %ebx,%edi
call   1030 <srandom@plt>
xor    %eax,%eax
call   1050 <random@plt>
cltq
imul   $0x63e7063f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,8),%ecx
neg    %ecx
add    %ecx,%eax
add    $0xa,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getCapacity() {
%1 = call i32 @time(i32* null)
%2 = call i32 (...) @random()
%3 = mul nsw i32 %1, %2
%4 = call i32 @srandom(i32 %3)
%5 = call i32 (...) @random()
%6 = srem i32 %5, 41
%7 = add nsw i32 %6, 10
ret i32 %7
}

LLVM IR (-O2):
define i32 @getCapacity() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 (...) @random()
%3 = mul nsw i32 %2, %1
%4 = tail call i32 @srandom(i32 %3)
%5 = tail call i32 (...) @random()
%6 = srem i32 %5, 41
%7 = add nsw i32 %6, 10
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_20() {
  Assert_real((isqrt(20) == 4),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              105, ("Integer square root of 20 should be 4"));
}


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

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

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 20 should be 4\00"
define void @t_sqrt_20() {
%1 = call i32 @isqrt(i32 20)
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 105, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 20 should be 4\00"
define void @t_sqrt_20() {
%1 = tail call i32 @isqrt(i32 20)
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 105, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(unsigned int);
int /*<<< orphan*/ puts(char *);
void b2a(unsigned int value) {
  unsigned int quotient;
  quotient = value / 10;
  if (quotient != 0)
    b2a(quotient);
  putchar(value % 10 + '0');
  puts("\n");
}


x86 assembly (clang, -O0):
<b2a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115c <b2a+0x2c>
mov    -0x8(%rbp),%edi
call   1050 <b2a@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <putchar@plt>
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b2a>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%r14d
cmp    $0xa,%edi
jb     1150 <b2a+0x20>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1050 <b2a@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
lea    0xe8b(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @b2a(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = udiv i32 %0, 10
tail call void @b2a(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = urem i32 %0, 10
%7 = or i32 %6, 48
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
signed long int
signedlongint_ignoring_signedlonglongint(signed long int x,
                                         signed long long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlongint_ignoring_signedlonglongint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signedlongint_ignoring_signedlonglongint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlongint_ignoring_signedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
size_t strlen(char *);
void sccat(char *dst, char chr, unsigned int siz) {
  if (strlen(dst) < siz - 1) {
    dst[strlen(dst) + 1] = '\0';
    dst[strlen(dst)] = chr;
  }
}


x86 assembly (clang, -O0):
<sccat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
cmp    %rcx,%rax
jae    1180 <sccat+0x70>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
movb   $0x0,0x1(%rax,%rcx,1)
mov    -0x9(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x19(%rbp),%dl
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sccat>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    $0xffffffff,%ebp
cmp    %rbp,%rax
jae    113a <sccat+0x2a>
movb   $0x0,0x1(%rax,%rbx,1)
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14b,(%rbx,%rax,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @sccat(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = add i32 %2, -1
%6 = zext i32 %5 to i64
%7 = icmp ult i64 %4, %6
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = add nuw i64 %4, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
%11 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 %1, i8* %12
br label %13
13: ; preds = %8, %3
ret void
}
/* Type definitions */
struct rtas_io_scn {
  int dummy;
};
struct rtas_event {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_re_scn(struct rtas_event *, int);
struct rtas_io_scn *rtas_get_io_scn(struct rtas_event *re) {
  return (struct rtas_io_scn *)get_re_scn(re, 4);
}


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

x86 assembly (clang, -O2):
<rtas_get_io_scn>:
mov    $0x4,%esi
jmp    1030 <get_re_scn@plt>

LLVM IR (-O0):
%struct.rtas_io_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_io_scn* @rtas_get_io_scn(%struct.rtas_event* %0) {
%2 = alloca %struct.rtas_event*
store %struct.rtas_event* %0, %struct.rtas_event** %2
%3 = load %struct.rtas_event*, %struct.rtas_event** %2
%4 = call i64 @get_re_scn(%struct.rtas_event* %3, i32 4)
%5 = inttoptr i64 %4 to %struct.rtas_io_scn*
ret %struct.rtas_io_scn* %5
}

LLVM IR (-O2):
%struct.rtas_io_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_io_scn* @rtas_get_io_scn(%struct.rtas_event* %0) {
%2 = tail call i64 @get_re_scn(%struct.rtas_event* %0, i32 4)
%3 = inttoptr i64 %2 to %struct.rtas_io_scn*
ret %struct.rtas_io_scn* %3
}
/* Variables and functions */
unsigned long SysCtlPeripheralMapToNew(unsigned long);
void SysCtlPeripheralPowerOn(unsigned long ulPeripheral) {
  ;
  ulPeripheral = SysCtlPeripheralMapToNew(ulPeripheral);
  (*((volatile unsigned long
          *)(((unsigned long)(0x400fe900 + ((ulPeripheral & 0xff00) >> 8)) &
              0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x400fe900 + ((ulPeripheral & 0xff00) >> 8)) &
               0x000FFFFF)
              << 5) |
             ((ulPeripheral & 0xff) << 2)))) = 1;
}


x86 assembly (clang, -O0):
<SysCtlPeripheralPowerOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <SysCtlPeripheralMapToNew@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff00,%rax
shr    $0x8,%rax
add    $0x400fe900,%rax
movabs $0xf0000000,%rcx
and    %rcx,%rax
or     $0x2000000,%rax
mov    -0x8(%rbp),%rcx
and    $0xff00,%rcx
shr    $0x8,%rcx
add    $0x400fe900,%rcx
and    $0xfffff,%rcx
shl    $0x5,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff,%rcx
shl    $0x2,%rcx
or     %rcx,%rax
movq   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPeripheralPowerOn>:
push   %rax
call   1030 <SysCtlPeripheralMapToNew@plt>
movzbl %al,%ecx
shr    $0x3,%rax
and    $0x1fe0,%eax
shl    $0x2,%rcx
or     %rax,%rcx
movq   $0x1,0x43fd2000(%rcx)
pop    %rax
ret

LLVM IR (-O0):
define void @SysCtlPeripheralPowerOn(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @SysCtlPeripheralMapToNew(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = and i64 %5, 65280
%7 = lshr i64 %6, 8
%8 = add i64 1074784512, %7
%9 = and i64 %8, 4026531840
%10 = or i64 %9, 33554432
%11 = load i64, i64* %2
%12 = and i64 %11, 65280
%13 = lshr i64 %12, 8
%14 = add i64 1074784512, %13
%15 = and i64 %14, 1048575
%16 = shl i64 %15, 5
%17 = or i64 %10, %16
%18 = load i64, i64* %2
%19 = and i64 %18, 255
%20 = shl i64 %19, 2
%21 = or i64 %17, %20
%22 = inttoptr i64 %21 to i64*
store volatile i64 1, i64* %22
ret void
}

LLVM IR (-O2):
define void @SysCtlPeripheralPowerOn(i64 %0) {
%2 = tail call i64 @SysCtlPeripheralMapToNew(i64 %0)
%3 = lshr i64 %2, 3
%4 = and i64 %3, 8160
%5 = shl i64 %2, 2
%6 = and i64 %5, 1020
%7 = or i64 %6, %4
%8 = or i64 %7, 1140662272
%9 = inttoptr i64 %8 to i64*
store volatile i64 1, i64* %9
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int _exm_file_name_strcmp(const void *d1, const void *d2) {
  return strcmp((const char *)d1, (const char *)d2);
}


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

x86 assembly (clang, -O2):
<_exm_file_name_strcmp>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @_exm_file_name_strcmp(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 i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_exm_file_name_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
unsigned long long foo(unsigned long long x) { return __builtin_ctzl(x); }


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

x86 assembly (clang, -O2):
<foo>:
bsf    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.cttz.i64(i64 %3, i1 true)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
ret i64 %2
}
void DoNothingHandler(sigNum) int sigNum;
{ signal(sigNum, DoNothingHandler); }


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

x86 assembly (clang, -O2):
<DoNothingHandler>:
mov    0x2ed9(%rip),%rsi
xor    %eax,%eax
jmp    1030 <signal@plt>

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

LLVM IR (-O2):
define void @DoNothingHandler(i32 %0) {
%2 = tail call i32 (i32, void (...)*, ...) bitcast (i32 (...)* @signal to i32 (i32, void (...)*, ...)*)(i32 %0, void (...)* bitcast (void (i32)* @DoNothingHandler to void (...)*))
ret void
}
/* Type definitions */
struct ext2_super_block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_super2(struct ext2_super_block *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void list_super(struct ext2_super_block *s) { list_super2(s, stdout); }


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

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

LLVM IR (-O0):
%struct.ext2_super_block = type { i32 }
@stdout = global i32 0
define void @list_super(%struct.ext2_super_block* %0) {
%2 = alloca %struct.ext2_super_block*
store %struct.ext2_super_block* %0, %struct.ext2_super_block** %2
%3 = load %struct.ext2_super_block*, %struct.ext2_super_block** %2
%4 = load i32, i32* @stdout
%5 = call i32 @list_super2(%struct.ext2_super_block* %3, i32 %4)
ret void
}

LLVM IR (-O2):
%struct.ext2_super_block = type { i32 }
@stdout = global i32 0
define void @list_super(%struct.ext2_super_block* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @list_super2(%struct.ext2_super_block* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchars(char *, int);
char *malloc(int);
int /*<<< orphan*/ putchars(char *, int);
int /*<<< orphan*/ xorchars(char *, char *, int);
int main() {
  char *text = malloc(10);
  char *key = malloc(10);
  getchars(text, 10);
  getchars(key, 10);
  xorchars(text, key, 10);
  putchars(text, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <getchars@plt>
mov    -0x18(%rbp),%rdi
mov    $0xa,%esi
call   1030 <getchars@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1060 <xorchars@plt>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1050 <putchars@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <getchars@plt>
mov    %r14,%rdi
mov    $0xa,%esi
call   1030 <getchars@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1060 <xorchars@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <putchars@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @malloc(i32 10)
store i8* %4, i8** %2
%5 = call i8* @malloc(i32 10)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @getchars(i8* %6, i32 10)
%8 = load i8*, i8** %3
%9 = call i32 @getchars(i8* %8, i32 10)
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i32 @xorchars(i8* %10, i8* %11, i32 10)
%13 = load i8*, i8** %2
%14 = call i32 @putchars(i8* %13, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%3 = tail call i32 @getchars(i8* %1, i32 10)
%4 = tail call i32 @getchars(i8* %2, i32 10)
%5 = tail call i32 @xorchars(i8* %1, i8* %2, i32 10)
%6 = tail call i32 @putchars(i8* %1, i32 10)
ret i32 0
}
/* Variables and functions */
scalar_t__ geteuid();
int /*<<< orphan*/ warnx(char *);
void check_superuser(void (*usage_fn)(void)) {
  if (geteuid() != 0) {
    warnx("Run as root and you'll be happy.\n");
    usage_fn();
  }
}


x86 assembly (clang, -O0):
<check_superuser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <geteuid@plt>
cmp    $0x0,%rax
je     114c <check_superuser+0x2c>
lea    0xebc(%rip),%rdi
call   1030 <warnx@plt>
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_superuser>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <geteuid@plt>
test   %rax,%rax
je     1142 <check_superuser+0x22>
lea    0xec9(%rip),%rdi
call   1030 <warnx@plt>
mov    %rbx,%rax
pop    %rbx
jmp    *%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Run as root and you'll be happy.\0A\00"
define void @check_superuser(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = call i64 (...) @geteuid()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @warnx(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = load void ()*, void ()** %2
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Run as root and you'll be happy.\0A\00"
define void @check_superuser(void ()* nocapture %0) {
%2 = tail call i64 (...) @geteuid()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @warnx(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
tail call void %0()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int firstValue;
  if ((firstValue = 9))
    printf("Value = %i\n", firstValue);
  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)
movl   $0x9,-0x14(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    113c <main+0x2c>
jmp    114b <main+0x3b>
mov    -0x14(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Value = %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main() {
  double length, width, high;
  scanf("%lf%lf%lf", &length, &width, &high);
  printf("%g\n", length * width * high);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%lf%lf%lf\00"
@.str.1 = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%8 = load double, double* %1
%9 = load double, double* %2
%10 = fmul double %8, %9
%11 = load double, double* %3
%12 = fmul double %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %12)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glLightfv_size(int /*<<< orphan*/);
__attribute__((visibility("internal"))) __attribute__((pure)) GLint
__glLightiv_size(GLenum e) {
  return __glLightfv_size(e);
}


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

x86 assembly (clang, -O2):
<__glLightiv_size>:
jmp    1030 <__glLightfv_size@plt>

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

LLVM IR (-O2):
define hidden i32 @__glLightiv_size(i32 %0) {
%2 = tail call i32 @__glLightfv_size(i32 %0)
ret i32 %2
}
/* Variables and functions */
float fmax(float x, float y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <fmax+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <fmax+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fmax(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @fmax(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  while (!printf("\n Hello World")) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1140 <main+0x30>
jmp    1145 <main+0x35>
jmp    111f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <printf@plt>
test   %eax,%eax
je     1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\0A Hello World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0A Hello World\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret i32 0
}
/* Type definitions */
struct dstr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dstr_copy_dstr(struct dstr *, struct dstr const *);
int /*<<< orphan*/ dstr_init(struct dstr *);
void dstr_init_copy_dstr(struct dstr *dst, const struct dstr *src) {
  dstr_init(dst);
  dstr_copy_dstr(dst, src);
}


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

x86 assembly (clang, -O2):
<dstr_init_copy_dstr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <dstr_init@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <dstr_copy_dstr@plt>

LLVM IR (-O0):
%struct.dstr = type { i32 }
define void @dstr_init_copy_dstr(%struct.dstr* %0, %struct.dstr* %1) {
%3 = alloca %struct.dstr*
%4 = alloca %struct.dstr*
store %struct.dstr* %0, %struct.dstr** %3
store %struct.dstr* %1, %struct.dstr** %4
%5 = load %struct.dstr*, %struct.dstr** %3
%6 = call i32 @dstr_init(%struct.dstr* %5)
%7 = load %struct.dstr*, %struct.dstr** %3
%8 = load %struct.dstr*, %struct.dstr** %4
%9 = call i32 @dstr_copy_dstr(%struct.dstr* %7, %struct.dstr* %8)
ret void
}

LLVM IR (-O2):
%struct.dstr = type { i32 }
define void @dstr_init_copy_dstr(%struct.dstr* %0, %struct.dstr* %1) {
%3 = tail call i32 @dstr_init(%struct.dstr* %0)
%4 = tail call i32 @dstr_copy_dstr(%struct.dstr* %0, %struct.dstr* %1)
ret void
}