xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ abort();
int errno;
int /*<<< orphan*/ printf(char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int get_socket_fd(void) {
  int socket_fd;
  if ((socket_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    printf("%i\n", errno);
    abort();
  }
  return socket_fd;
}


x86 assembly (clang, -O0):
<get_socket_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    1179 <get_socket_fd+0x49>
mov    0x2e6c(%rip),%rax
mov    (%rax),%esi
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_socket_fd>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
test   %eax,%eax
js     1150 <get_socket_fd+0x20>
pop    %rcx
ret
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [4 x i8] c"%i\0A\00"
@errno = global i32 0
define i32 @get_socket_fd() {
%1 = alloca i32
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* @errno
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [4 x i8] c"%i\0A\00"
@errno = global i32 0
define i32 @get_socket_fd() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @errno
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 %3
}
/* Variables and functions */
int geteuid();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("EUID=%d\n", geteuid());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"EUID=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @geteuid()
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"EUID=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @geteuid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_foobar(void) { printf("%s\n", "foobar"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"foobar\00"
define void @print_foobar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 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 = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"foobar\00"
define void @print_foobar() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void *salloc(int count) {
  int *p = malloc(count + sizeof(int));
  *p = count;
  if (!p) {
    printf("Out of memory!\n");
    exit(1);
  }
  memset(p + 1, 0, count);
  mlock(p + 1, count);
  return p + 1;
}


x86 assembly (clang, -O0):
<salloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
add    $0x4,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x10(%rbp)
jne    1198 <salloc+0x48>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
movslq -0x4(%rbp),%rdx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    -0x4(%rbp),%esi
mov    $0x0,%al
call   1030 <mlock@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<salloc>:
push   %r14
push   %rbx
push   %rax
movslq %edi,%r14
lea    0x4(%r14),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r14d,(%rax)
add    $0x4,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <mlock@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory!\0A\00"
define i8* @salloc(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add i64 %5, 4
%7 = call i8* @malloc(i64 %6)
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %3
%9 = load i32, i32* %2
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = icmp ne i32* %11, null
br i1 %12, label %15, label %13
13: ; preds = %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
unreachable
15: ; preds = %1
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = bitcast i32* %17 to i8*
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %2
%24 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @mlock to i32 (i32*, i32, ...)*)(i32* %22, i32 %23)
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 1
%27 = bitcast i32* %26 to i8*
ret i8* %27
}

LLVM IR (-O2):
define i8* @salloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = add nsw i64 %2, 4
%4 = tail call i8* @malloc(i64 %3)
%5 = bitcast i8* %4 to i32*
store i32 %0, i32* %5
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = bitcast i32* %6 to i8*
tail call void @llvm.memset.p0i8.i64(i8* align 4 %7, i8 0, i64 %2, i1 false)
%8 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @mlock to i32 (i32*, i32, ...)*)(i32* %6, i32 %0)
ret i8* %7
}
double obd_convert_default(int a, int b) { return 0.0; }


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

