xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int numb;
  scanf("%d", &numb);
  printf("\n%d\n", numb * numb);
  printf("%d\n", numb * numb * numb);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
imul   %esi,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"\0A%d\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
scalar_t__ ntohl(int);
const char *unpack_s64(int64_t *data, const char *buffer) {
  *data =
      (((uint64_t)(ntohl((int)((*((int64_t *)buffer) << 32) >> 32))) << 32) |
       (unsigned int)ntohl(((int)(*((int64_t *)buffer) >> 32))));
  return buffer + sizeof(*data);
}


x86 assembly (clang, -O0):
<unpack_s64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x20,%ecx
shl    %cl,%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <ntohl@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <ntohl@plt>
mov    -0x14(%rbp),%ecx
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_s64>:
push   %rbx
mov    %rsi,%rbx
call   1030 <ntohl@plt>
call   1030 <ntohl@plt>
add    $0x4,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @unpack_s64(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = shl i32 %7, 32
%9 = ashr i32 %8, 32
%10 = call i64 @ntohl(i32 %9)
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 32
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
%16 = ashr i32 %15, 32
%17 = call i64 @ntohl(i32 %16)
%18 = trunc i64 %17 to i32
%19 = or i32 %12, %18
%20 = load i32*, i32** %3
store i32 %19, i32* %20
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 4
ret i8* %22
}

