xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void memcpy_good1() {
  int arr1[10];
  int arr2[20];
  memcpy(arr2, arr1, 40);
}


x86 assembly (clang, -O0):
<memcpy_good1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_good1>:
sub    $0x88,%rsp
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @memcpy_good1() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @memcpy(i32* %3, i32* %4, i32 40)
ret void
}

LLVM IR (-O2):
define void @memcpy_good1() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 40)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
scalar_t__ __rdrand64(int /*<<< orphan*/ *);
uint64_t rdrand64(void) {
  uint64_t val;
  while (__rdrand64(&val) == 0)
    ;
  return val;
}


x86 assembly (clang, -O0):
<rdrand64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <__rdrand64@plt>
cmp    $0x0,%rax
jne    1130 <rdrand64+0x20>
jmp    1118 <rdrand64+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdrand64>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <__rdrand64@plt>
test   %rax,%rax
je     1120 <rdrand64+0x10>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rdrand64() {
%1 = alloca i32
br label %2
2: ; preds = %5, %0
%3 = call i64 @__rdrand64(i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @rdrand64() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i64 @__rdrand64(i32* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = load i32, i32* %1
ret i32 %7
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int gcd(int, int);
uint64_t lcm(uint64_t a, uint64_t b) { return a * b / gcd(a, b); }


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lcm(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 = mul nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @gcd(i32 %8, i32 %9)
%11 = sdiv i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @gcd(i32 %0, i32 %1)
%5 = sdiv i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DrawTextXY121(char const *, long, long, unsigned long);
void drawtextxy(const char *s, long x, long y, unsigned long cfg) {
  DrawTextXY121(s, x, y, cfg);
}


x86 assembly (clang, -O0):
<drawtextxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <DrawTextXY121@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawtextxy>:
jmp    1030 <DrawTextXY121@plt>

LLVM IR (-O0):
define void @drawtextxy(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = call i32 @DrawTextXY121(i8* %9, i64 %10, i64 %11, i64 %12)
ret void
}

LLVM IR (-O2):
define void @drawtextxy(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @DrawTextXY121(i8* %0, i64 %1, i64 %2, i64 %3)
ret void
}
int test_imm_9Dint64_lowword_mem(long long *val) {
  return ((*val) & (0x9D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Dint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 157
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x3f() {
  Assert_real((isspace(63) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              320, ("isspace should be 0 for ?"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for ?\00"
define void @t_isspace_0x3f() {
%1 = tail call i64 @isspace(i32 63)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 320, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
bool has_prefix(const char *prefix, const char *str) {
  return strncmp(prefix, str, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<has_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_prefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @has_prefix(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 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @has_prefix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ le16toh(int /*<<< orphan*/);
uint16_t unaligned_read_le16(const void *_u) {
  const struct __attribute__((__packed__, __may_alias__)) {
    uint16_t x;
  } *u = _u;
  return le16toh(u->x);
}


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

x86 assembly (clang, -O2):
<unaligned_read_le16>:
mov    (%rdi),%edi
jmp    1030 <le16toh@plt>

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @unaligned_read_le16(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.anon*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.anon*
store %struct.anon* %5, %struct.anon** %3
%6 = load %struct.anon*, %struct.anon** %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @le16toh(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @unaligned_read_le16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @le16toh(i32 %3)
ret i32 %4
}
/* Variables and functions */
double sqrt(double);
double getStdev(double sqr_sum, double count, double avg) {
  return sqrt((sqr_sum / count) - avg * avg);
}


x86 assembly (clang, -O0):
<getStdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
divsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStdev>:
divsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
subsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <getStdev+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @getStdev(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fdiv double %7, %8
%10 = load double, double* %6
%11 = load double, double* %6
%12 = fneg double %10
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double %9)
%14 = call double @sqrt(double %13)
ret double %14
}

LLVM IR (-O2):
define double @getStdev(double %0, double %1, double %2) {
%4 = fdiv double %0, %1
%5 = fneg double %2
%6 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %4)
%7 = tail call double @sqrt(double %6)
ret double %7
}
int main(void) {
  long sum = 0;
  for (long n = 0; n < 100000000; n++) {
    sum += n;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x5f5e100,-0x18(%rbp)
05
jge    1146 <main+0x46>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <main+0x1b>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ get_random_bytes(unsigned short *, int);
unsigned short get_random_ushort() {
  unsigned short s;
  get_random_bytes(&s, sizeof(unsigned short));
  return s;
}


x86 assembly (clang, -O0):
<get_random_ushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <get_random_bytes@plt>
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_ushort>:
push   %rax
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <get_random_bytes@plt>
movzwl 0x6(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @get_random_ushort() {
%1 = alloca i16
%2 = call i32 @get_random_bytes(i16* %1, i32 2)
%3 = load i16, i16* %1
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @get_random_ushort() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = call i32 @get_random_bytes(i16* %1, i32 2)
%4 = load i16, i16* %1
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *safe_free(void *array) {
  if (array != 0)
    free(array);
  return 0;
}


x86 assembly (clang, -O0):
<safe_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <safe_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_free>:
test   %rdi,%rdi
je     111f <safe_free+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @safe_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @safe_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret i8* null
}
int luaU_endianness(void) {
  int x = 1;
  return *(char *)&x;
}


x86 assembly (clang, -O0):
<luaU_endianness>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movsbl -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @luaU_endianness() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @luaU_endianness() {
ret i32 1
}
float fahrToCelsius(float fahr) { return (5.0 / 9.0) * (fahr - 32.0); }


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

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

LLVM IR (-O0):
define float @fahrToCelsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @fahrToCelsius(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ my_malloc1(int);
int /*<<< orphan*/ my_malloc2(int);
void a450(void) {
  my_malloc2(2400);
  my_malloc1(800);
  my_malloc2(800);
  my_malloc1(400);
}


x86 assembly (clang, -O0):
<a450>:
push   %rbp
mov    %rsp,%rbp
mov    $0x960,%edi
call   1040 <my_malloc2@plt>
mov    $0x320,%edi
call   1030 <my_malloc1@plt>
mov    $0x320,%edi
call   1040 <my_malloc2@plt>
mov    $0x190,%edi
call   1030 <my_malloc1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a450>:
push   %rax
mov    $0x960,%edi
call   1040 <my_malloc2@plt>
mov    $0x320,%edi
call   1030 <my_malloc1@plt>
mov    $0x320,%edi
call   1040 <my_malloc2@plt>
mov    $0x190,%edi
pop    %rax
jmp    1030 <my_malloc1@plt>

LLVM IR (-O0):
define void @a450() {
%1 = call i32 @my_malloc2(i32 2400)
%2 = call i32 @my_malloc1(i32 800)
%3 = call i32 @my_malloc2(i32 800)
%4 = call i32 @my_malloc1(i32 400)
ret void
}

LLVM IR (-O2):
define void @a450() {
%1 = tail call i32 @my_malloc2(i32 2400)
%2 = tail call i32 @my_malloc1(i32 800)
%3 = tail call i32 @my_malloc2(i32 800)
%4 = tail call i32 @my_malloc1(i32 400)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quadrado_perfeito(float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float x;
  printf("Insira x: ");
  scanf("%f", &x);
  quadrado_perfeito(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1040 <quadrado_perfeito@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1040 <quadrado_perfeito@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Insira x: \00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = call i32 @quadrado_perfeito(float %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Insira x: \00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call i32 @quadrado_perfeito(float %5)
ret i32 0
}
/* Type definitions */
struct snd_kcontrol {
  int dummy;
};
struct snd_ctl_elem_info {
  int dummy;
};

/* Variables and functions */
int snd_ctl_enum_info(struct snd_ctl_elem_info *, int, int,
                      char const *const *);
int snd_ac97_cmedia_spdif_playback_source_info(
    struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) {
  static const char *const texts[] = {"Analog", "Digital"};
  return snd_ctl_enum_info(uinfo, 1, 2, texts);
}


x86 assembly (clang, -O0):
<snd_ac97_cmedia_spdif_playback_source_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
lea    0x2cdb(%rip),%rcx
call   1030 <snd_ctl_enum_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_ac97_cmedia_spdif_playback_source_info>:
mov    %rsi,%rdi
lea    0x2cf6(%rip),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
jmp    1030 <snd_ctl_enum_info@plt>

LLVM IR (-O0):
%struct.snd_kcontrol = type { i32 }
%struct.snd_ctl_elem_info = type { i32 }
@snd_ac97_cmedia_spdif_playback_source_info.texts = internal constant [2 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0)]
@.str = [7 x i8] c"Analog\00"
@.str.1 = [8 x i8] c"Digital\00"
define i32 @snd_ac97_cmedia_spdif_playback_source_info(%struct.snd_kcontrol* %0, %struct.snd_ctl_elem_info* %1) {
%3 = alloca %struct.snd_kcontrol*
%4 = alloca %struct.snd_ctl_elem_info*
store %struct.snd_kcontrol* %0, %struct.snd_kcontrol** %3
store %struct.snd_ctl_elem_info* %1, %struct.snd_ctl_elem_info** %4
%5 = load %struct.snd_ctl_elem_info*, %struct.snd_ctl_elem_info** %4
%6 = call i32 @snd_ctl_enum_info(%struct.snd_ctl_elem_info* %5, i32 1, i32 2, i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @snd_ac97_cmedia_spdif_playback_source_info.texts, i64 0, i64 0))
ret i32 %6
}

LLVM IR (-O2):
%struct.snd_kcontrol = type { i32 }
%struct.snd_ctl_elem_info = type { i32 }
@snd_ac97_cmedia_spdif_playback_source_info.texts = internal constant [2 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0)]
@.str = [7 x i8] c"Analog\00"
@.str.1 = [8 x i8] c"Digital\00"
define i32 @snd_ac97_cmedia_spdif_playback_source_info(%struct.snd_kcontrol* nocapture readnone %0, %struct.snd_ctl_elem_info* %1) {
%3 = tail call i32 @snd_ctl_enum_info(%struct.snd_ctl_elem_info* %1, i32 1, i32 2, i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @snd_ac97_cmedia_spdif_playback_source_info.texts, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hej(void) { printf("hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define void @hej() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rmdir(char *);
int strlen(char *);
void os_donewithdir(char *dir) {
  char *p;
  p = dir + strlen(dir) - 1;
  *p = '\0';
  rmdir(dir);
}


x86 assembly (clang, -O0):
<os_donewithdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <rmdir@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_donewithdir>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <rmdir@plt>

LLVM IR (-O0):
define void @os_donewithdir(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = getelementptr inbounds i8, i8* %8, i64 -1
store i8* %9, i8** %3
%10 = load i8*, i8** %3
store i8 0, i8* %10
%11 = load i8*, i8** %2
%12 = call i32 @rmdir(i8* %11)
ret void
}

LLVM IR (-O2):
define void @os_donewithdir(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
store i8 0, i8* %5
%6 = tail call i32 @rmdir(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deliver(int, int);
void incoming__wrappee__Base(int client, int msg) {
  {
    { deliver(client, msg); }
    return;
  }
}


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

x86 assembly (clang, -O2):
<incoming__wrappee__Base>:
jmp    1030 <deliver@plt>

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

LLVM IR (-O2):
define void @incoming__wrappee__Base(i32 %0, i32 %1) {
%3 = tail call i32 @deliver(i32 %0, i32 %1)
ret void
}
int Isspace(ch)
int ch;
{ return (ch == ' ' || ch == '\t' || ch == 10 || ch == 13); }


x86 assembly (clang, -O0):
<Isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <Isspace+0x3e>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <Isspace+0x3e>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <Isspace+0x3e>
cmpl   $0xd,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Isspace>:
cmp    $0x20,%edi
ja     111d <Isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    111d <Isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xd,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @Isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 13
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @Isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int sum_array(int array[5]) {
  int index, sum = 0;
  for (index = 0; index < 5; index++) {
    sum = sum + array[index];
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    113f <sum_array+0x3f>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <sum_array+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_array>:
movdqu 0x4(%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @sum_array(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = bitcast i32* %3 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %5)
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int main(void) {
  int n = 3;
  int m = 4;
  int a[n][6];
  int(*p)[4];
  p = a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x18(%rbp)
lea    (%rcx,%rcx,2),%rax
lea    0xf(,%rax,8),%rdx
movabs $0x3ffffffff0,%rax
and    %rax,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca [4 x i32]*
store i32 0, i32* %1
store i32 3, i32* %2
store i32 4, i32* %3
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %4
%10 = alloca [6 x i32], i64 %8
store i64 %8, i64* %5
%11 = bitcast [6 x i32]* %10 to [4 x i32]*
store [4 x i32]* %11, [4 x i32]** %6
store i32 0, i32* %1
%12 = load i8*, i8** %4
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_usage(char *argv0) {
  fprintf(stderr, "Usage: %s -s <SIZE> [-p] [-c]\n", argv0);
  fprintf(stderr, "Required arguments:\n"
                  "  -s <SIZE>\tthe size of the NxN matrix, a.k.a. N\n"
                  "Optional arguments:\n"
                  "  -p\t\tprint the initial matrix and the rotated one\n"
                  "  -c\t\tcheck correctness (uses double amount of memory)\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeeb(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: %s -s <SIZE> [-p] [-c]\0A\00"
@.str.1 = [196 x i8] c"Required arguments:\0A -s <SIZE>\09the size of the NxN matrix, a.k.a. N\0AOptional arguments:\0A -p\09\09print the initial matrix and the rotated one\0A -c\09\09check correctness (uses double amount of memory)\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: %s -s <SIZE> [-p] [-c]\0A\00"
@.str.1 = [196 x i8] c"Required arguments:\0A -s <SIZE>\09the size of the NxN matrix, a.k.a. N\0AOptional arguments:\0A -p\09\09print the initial matrix and the rotated one\0A -c\09\09check correctness (uses double amount of memory)\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((no, noclone)) unsigned __int128 t103_5sub(signed char x) {
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, (unsigned short)(6), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t103_5sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x11(%rbp)
movsbq -0x11(%rbp),%rdx
mov    %rdx,%r9
sar    $0x3f,%r9
add    $0xfffffffffffffffa,%rdx
mov    %r9,%rcx
adc    $0xffffffffffffffff,%rcx
mov    %r9,%r8
adc    $0xffffffffffffffff,%r8
adc    $0xffffffffffffffff,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
test   $0x1,%al
jne    1175 <t103_5sub+0x65>
jmp    117c <t103_5sub+0x6c>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t103_5sub>:
push   %r14
push   %rbx
push   %rax
movslq %edi,%r14
mov    %r14,%rbx
sar    $0x3f,%rbx
add    $0xfffffffffffffffa,%r14
adc    $0xffffffffffffffff,%rbx
cmp    $0x5,%dil
jg     1133 <t103_5sub+0x23>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t103_5sub(i8 signext %0) {
%2 = alloca i128
%3 = alloca i8
%4 = alloca i128
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i129
%7 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %6, i129 6)
%8 = extractvalue { i129, i1 } %7, 1
%9 = extractvalue { i129, i1 } %7, 0
%10 = trunc i129 %9 to i128
%11 = zext i128 %10 to i129
%12 = icmp ne i129 %9, %11
%13 = or i1 %8, %12
store i128 %10, i128* %4
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = call i32 (...) @bar()
br label %16
16: ; preds = %14, %1
%17 = load i128, i128* %4
store i128 %17, i128* %2
%18 = bitcast i128* %2 to { i64, i64 }*
%19 = load { i64, i64 }, { i64, i64 }* %18
ret { i64, i64 } %19
}

LLVM IR (-O2):
define { i64, i64 } @t103_5sub(i8 signext %0) {
%2 = sext i8 %0 to i129
%3 = add nsw i129 %2, -6
%4 = icmp slt i8 %0, 6
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @bar()
br label %7
7: ; preds = %5, %1
%8 = trunc i129 %3 to i64
%9 = lshr i129 %3, 64
%10 = trunc i129 %9 to i64
%11 = insertvalue { i64, i64 } poison, i64 %8, 0
%12 = insertvalue { i64, i64 } %11, i64 %10, 1
ret { i64, i64 } %12
}
/* Type definitions */
struct sembuf {
  int member_1;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int semop(int, struct sembuf *, int);
int v(int semid) {
  struct sembuf sops = {0, 1, 0};
  return (semop(semid, &sops, 1));
}


x86 assembly (clang, -O0):
<v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@__const.v.sops = %struct.sembuf { i32 0, i32 1, i32 0 }
define i32 @v(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sembuf
store i32 %0, i32* %2
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = load i32, i32* %2
%6 = call i32 @semop(i32 %5, %struct.sembuf* %3, i32 1)
ret i32 %6
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@__const.v.sops = %struct.sembuf { i32 0, i32 1, i32 0 }
define i32 @v(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int do_init();
int es_init(void) {
  int err;
  err = do_init();
  return err;
}


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

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

LLVM IR (-O0):
define i32 @es_init() {
%1 = alloca i32
%2 = call i32 (...) @do_init()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @es_init() {
%1 = tail call i32 (...) @do_init()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
void *malloc(size_t);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *xmalloc(size_t size) {
  void *ptr;
  ptr = malloc(size);
  if (!ptr)
    die("malloc of %d bytes failed: %s\n", size, strerror(errno));
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117c <xmalloc+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xe89(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1163 <xmalloc+0x33>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea7(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"malloc of %d bytes failed: %s\0A\00"
@errno = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = load i32, i32* @errno
%11 = call i32 @strerror(i32 %10)
%12 = call i32 @die(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %9, i32 %11)
br label %13
13: ; preds = %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [31 x i8] c"malloc of %d bytes failed: %s\0A\00"
@errno = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @die(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %0, i32 %6)
br label %8
8: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
struct mat4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat4_scale(float *, float *, float);
__attribute__((always_)) struct mat4 *psmat4_scale(struct mat4 *result,
                                                   struct mat4 *m, float s) {
  mat4_scale((float *)result, (float *)m, s);
  return result;
}


x86 assembly (clang, -O0):
<psmat4_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
call   1030 <mat4_scale@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat4_scale>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat4_scale@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_scale(%struct.mat4* %0, %struct.mat4* %1, float %2) {
%4 = alloca %struct.mat4*
%5 = alloca %struct.mat4*
%6 = alloca float
store %struct.mat4* %0, %struct.mat4** %4
store %struct.mat4* %1, %struct.mat4** %5
store float %2, float* %6
%7 = load %struct.mat4*, %struct.mat4** %4
%8 = bitcast %struct.mat4* %7 to float*
%9 = load %struct.mat4*, %struct.mat4** %5
%10 = bitcast %struct.mat4* %9 to float*
%11 = load float, float* %6
%12 = call i32 @mat4_scale(float* %8, float* %10, float %11)
%13 = load %struct.mat4*, %struct.mat4** %4
ret %struct.mat4* %13
}

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_scale(%struct.mat4* returned %0, %struct.mat4* %1, float %2) {
%4 = bitcast %struct.mat4* %0 to float*
%5 = bitcast %struct.mat4* %1 to float*
%6 = tail call i32 @mat4_scale(float* %4, float* %5, float %2)
ret %struct.mat4* %0
}
/* Variables and functions */
int Sys_Milliseconds(void) { return 0; }


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

x86 assembly (clang, -O2):
<Sys_Milliseconds>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Sys_Milliseconds() {
ret i32 0
}

LLVM IR (-O2):
define i32 @Sys_Milliseconds() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void MemWipe(void *const Dest, const size_t ByteCount) {
  register uint8_t *W = Dest;
  register uint8_t *const Stopper = W + ByteCount;
  for (; W != Stopper; ++W)
    *W = 0;
}


x86 assembly (clang, -O0):
<MemWipe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     1151 <MemWipe+0x51>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <MemWipe+0x27>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemWipe>:
mov    %rsi,%rdx
shl    $0x3,%rdx
test   %rdx,%rdx
je     1128 <MemWipe+0x18>
push   %rax
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @MemWipe(i8* writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
%4 = getelementptr inbounds i64, i64* %3, i64 %1
%5 = icmp eq i64* %4, %3
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = shl i64 %1, 3
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime_r(struct tm *, char *);
char *asctime(struct tm *tm) {
  static char buf[64];
  return asctime_r(tm, buf);
}


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

x86 assembly (clang, -O2):
<asctime>:
lea    0x2f29(%rip),%rsi
jmp    1030 <asctime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@asctime.buf = internal global [64 x i8] zeroinitializer
define i8* @asctime(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = call i8* @asctime_r(%struct.tm* %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @asctime.buf, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@asctime.buf = internal global [64 x i8] zeroinitializer
define i8* @asctime(%struct.tm* %0) {
%2 = tail call i8* @asctime_r(%struct.tm* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @asctime.buf, i64 0, i64 0))
ret i8* %2
}
int test_imm_E0uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xE0 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E0uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 224
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void hello(void) { printf("%s", "Hello "); }


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

x86 assembly (clang, -O2):
<hello>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"Hello \00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"Hello \00"
define void @hello() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char);
void tp_print_param_char(char *name, char value) {
  printf("\tchar %s = \'%c\';\n", name, value);
}


x86 assembly (clang, -O0):
<tp_print_param_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
movsbl -0x9(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_print_param_char>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"\09char %s = '%c';\0A\00"
define void @tp_print_param_char(i8* %0, i8 signext %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 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5, i8 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\09char %s = '%c';\0A\00"
define void @tp_print_param_char(i8* %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8 signext %1)
ret void
}
/* Variables and functions */
#define SIGALRM 128
void sig_alrm(int sig) {
  switch (sig) {
  case SIGALRM:
    break;
  }
}


x86 assembly (clang, -O0):
<sig_alrm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    111f <sig_alrm+0x1f>
jmp    111a <sig_alrm+0x1a>
jmp    111f <sig_alrm+0x1f>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sig_alrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 128, label %4
]
4: ; preds = %1
br label %5
5: ; preds = %1, %4
ret void
}

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