x86 assembly (clang, -O2):
<obd_convert_default>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @obd_convert_default(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @obd_convert_default(i32 %0, i32 %1) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myPrintHelloWorld(void) {
  printf("Hello World!\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @myPrintHelloWorld() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef char wchar_t;
struct _Locale_numeric {
  int dummy;
};

/* Variables and functions */
const wchar_t *_WLocale_true(struct _Locale_numeric *lnum, wchar_t *buf,
                             size_t bufSize) {
  return L"true";
}


x86 assembly (clang, -O0):
<_WLocale_true>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xee9(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._Locale_numeric = type { i32 }
@.str = [5 x i32] [i32 116, i32 114, i32 117, i32 101, i32 0]
define i8* @_WLocale_true(%struct._Locale_numeric* %0, i8* %1, i64 %2) {
%4 = alloca %struct._Locale_numeric*
%5 = alloca i8*
%6 = alloca i64
store %struct._Locale_numeric* %0, %struct._Locale_numeric** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i8* bitcast ([5 x i32]* @.str to i8*)
}

LLVM IR (-O2):
%struct._Locale_numeric = type { i32 }
@.str = [5 x i32] [i32 116, i32 114, i32 117, i32 101, i32 0]
define i8* @_WLocale_true(%struct._Locale_numeric* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i8* bitcast ([5 x i32]* @.str to i8*)
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int standard_scale_solutions(int dim, int basis, double *cff) {
  int fail;
  fail = _ada_use_c2phc(594, &dim, &basis, cff);
  return fail;
}


x86 assembly (clang, -O0):
<standard_scale_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x252,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_scale_solutions>:
push   %rax
mov    %rdx,%rcx
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x252,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @standard_scale_solutions(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 @_ada_use_c2phc(i32 594, i32* %4, i32* %5, double* %2)
ret i32 %6
}
/* Variables and functions */
int fun(char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", fun("this is a book."));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <fun@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <fun@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"this is a book.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fun(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"this is a book.\00"
define i32 @main() {
%1 = tail call i32 @fun(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TWIE_Start();
int /*<<< orphan*/ TWIE_Stop();
int /*<<< orphan*/ TWIE_Write(unsigned char);
void TWIE_Send(unsigned char devaddr, unsigned char regaddr,
               unsigned char value) {
  TWIE_Start();
  TWIE_Write(devaddr << 1);
  TWIE_Write(regaddr);
  TWIE_Write(value);
  TWIE_Stop();
}


x86 assembly (clang, -O0):
<TWIE_Send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    $0x0,%al
call   1050 <TWIE_Start@plt>
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
movzbl %al,%edi
call   1030 <TWIE_Write@plt>
movzbl -0x2(%rbp),%edi
call   1030 <TWIE_Write@plt>
movzbl -0x3(%rbp),%edi
call   1030 <TWIE_Write@plt>
mov    $0x0,%al
call   1040 <TWIE_Stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TWIE_Send>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <TWIE_Start@plt>
add    %bl,%bl
movzbl %bl,%edi
call   1030 <TWIE_Write@plt>
mov    %ebp,%edi
call   1030 <TWIE_Write@plt>
mov    %r14d,%edi
call   1030 <TWIE_Write@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <TWIE_Stop@plt>

LLVM IR (-O0):
define void @TWIE_Send(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = call i32 (...) @TWIE_Start()
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 1
%11 = trunc i32 %10 to i8
%12 = call i32 @TWIE_Write(i8 zeroext %11)
%13 = load i8, i8* %5
%14 = call i32 @TWIE_Write(i8 zeroext %13)
%15 = load i8, i8* %6
%16 = call i32 @TWIE_Write(i8 zeroext %15)
%17 = call i32 (...) @TWIE_Stop()
ret void
}

LLVM IR (-O2):
define void @TWIE_Send(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 (...) @TWIE_Start()
%5 = shl i8 %0, 1
%6 = tail call i32 @TWIE_Write(i8 zeroext %5)
%7 = tail call i32 @TWIE_Write(i8 zeroext %1)
%8 = tail call i32 @TWIE_Write(i8 zeroext %2)
%9 = tail call i32 (...) @TWIE_Stop()
ret void
}
int mv88x201x_reset(struct cphy *cphy, int wait) { return 0; }


x86 assembly (clang, -O0):
<mv88x201x_reset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cphy = type opaque
define i32 @mv88x201x_reset(%struct.cphy* %0, i32 %1) {
%3 = alloca %struct.cphy*
%4 = alloca i32
store %struct.cphy* %0, %struct.cphy** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.cphy = type opaque
define i32 @mv88x201x_reset(%struct.cphy* nocapture readnone %0, i32 %1) {
ret i32 0
}
int claim_fiq(struct fiq_handler *f) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.fiq_handler = type opaque
define i32 @claim_fiq(%struct.fiq_handler* nocapture readnone %0) {
ret i32 0
}
unsigned int signed_char_to_unsigned_int(signed char src) { return src; }


x86 assembly (clang, -O0):
<signed_char_to_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @signed_char_to_unsigned_int(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
unsigned char rom_writeable(void) { return 1; }


x86 assembly (clang, -O0):
<rom_writeable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @rom_writeable() {
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @rom_writeable() {
ret i8 1
}
FNIEMOP_DEF(iemOp_Grp7_vmlaunch) {
  IEMOP_BITCH_ABOUT_STUB();
  return IEMOP_RAISE_INVALID_OPCODE();
}


x86 assembly (clang, -O0):
<FNIEMOP_DEF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <IEMOP_BITCH_ABOUT_STUB@plt>
mov    $0x0,%al
call   1040 <IEMOP_RAISE_INVALID_OPCODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FNIEMOP_DEF>:
push   %rax
xor    %eax,%eax
call   1030 <IEMOP_BITCH_ABOUT_STUB@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <IEMOP_RAISE_INVALID_OPCODE@plt>

LLVM IR (-O0):
define i32 @FNIEMOP_DEF(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @IEMOP_BITCH_ABOUT_STUB()
%4 = call i32 (...) @IEMOP_RAISE_INVALID_OPCODE()
ret i32 %4
}

LLVM IR (-O2):
define i32 @FNIEMOP_DEF(i32 %0) {
%2 = tail call i32 (...) @IEMOP_BITCH_ABOUT_STUB()
%3 = tail call i32 (...) @IEMOP_RAISE_INVALID_OPCODE()
ret i32 %3
}
int get() { return 28; }


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get() {
ret i32 28
}

LLVM IR (-O2):
define i32 @get() {
ret i32 28
}
void hostapd_trigger_20mhz(struct hostapd_iface *iface) {}


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

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

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

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define void @hostapd_trigger_20mhz(%struct.hostapd_iface* nocapture %0) {
ret void
}
int mtime_watch_dir(char *path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mtime_watch_dir(i8* nocapture readnone %0) {
ret i32 0
}
const char *New_Definition(void) {
  return "struct New {\n"
         "  void (*construct_with)(var, var);\n"
         "  void (*destruct)(var);\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [78 x i8] c"struct New {\0A void (*construct_with)(var, var);\0A void (*destruct)(var);\0A};\0A\00"
define i8* @New_Definition() {
ret i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [78 x i8] c"struct New {\0A void (*construct_with)(var, var);\0A void (*destruct)(var);\0A};\0A\00"
define i8* @New_Definition() {
ret i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ getuid();
int UnixVfs_uid(void) { return (int)getuid(); }


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

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

LLVM IR (-O0):
define i32 @UnixVfs_uid() {
%1 = call i64 (...) @getuid()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @UnixVfs_uid() {
%1 = tail call i64 (...) @getuid()
%2 = trunc i64 %1 to i32
ret i32 %2
}
int donothing(int x, int y, float val, void *result) { return 0; }


x86 assembly (clang, -O0):
<donothing>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @donothing(i32 %0, i32 %1, float %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store float %2, float* %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @donothing(i32 %0, i32 %1, float %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int tiaoxin_optimized_decrypt(unsigned char *, unsigned long long *,
                              unsigned char *, unsigned char const *,
                              unsigned long long, unsigned char const *,
                              unsigned long long, unsigned char const *,
                              unsigned char const *);
int crypto_aead_decrypt(unsigned char *m, unsigned long long *mlen,
                        unsigned char *nsec, const unsigned char *c,
                        unsigned long long clen, const unsigned char *ad,
                        unsigned long long adlen, const unsigned char *npub,
                        const unsigned char *k) {
  return tiaoxin_optimized_decrypt(m, mlen, nsec, c, clen, ad, adlen, npub, k);
}


x86 assembly (clang, -O0):
<crypto_aead_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r11
mov    0x18(%rbp),%r10
mov    0x20(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <tiaoxin_optimized_decrypt@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_aead_decrypt>:
jmp    1030 <tiaoxin_optimized_decrypt@plt>

LLVM IR (-O0):
define i32 @crypto_aead_decrypt(i8* %0, i64* %1, i8* %2, i8* %3, i64 %4, i8* %5, i64 %6, i8* %7, i8* %8) {
%10 = alloca i8*
%11 = alloca i64*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i8*
store i8* %0, i8** %10
store i64* %1, i64** %11
store i8* %2, i8** %12
store i8* %3, i8** %13
store i64 %4, i64* %14
store i8* %5, i8** %15
store i64 %6, i64* %16
store i8* %7, i8** %17
store i8* %8, i8** %18
%19 = load i8*, i8** %10
%20 = load i64*, i64** %11
%21 = load i8*, i8** %12
%22 = load i8*, i8** %13
%23 = load i64, i64* %14
%24 = load i8*, i8** %15
%25 = load i64, i64* %16
%26 = load i8*, i8** %17
%27 = load i8*, i8** %18
%28 = call i32 @tiaoxin_optimized_decrypt(i8* %19, i64* %20, i8* %21, i8* %22, i64 %23, i8* %24, i64 %25, i8* %26, i8* %27)
ret i32 %28
}

LLVM IR (-O2):
define i32 @crypto_aead_decrypt(i8* %0, i64* %1, i8* %2, i8* %3, i64 %4, i8* %5, i64 %6, i8* %7, i8* %8) {
%10 = tail call i32 @tiaoxin_optimized_decrypt(i8* %0, i64* %1, i8* %2, i8* %3, i64 %4, i8* %5, i64 %6, i8* %7, i8* %8)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ waitTask();
void task1() {
  while (1) {
    printf("I am task1 \n");
    int i;
    for (i = 0; i < 19000; i++) {
    }
    waitTask();
  }
}


x86 assembly (clang, -O0):
<task1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x4a38,-0x4(%rbp)
jge    115b <task1+0x3b>
jmp    114d <task1+0x2d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113b <task1+0x1b>
mov    $0x0,%al
call   1030 <waitTask@plt>
jmp    1128 <task1+0x8>

x86 assembly (clang, -O2):
<task1>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <waitTask@plt>
jmp    1130 <task1+0x10>

LLVM IR (-O0):
@.str = [13 x i8] c"I am task1 \0A\00"
define void @task1() {
%1 = alloca i32
br label %2
2: ; preds = %0, %11
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %4
4: ; preds = %8, %2
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 19000
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %4
11: ; preds = %4
%12 = call i32 (...) @waitTask()
br label %2
}

LLVM IR (-O2):
@str = [12 x i8] c"I am task1 \00"
define void @task1() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @waitTask()
br label %1
}
int xmlUCSIsDevanagari(int code) {
  return (((code >= 0x0900) && (code <= 0x097F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsDevanagari>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x900,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsDevanagari+0x26>
cmpl   $0x97f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsDevanagari>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x900,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsDevanagari(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 2304
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 2431
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsDevanagari(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 2304
%4 = zext i1 %3 to i32
ret i32 %4
}
void gtk_size_group_add_widget() {}


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

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

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

LLVM IR (-O2):
define void @gtk_size_group_add_widget() {
ret void
}
void INT_Excep_CMT2_CMI2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CMT2_CMI2() {
ret void
}
void MIDGARD_MD5_memcpy(output, input, len) void *output;
void *input;
unsigned int len;
{ memmove(output, input, len * sizeof(void)); }


x86 assembly (clang, -O0):
<MIDGARD_MD5_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %eax,%edx
shl    $0x0,%rdx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIDGARD_MD5_memcpy>:
mov    %edx,%edx
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @MIDGARD_MD5_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 1
ret void
}

LLVM IR (-O2):
define void @MIDGARD_MD5_memcpy(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = zext i32 %2 to i64
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %4, i1 false)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num;
  num = 0;
  while (num < 100) {
    printf("%d - ", num);
    num = num + 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xfffffffe,%ebx
lea    0xee0(%rip),%r14
add    $0x2,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x62,%ebx
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d - \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 2
%5 = icmp ult i32 %2, 98
br i1 %5, label %1, label %6
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
char getchar();
extern void clear_buffer(void) {
  char clbuf;
  while ((clbuf = getchar()) != '\n')
    ;
}


x86 assembly (clang, -O0):
<clear_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1133 <clear_buffer+0x23>
jmp    1118 <clear_buffer+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buffer>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clear_buffer+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @clear_buffer() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @clear_buffer() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
char _jstime_isleapyear_since1900(int year) {
  year += 1900;
  return ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) ? 1
                                                                        : 0);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113f <_jstime_isleapyear_since1900+0x3f>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <_jstime_isleapyear_since1900+0x53>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    0x76c(%rdi),%ecx
test   $0x3,%dil
jne    1138 <_jstime_isleapyear_since1900+0x38>
movslq %ecx,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%eax
neg    %eax
lea    (%rdi,%rax,1),%edx
add    $0x76c,%edx
mov    $0x1,%al
test   %edx,%edx
je     1138 <_jstime_isleapyear_since1900+0x38>
ret
imul   $0xc28f5c29,%ecx,%eax
add    $0x51eb850,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
setb   %al
ret

LLVM IR (-O0):
define signext i8 @_jstime_isleapyear_since1900(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1900
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = srem i32 %5, 4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = srem i32 %9, 100
%11 = icmp ne i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %8, %1
%13 = load i32, i32* %2
%14 = srem i32 %13, 400
%15 = icmp eq i32 %14, 0
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ true, %8 ], [ %15, %12 ]
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @_jstime_isleapyear_since1900(i32 %0) {
%2 = add nsw i32 %0, 1900
%3 = and i32 %0, 3
%4 = icmp ne i32 %3, 0
%5 = srem i32 %2, 100
%6 = icmp eq i32 %5, 0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = srem i32 %2, 400
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i8
br label %12
12: ; preds = %1, %8
%13 = phi i8 [ %11, %8 ], [ 1, %1 ]
ret i8 %13
}
/* Variables and functions */
unsigned long sqrt(unsigned long);
int is_square(unsigned long int number) {
  unsigned long int _sqrt = sqrt(number);
  return ((_sqrt * _sqrt) == number);
}


x86 assembly (clang, -O0):
<is_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sqrt@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_square>:
push   %rbx
mov    %rdi,%rbx
call   1030 <sqrt@plt>
imul   %rax,%rax
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_square(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @sqrt(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %3
%8 = mul i64 %6, %7
%9 = load i64, i64* %2
%10 = icmp eq i64 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_square(i64 %0) {
%2 = tail call i64 @sqrt(i64 %0)
%3 = mul i64 %2, %2
%4 = icmp eq i64 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_channel_credentials_release() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_channel_credentials_release>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_channel_credentials_release() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_channel_credentials_release() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
unsigned int g(unsigned int a) { return a * 65536; }


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

x86 assembly (clang, -O2):
<g>:
mov    %edi,%eax
shl    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 65536
ret i32 %4
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = shl i32 %0, 16
ret i32 %2
}
char *hash_plugin_summary(void) { return ("sha1 \t\tSHA1 plugin"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"sha1 \09\09SHA1 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"sha1 \09\09SHA1 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
main() {
  static int i = 10, *j, **k;
  j = &i;
  k = &j;
  j++;
  printf("%u %u", j, k);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0d(%rip),%rax
mov    %rax,0x2f16(%rip)
lea    0x2f0f(%rip),%rax
mov    %rax,0x2f10(%rip)
mov    0x2f01(%rip),%rax
add    $0x4,%rax
mov    %rax,0x2ef6(%rip)
mov    0x2eef(%rip),%rsi
mov    0x2ef0(%rip),%rdx
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x2f14(%rip),%rsi
mov    %rsi,0x2f19(%rip)
lea    0x2f12(%rip),%rdx
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@main.i = internal global i32 10
@main.j = internal global i32* null
@main.k = internal global i32** null
@.str = [6 x i8] c"%u %u\00"
define i32 @main() {
store i32* @main.i, i32** @main.j
store i32** @main.j, i32*** @main.k
%1 = load i32*, i32** @main.j
%2 = getelementptr inbounds i32, i32* %1, i32 1
store i32* %2, i32** @main.j
%3 = load i32*, i32** @main.j
%4 = load i32**, i32*** @main.k
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32** %4)
ret i32 0
}

LLVM IR (-O2):
@main.i = internal global i32 10
@main.j = internal global i32* null
@.str = [6 x i8] c"%u %u\00"
define i32 @main() {
store i32* getelementptr inbounds (i32, i32* @main.i, i64 1), i32** @main.j
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* getelementptr inbounds (i32, i32* @main.i, i64 1), i32** @main.j)
ret i32 0
}
int circles_intersect(double x1, double y1, double r1, double x2, double y2,
                      double r2) {
  double xdist = x2 - x1;
  double ydist = y2 - y1;
  double maxdist = r1 + r2;
  return xdist * xdist + ydist * ydist < maxdist * maxdist;
}


x86 assembly (clang, -O0):
<circles_intersect>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<circles_intersect>:
subsd  %xmm0,%xmm3
subsd  %xmm1,%xmm4
addsd  %xmm5,%xmm2
mulsd  %xmm4,%xmm4
mulsd  %xmm3,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm2,%xmm2
xor    %eax,%eax
ucomisd %xmm3,%xmm2
seta   %al
ret

LLVM IR (-O0):
define i32 @circles_intersect(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%16 = load double, double* %10
%17 = load double, double* %7
%18 = fsub double %16, %17
store double %18, double* %13
%19 = load double, double* %11
%20 = load double, double* %8
%21 = fsub double %19, %20
store double %21, double* %14
%22 = load double, double* %9
%23 = load double, double* %12
%24 = fadd double %22, %23
store double %24, double* %15
%25 = load double, double* %13
%26 = load double, double* %13
%27 = load double, double* %14
%28 = load double, double* %14
%29 = fmul double %27, %28
%30 = call double @llvm.fmuladd.f64(double %25, double %26, double %29)
%31 = load double, double* %15
%32 = load double, double* %15
%33 = fmul double %31, %32
%34 = fcmp olt double %30, %33
%35 = zext i1 %34 to i32
ret i32 %35
}

LLVM IR (-O2):
define i32 @circles_intersect(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %3, %0
%8 = fsub double %4, %1
%9 = fadd double %2, %5
%10 = fmul double %8, %8
%11 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %10)
%12 = fmul double %9, %9
%13 = fcmp olt double %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ DONE();
char *TOHEXSTR(char *, short);
int /*<<< orphan*/ printf(char *, ...);
void __ERROR(short Num, short Where) {
  char STR2[256];
  printf("\nProgram terminated before completed.\n");
  printf("Program counter is $%s.  Error Number is %d.\n",
         TOHEXSTR(STR2, Where), Num);
  DONE();
}


x86 assembly (clang, -O0):
<__ERROR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
movswl -0x4(%rbp),%esi
call   1050 <TOHEXSTR@plt>
mov    %rax,%rsi
movswl -0x2(%rbp),%edx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <DONE@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ERROR>:
push   %rbp
push   %rbx
sub    $0x108,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeda(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rdi
mov    %ebx,%esi
call   1060 <TOHEXSTR@plt>
lea    0xe96(%rip),%rdi
mov    %rax,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <DONE@plt>
add    $0x108,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"\0AProgram terminated before completed.\0A\00"
@.str.1 = [46 x i8] c"Program counter is $%s. Error Number is %d.\0A\00"
define void @__ERROR(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca [256 x i8]
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%8 = load i16, i16* %4
%9 = call i8* @TOHEXSTR(i8* %7, i16 signext %8)
%10 = load i16, i16* %3
%11 = sext i16 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %9, i32 %11)
%13 = call i32 (...) @DONE()
ret void
}

LLVM IR (-O2):
@.str.1 = [46 x i8] c"Program counter is $%s. Error Number is %d.\0A\00"
@str = [38 x i8] c"\0AProgram terminated before completed.\00"
define void @__ERROR(i16 signext %0, i16 signext %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%6 = call i8* @TOHEXSTR(i8* %4, i16 signext %1)
%7 = sext i16 %0 to i32
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 (...) @DONE()
ret void
}
/* Variables and functions */
int mem_get_be32_as_int(unsigned char const *);
signed int mem_get_sbe32_as_int(const void *vmem) {
  const unsigned char *mem = (const unsigned char *)vmem;
  signed int val = mem_get_be32_as_int(mem);
  return (val << ((sizeof(int) << 3) - 32)) >> ((sizeof(int) << 3) - 32);
}


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

x86 assembly (clang, -O2):
<mem_get_sbe32_as_int>:
jmp    1030 <mem_get_be32_as_int@plt>

LLVM IR (-O0):
define i32 @mem_get_sbe32_as_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @mem_get_be32_as_int(i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 0
%10 = ashr i32 %9, 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @mem_get_sbe32_as_int(i8* %0) {
%2 = tail call i32 @mem_get_be32_as_int(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ allocator_counted_init_default(int /*<<< orphan*/);
void _ensure_allocator_counted_init_default_copes_with_null_allocator(void) {
  allocator_counted_init_default(0);
}


x86 assembly (clang, -O0):
<_ensure_allocator_counted_init_default_copes_with_null_allocator>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <allocator_counted_init_default@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure_allocator_counted_init_default_copes_with_null_allocator>:
xor    %edi,%edi
jmp    1030 <allocator_counted_init_default@plt>

LLVM IR (-O0):
define void @_ensure_allocator_counted_init_default_copes_with_null_allocator() {
%1 = call i32 @allocator_counted_init_default(i32 0)
ret void
}

LLVM IR (-O2):
define void @_ensure_allocator_counted_init_default_copes_with_null_allocator() {
%1 = tail call i32 @allocator_counted_init_default(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void set_seed() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<set_seed>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_seed>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @set_seed() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @set_seed() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
void uart_init(unsigned int baudrate) {}


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

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

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

LLVM IR (-O2):
define void @uart_init(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ wcstoll(int /*<<< orphan*/ const *, int /*<<< orphan*/ **, int);
long wcstol(const wchar_t *str, wchar_t **endptr, int base) {
  return (long)wcstoll(str, endptr, base);
}


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

x86 assembly (clang, -O2):
<wcstol>:
jmp    1030 <wcstoll@plt>

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

LLVM IR (-O2):
define i64 @wcstol(i32* %0, i32** %1, i32 %2) {
%4 = tail call i64 @wcstoll(i32* %0, i32** %1, i32 %2)
ret i64 %4
}