LLVM IR (-O2):
define i8* @unpack_s64(i32* nocapture readnone %0, i8* readnone %1) {
%3 = tail call i64 @ntohl(i32 poison)
%4 = tail call i64 @ntohl(i32 poison)
%5 = getelementptr inbounds i8, i8* %1, i64 4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *xmalloc(size_t nbytes) {
  void *ptr = malloc(nbytes);
  if (!ptr) {
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <xmalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
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 %10, label %8
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
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 %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
int strLen(char *inStr) {
  int i = 0;
  while (inStr[i] != 0) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strLen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strLen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strLen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strLen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strLen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
long EthernetPacketPutInternal(unsigned long, unsigned char *, long);
long EthernetPacketPut(unsigned long ulBase, unsigned char *pucBuf,
                       long lBufLen) {
  ;
  ;
  ;
  while ((*((volatile unsigned long *)(ulBase + 0x00000038))) & 0x00000001) {
  }
  return (EthernetPacketPutInternal(ulBase, pucBuf, lBufLen));
}


x86 assembly (clang, -O0):
<EthernetPacketPut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     113f <EthernetPacketPut+0x2f>
jmp    1124 <EthernetPacketPut+0x14>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <EthernetPacketPutInternal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EthernetPacketPut>:
mov    0x38(%rdi),%rax
test   $0x1,%al
jne    1110 <EthernetPacketPut>
jmp    1030 <EthernetPacketPutInternal@plt>

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

LLVM IR (-O2):
define i64 @EthernetPacketPut(i64 %0, i8* %1, i64 %2) {
%4 = add i64 %0, 56
%5 = inttoptr i64 %4 to i64*
br label %6
6: ; preds = %6, %3
%7 = load volatile i64, i64* %5
%8 = and i64 %7, 1
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6
%11 = tail call i64 @EthernetPacketPutInternal(i64 %0, i8* %1, i64 %2)
ret i64 %11
}
int wifsignaled(int stat_val) { return -1; }


x86 assembly (clang, -O0):
<wifsignaled>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @wifsignaled(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 -1
}

LLVM IR (-O2):
define i32 @wifsignaled(i32 %0) {
ret i32 -1
}
void sky_clear_double(void *target) { *((double *)target) = 0; }


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

x86 assembly (clang, -O2):
<sky_clear_double>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @sky_clear_double(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to double*
store double 0.000000e+00, double* %4
ret void
}

LLVM IR (-O2):
define void @sky_clear_double(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to double*
store double 0.000000e+00, double* %2
ret void
}
void gtk_spin_button_set_range() {}


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

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

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

LLVM IR (-O2):
define void @gtk_spin_button_set_range() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCS(char *, char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char pStr1[] = "akqrshrengxqiyxuloqk";
  char pStr2[] = "tdzbujtlqhecaqgwfzbck";
  LCS(pStr1, pStr2);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec0(%rip),%al
mov    %al,-0xc(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xebd(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0x2c(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <LCS@plt>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x6b716f6c757879,%rax
mov    %rax,0xd(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x6b63627a667767,%rax
mov    %rax,0x2e(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
call   1040 <LCS@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.pStr1 = [21 x i8] c"akqrshrengxqiyxuloqk\00"
@__const.main.pStr2 = [22 x i8] c"tdzbujtlqhecaqgwfzbck\00"
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i8]
%3 = alloca [22 x i8]
store i32 0, i32* %1
%4 = bitcast [21 x i8]* %2 to i8*
%5 = bitcast [22 x i8]* %3 to i8*
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [22 x i8], [22 x i8]* %3, i64 0, i64 0
%8 = call i32 @LCS(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.pStr1 = [21 x i8] c"akqrshrengxqiyxuloqk\00"
@__const.main.pStr2 = [22 x i8] c"tdzbujtlqhecaqgwfzbck\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = alloca [22 x i8]
%3 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%5 = call i32 @LCS(i8* %3, i8* %4)
%6 = call i32 @putchar(i32 10)
ret i32 0
}
void BN_CTX_get(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ svga_readl_common(int /*<<< orphan*/, int, void *);
uint32_t svga_readl_linear(uint32_t addr, void *p) {
  return svga_readl_common(addr, 1, p);
}


x86 assembly (clang, -O0):
<svga_readl_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1030 <svga_readl_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svga_readl_linear>:
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <svga_readl_common@plt>

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

LLVM IR (-O2):
define i32 @svga_readl_linear(i32 %0, i8* %1) {
%3 = tail call i32 @svga_readl_common(i32 %0, i32 1, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(void) {
  int a, b, c;
  printf("Enter a phone number [(xxx) xxx-xxxx]: ");
  scanf("(%d) %d-%d", &a, &b, &c);
  printf("The phone number you entered is: %d.%d.%d\n", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Enter a phone number [(xxx) xxx-xxxx]: \00"
@.str.1 = [11 x i8] c"(%d) %d-%d\00"
@.str.2 = [43 x i8] c"The phone number you entered is: %d.%d.%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Enter a phone number [(xxx) xxx-xxxx]: \00"
@.str.1 = [11 x i8] c"(%d) %d-%d\00"
@.str.2 = [43 x i8] c"The phone number you entered is: %d.%d.%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}
int subtract_numbers(int a, int b) { return a - b; }


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

x86 assembly (clang, -O2):
<subtract_numbers>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @subtract_numbers(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @subtract_numbers(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
unsigned long get_XLeaveWindowEvent_serial(void *_p) {
  return (unsigned long)((XLeaveWindowEvent *)_p)->serial;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XLeaveWindowEvent_serial(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XLeaveWindowEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void delMat(int **arr, int order) {
  int i = 0;
  for (i = 0; i < order; i++)
    free(arr[i]);
  free(arr);
}


x86 assembly (clang, -O0):
<delMat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <delMat+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <delMat+0x1d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delMat>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <delMat+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <delMat+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @delMat(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
void gets_t() {
  char str[50];
  printf("Enter a string : ");
  gets(str);
  printf("You entered: %s", str);
}


x86 assembly (clang, -O0):
<gets_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x40(%rbp),%rsi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gets_t>:
push   %rbx
sub    $0x40,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a string : \00"
@.str.1 = [16 x i8] c"You entered: %s\00"
define void @gets_t() {
%1 = alloca [50 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter a string : \00"
@.str.1 = [16 x i8] c"You entered: %s\00"
define void @gets_t() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int i2c_read_leuint08(int, int, int, int *);
int i2c_write_leuint08(int, int, int, int);
int ClearLED_BUZZ(int bus, int chip_addr, uint8_t Value) {
  uint8_t GPIOstatus;
  int err;
  err = i2c_read_leuint08(bus, chip_addr, 0x13, &GPIOstatus);
  if (err == 1) {
    err = i2c_write_leuint08(bus, chip_addr, 0x01, (Value | GPIOstatus) & 0x7F);
  }
  return err;
}


x86 assembly (clang, -O0):
<ClearLED_BUZZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x13,%edx
lea    -0x10(%rbp),%rcx
call   1030 <i2c_read_leuint08@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    116e <ClearLED_BUZZ+0x4e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
or     -0x10(%rbp),%ecx
and    $0x7f,%ecx
mov    $0x1,%edx
call   1040 <i2c_write_leuint08@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearLED_BUZZ>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
lea    0xc(%rsp),%rcx
mov    $0x13,%edx
call   1030 <i2c_read_leuint08@plt>
cmp    $0x1,%eax
jne    115b <ClearLED_BUZZ+0x3b>
or     0xc(%rsp),%ebx
and    $0x7f,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
mov    $0x1,%edx
mov    %ebx,%ecx
call   1040 <i2c_write_leuint08@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ClearLED_BUZZ(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @i2c_read_leuint08(i32 %0, i32 %1, i32 19, i32* %4)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i32, i32* %4
%10 = or i32 %9, %2
%11 = and i32 %10, 127
%12 = call i32 @i2c_write_leuint08(i32 %0, i32 %1, i32 1, i32 %11)
br label %13
13: ; preds = %8, %3
%14 = phi i32 [ %12, %8 ], [ %6, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int xx_le(void) {
  puts("little-endian routine");
  return 1;
}


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

x86 assembly (clang, -O2):
<xx_le>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"little-endian routine\00"
define i32 @xx_le() {
%1 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [22 x i8] c"little-endian routine\00"
define i32 @xx_le() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int close(int);
int closeDisk(int disk) {
  if (disk < 0) {
    return -1;
  }
  if (close(disk) == -1) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<closeDisk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <closeDisk+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <closeDisk+0x45>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    114e <closeDisk+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <closeDisk+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeDisk>:
test   %edi,%edi
js     112b <closeDisk+0x1b>
push   %rax
call   1030 <close@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @closeDisk(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
%5 = icmp eq i32 %4, -1
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ -1, %1 ], [ %6, %3 ]
ret i32 %8
}
void StringLiteral(s) char *s;
{
  c("(\")");
  place_string(s);
}


x86 assembly (clang, -O0):
<StringLiteral>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <c@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <place_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringLiteral>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <c@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <place_string@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"(\22)\00"
define void @StringLiteral(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @c to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @place_string to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
char *strdup(char *);
int main(void) {
  char str[] = "Get up stand up, stand up for your rights";
  char *dup_str;
  dup_str = strdup(str);
  printf("%s\n", dup_str);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x2a,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xeef(%rip),%xmm0
movups %xmm0,0x1a(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <strdup@plt>
lea    0xed4(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [42 x i8] c"Get up stand up, stand up for your rights\00"
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [42 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [42 x i8]* %2 to i8*
%5 = getelementptr inbounds [42 x i8], [42 x i8]* %2, i64 0, i64 0
%6 = call i8* @strdup(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@__const.main.str = [42 x i8] c"Get up stand up, stand up for your rights\00"
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [42 x i8]
%2 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 0
%3 = call i8* @strdup(i8* %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
int fn1(int f, int s) {
  int ret = 0;
  if (f)
    ret = s / (f ? (unsigned long)8 : 0);
  return ret;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1138 <fn1+0x38>
movslq -0x8(%rbp),%rax
mov    -0x4(%rbp),%esi
xor    %ecx,%ecx
mov    $0x8,%edx
cmp    $0x0,%esi
cmovne %rdx,%rcx
xor    %edx,%edx
div    %rcx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
mov    %esi,%eax
sar    $0x3,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @fn1(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = ashr i32 %1, 3
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u64;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_be32(int, int /*<<< orphan*/ *);
void __put_unaligned_be64(__u64 val, __u8 *p) {
  __put_unaligned_be32(val >> 32, p);
  __put_unaligned_be32(val, p + 4);
}


x86 assembly (clang, -O0):
<__put_unaligned_be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
mov    -0x10(%rbp),%rsi
call   1030 <__put_unaligned_be32@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
call   1030 <__put_unaligned_be32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_unaligned_be64>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <__put_unaligned_be32@plt>
add    $0x10,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__put_unaligned_be32@plt>

LLVM IR (-O0):
define void @__put_unaligned_be64(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 = ashr i32 %5, 32
%7 = load i32*, i32** %4
%8 = call i32 @__put_unaligned_be32(i32 %6, i32* %7)
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 4
%12 = call i32 @__put_unaligned_be32(i32 %9, i32* %11)
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_be64(i32 %0, i32* %1) {
%3 = tail call i32 @__put_unaligned_be32(i32 poison, i32* %1)
%4 = getelementptr inbounds i32, i32* %1, i64 4
%5 = tail call i32 @__put_unaligned_be32(i32 %0, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *, int, char *);
void *malloc(size_t);
void *h2o_mem_alloc(size_t sz) {
  void *p = malloc(sz);
  if (p == NULL)
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/deweerdt/h2o/refs/heads/"
               "master/include/h2o/memory.h",
               373, "no memory");
  return p;
}


x86 assembly (clang, -O0):
<h2o_mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <h2o_mem_alloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x175,%esi
lea    0xf37(%rip),%rdx
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <h2o_mem_alloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf52(%rip),%rdx
mov    $0x175,%esi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/deweerdt/h2o/refs/heads/master/include/h2o/memory.h\00"
@.str.1 = [10 x i8] c"no memory\00"
define i8* @h2o_mem_alloc(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 eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @h2o__fatal(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0), i32 373, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/deweerdt/h2o/refs/heads/master/include/h2o/memory.h\00"
@.str.1 = [10 x i8] c"no memory\00"
define noalias i8* @h2o_mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0), i32 373, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int ti_mass_start(double const *options) {
  int sum_p = (int)options[0] - 1;
  return 16 + sum_p;
}


x86 assembly (clang, -O0):
<ti_mass_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_mass_start>:
cvttsd2si (%rdi),%eax
add    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @ti_mass_start(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
%4 = load double*, double** %2
%5 = getelementptr inbounds double, double* %4, i64 0
%6 = load double, double* %5
%7 = fptosi double %6 to i32
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = add nsw i32 16, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @ti_mass_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, 15
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void _CATMSG_Xinv(void) {
  fputs("Invalid dynamic array argument\n", stderr);
  abort();
}


x86 assembly (clang, -O0):
<_CATMSG_Xinv>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_CATMSG_Xinv>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Invalid dynamic array argument\0A\00"
@stderr = global i32 0
define void @_CATMSG_Xinv() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"Invalid dynamic array argument\0A\00"
@stderr = global i32 0
define void @_CATMSG_Xinv() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int trio_vprintf(char const *, int /*<<< orphan*/);
int vprintf(const char *format, va_list args) {
  return trio_vprintf(format, args);
}


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

x86 assembly (clang, -O2):
<vprintf>:
jmp    1030 <trio_vprintf@plt>

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

LLVM IR (-O2):
define i32 @vprintf(i8* %0, i32 %1) {
%3 = tail call i32 @trio_vprintf(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR5E_set(void) { return U_WMRCORENONE_set("U_WMRENDDOC"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"U_WMRENDDOC\00"
define i8* @U_WMR5E_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [12 x i8] c"U_WMRENDDOC\00"
define i8* @U_WMR5E_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
double Rand();
void iran10(int *i, int *j) {
  *i = Rand() * 10.0 + 1.0;
  *j = Rand() * 10.0 + 1.0;
}


x86 assembly (clang, -O0):
<iran10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Rand@plt>
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecd(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <Rand@plt>
movsd  0xea8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea4(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iran10>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <Rand@plt>
mulsd  0xed7(%rip),%xmm0
addsd  0xed7(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <Rand@plt>
mulsd  0xeba(%rip),%xmm0
addsd  0xeba(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @iran10(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call double (...) @Rand()
%6 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+01, double 1.000000e+00)
%7 = fptosi double %6 to i32
%8 = load i32*, i32** %3
store i32 %7, i32* %8
%9 = call double (...) @Rand()
%10 = call double @llvm.fmuladd.f64(double %9, double 1.000000e+01, double 1.000000e+00)
%11 = fptosi double %10 to i32
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @iran10(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = tail call double (...) @Rand()
%4 = tail call double @llvm.fmuladd.f64(double %3, double 1.000000e+01, double 1.000000e+00)
%5 = fptosi double %4 to i32
store i32 %5, i32* %0
%6 = tail call double (...) @Rand()
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e+01, double 1.000000e+00)
%8 = fptosi double %7 to i32
store i32 %8, i32* %1
ret void
}
/* Type definitions */
struct lwan_strbuf {
  int dummy;
};

/* Variables and functions */
int lwan_strbuf_set(struct lwan_strbuf *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
bool lwan_strbuf_setz(struct lwan_strbuf *s1, const char *s2) {
  return lwan_strbuf_set(s1, s2, strlen(s2));
}


x86 assembly (clang, -O0):
<lwan_strbuf_setz>:
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    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <lwan_strbuf_set@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lwan_strbuf_setz>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <lwan_strbuf_set@plt>

LLVM IR (-O0):
%struct.lwan_strbuf = type { i32 }
define i32 @lwan_strbuf_setz(%struct.lwan_strbuf* %0, i8* %1) {
%3 = alloca %struct.lwan_strbuf*
%4 = alloca i8*
store %struct.lwan_strbuf* %0, %struct.lwan_strbuf** %3
store i8* %1, i8** %4
%5 = load %struct.lwan_strbuf*, %struct.lwan_strbuf** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @lwan_strbuf_set(%struct.lwan_strbuf* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.lwan_strbuf = type { i32 }
define i32 @lwan_strbuf_setz(%struct.lwan_strbuf* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @lwan_strbuf_set(%struct.lwan_strbuf* %0, i8* %1, i32 %3)
ret i32 %4
}
int cmp(const void *x, const void *y) { return *(int *)x > *(int *)y; }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setg   %al
ret

LLVM IR (-O0):
define i32 @cmp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void t4() {
  struct tag4 {
    int a;
    struct {
      char b;
      int c;
    } y;
  } x;
  struct tag4 s;
  s.a = 61;
  s.y.b = 3;
  s.y.c = 3;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c",
          33, 67, s.a + s.y.b + s.y.c);
  ;
}


x86 assembly (clang, -O0):
<t4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x3d,-0x20(%rbp)
movb   $0x3,-0x1c(%rbp)
movl   $0x3,-0x18(%rbp)
mov    -0x20(%rbp),%ecx
movsbl -0x1c(%rbp),%eax
add    %eax,%ecx
add    -0x18(%rbp),%ecx
lea    0xec3(%rip),%rdi
mov    $0x21,%esi
mov    $0x43,%edx
call   1030 <fexpect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t4>:
lea    0xee9(%rip),%rdi
mov    $0x21,%esi
mov    $0x43,%edx
mov    $0x43,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
%struct.tag4 = type { i32, %struct.anon }
%struct.anon = type { i8, i32 }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t4() {
%1 = alloca %struct.tag4
%2 = alloca %struct.tag4
%3 = getelementptr inbounds %struct.tag4, %struct.tag4* %2, i32 0, i32 0
store i32 61, i32* %3
%4 = getelementptr inbounds %struct.tag4, %struct.tag4* %2, i32 0, i32 1
%5 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 0
store i8 3, i8* %5
%6 = getelementptr inbounds %struct.tag4, %struct.tag4* %2, i32 0, i32 1
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 1
store i32 3, i32* %7
%8 = getelementptr inbounds %struct.tag4, %struct.tag4* %2, i32 0, i32 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.tag4, %struct.tag4* %2, i32 0, i32 1
%11 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = add nsw i32 %9, %13
%15 = getelementptr inbounds %struct.tag4, %struct.tag4* %2, i32 0, i32 1
%16 = getelementptr inbounds %struct.anon, %struct.anon* %15, i32 0, i32 1
%17 = load i32, i32* %16
%18 = add nsw i32 %14, %17
%19 = call i32 @fexpect(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 33, i32 67, i32 %18)
ret void
}

LLVM IR (-O2):
%struct.tag4 = type { i32, %struct.anon }
%struct.anon = type { i8, i32 }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t4() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 33, i32 67, i32 67)
ret void
}