xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int ulong;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ check_order(int *, int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ make_random(int *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ radix_sort(int *, int);
void test_radix(ulong N) {
  ulong *data = (ulong *)malloc(N * sizeof(ulong));
  assert(data != NULL);
  make_random(data, N);
  radix_sort(data, N);
  check_order(data, N);
  free(data);
}


x86 assembly (clang, -O0):
<test_radix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <make_random@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1060 <radix_sort@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <check_order@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_radix>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
lea    0x0(,%r14,4),%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1070 <assert@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1050 <make_random@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1060 <radix_sort@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <check_order@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @test_radix(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 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = icmp ne i32* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32*, i32** %3
%15 = load i32, i32* %2
%16 = call i32 @make_random(i32* %14, i32 %15)
%17 = load i32*, i32** %3
%18 = load i32, i32* %2
%19 = call i32 @radix_sort(i32* %17, i32 %18)
%20 = load i32*, i32** %3
%21 = load i32, i32* %2
%22 = call i32 @check_order(i32* %20, i32 %21)
%23 = load i32*, i32** %3
%24 = call i32 @free(i32* %23)
ret void
}

LLVM IR (-O2):
define void @test_radix(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
%5 = icmp ne i64 %3, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @make_random(i32* %4, i32 %0)
%9 = tail call i32 @radix_sort(i32* %4, i32 %0)
%10 = tail call i32 @check_order(i32* %4, i32 %0)
%11 = tail call i32 @free(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("This account is currently not available.\n");
  return 1;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [42 x i8] c"This account is currently not available.\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 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [41 x i8] c"This account is currently not available.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void help_state_tick(uint64_t elapsed) {}


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

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

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

LLVM IR (-O2):
define void @help_state_tick(i32 %0) {
ret void
}
void inversion_liste(struct elem **liste) {}


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

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

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

LLVM IR (-O2):
%struct.elem = type opaque
define void @inversion_liste(%struct.elem** nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void my_fclose(FILE *f) {
  if (ferror(f) != 0) {
    fputs("File write error. Program aborted.\n", stderr);
    exit(2);
  }
  fclose(f);
}


x86 assembly (clang, -O0):
<my_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     117e <my_fclose+0x3e>
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
lea    0xe91(%rip),%rdi
call   1050 <fputs@plt>
mov    $0x2,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fclose>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ferror@plt>
test   %rax,%rax
jne    1157 <my_fclose+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
lea    0xe99(%rip),%rdi
call   1050 <fputs@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"File write error. Program aborted.\0A\00"
@stderr = global i32 0
define void @my_fclose(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @ferror(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @exit(i32 2)
unreachable
10: ; preds = %1
%11 = load i32*, i32** %2
%12 = call i32 @fclose(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"File write error. Program aborted.\0A\00"
@stderr = global i32 0
define void @my_fclose(i32* nocapture %0) {
%2 = tail call i64 @ferror(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @exit(i32 2)
unreachable
8: ; preds = %1
%9 = tail call i32 @fclose(i32* %0)
ret void
}
int h(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @h(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ A_REVERSE;
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ move(int /*<<< orphan*/, int);
int /*<<< orphan*/ refresh();
void wait() {
  move(0, 75);
  attron(A_REVERSE);
  addstr(" MORE");
  attroff(A_REVERSE);
  refresh();
  getch();
  return;
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x4b,%esi
call   1080 <move@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1040 <attron@plt>
lea    0xe7b(%rip),%rdi
call   1070 <addstr@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
push   %rbx
xor    %edi,%edi
mov    $0x4b,%esi
call   1080 <move@plt>
mov    0x2e6c(%rip),%rbx
mov    (%rbx),%edi
call   1040 <attron@plt>
lea    0xe7e(%rip),%rdi
call   1070 <addstr@plt>
mov    (%rbx),%edi
call   1030 <attroff@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <getch@plt>

LLVM IR (-O0):
@A_REVERSE = global i32 0
@.str = [6 x i8] c" MORE\00"
define void @wait() {
%1 = call i32 @move(i32 0, i32 75)
%2 = load i32, i32* @A_REVERSE
%3 = call i32 @attron(i32 %2)
%4 = call i32 @addstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @A_REVERSE
%6 = call i32 @attroff(i32 %5)
%7 = call i32 (...) @refresh()
%8 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@A_REVERSE = global i32 0
@.str = [6 x i8] c" MORE\00"
define void @wait() {
%1 = tail call i32 @move(i32 0, i32 75)
%2 = load i32, i32* @A_REVERSE
%3 = tail call i32 @attron(i32 %2)
%4 = tail call i32 @addstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @A_REVERSE
%6 = tail call i32 @attroff(i32 %5)
%7 = tail call i32 (...) @refresh()
%8 = tail call i32 (...) @getch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(unsigned long, unsigned char, int);
int /*<<< orphan*/ GPIOPadConfigSet(unsigned long, unsigned char, int, int);
void GPIOPinTypePWM(unsigned long ulPort, unsigned char ucPins) {
  ;
  GPIODirModeSet(ulPort, ucPins, 0x00000002);
  GPIOPadConfigSet(ulPort, ucPins, 0x00000001, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypePWM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%edx
movzbl -0x9(%rbp),%esi
call   1040 <GPIODirModeSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    $0x8,%ecx
movzbl -0x9(%rbp),%esi
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypePWM>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

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

LLVM IR (-O2):
define void @GPIOPinTypePWM(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIODirModeSet(i64 %0, i8 zeroext %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i64 %0, i8 zeroext %1, i32 1, i32 8)
ret void
}
int main(void) {
  int *p = 0;
  {
    int x;
    p = &x;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int main() {
  f1();
  f2();
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <f1@plt>
mov    $0x0,%al
call   1030 <f2@plt>
xor    %edi,%edi
call   1040 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <f1@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %edi,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f1()
%3 = call i32 (...) @f2()
%4 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f2()
%3 = tail call i32 @_exit(i32 0)
unreachable
}
/* Type definitions */
struct confctl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ confctl_root(struct confctl *);
int cv_filter(int /*<<< orphan*/, int /*<<< orphan*/);
void cc_filter(struct confctl *cc, struct confctl *filter) {
  bool found;
  found = cv_filter(confctl_root(cc), confctl_root(filter));
  assert(found);
}


x86 assembly (clang, -O0):
<cc_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <confctl_root@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <confctl_root@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   1050 <cv_filter@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_filter>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <confctl_root@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <confctl_root@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <cv_filter@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <assert@plt>

LLVM IR (-O0):
%struct.confctl = type { i32 }
define void @cc_filter(%struct.confctl* %0, %struct.confctl* %1) {
%3 = alloca %struct.confctl*
%4 = alloca %struct.confctl*
%5 = alloca i32
store %struct.confctl* %0, %struct.confctl** %3
store %struct.confctl* %1, %struct.confctl** %4
%6 = load %struct.confctl*, %struct.confctl** %3
%7 = call i32 @confctl_root(%struct.confctl* %6)
%8 = load %struct.confctl*, %struct.confctl** %4
%9 = call i32 @confctl_root(%struct.confctl* %8)
%10 = call i32 @cv_filter(i32 %7, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
%struct.confctl = type { i32 }
define void @cc_filter(%struct.confctl* %0, %struct.confctl* %1) {
%3 = tail call i32 @confctl_root(%struct.confctl* %0)
%4 = tail call i32 @confctl_root(%struct.confctl* %1)
%5 = tail call i32 @cv_filter(i32 %3, i32 %4)
%6 = tail call i32 @assert(i32 %5)
ret void
}
int test_imm_AFint64_lowword_mem(long long *val) {
  return ((*val) & (0xAF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AFint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 175
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct in_addr {
  unsigned char s_addr;
};

/* Variables and functions */
unsigned char inet_addr(char const *);
int inet_aton(const char *cp, struct in_addr *inp) {
  inp->s_addr = inet_addr(cp);
  if (inp->s_addr == (unsigned char)-1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<inet_aton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xff,%eax
jne    114f <inet_aton+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1156 <inet_aton+0x46>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_aton>:
push   %rbx
mov    %rsi,%rbx
call   1030 <inet_addr@plt>
mov    %al,(%rbx)
xor    %ecx,%ecx
cmp    $0xff,%al
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i8 }
define i32 @inet_aton(i8* %0, %struct.in_addr* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.in_addr*
store i8* %0, i8** %4
store %struct.in_addr* %1, %struct.in_addr** %5
%6 = load i8*, i8** %4
%7 = call zeroext i8 @inet_addr(i8* %6)
%8 = load %struct.in_addr*, %struct.in_addr** %5
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %8, i32 0, i32 0
store i8 %7, i8* %9
%10 = load %struct.in_addr*, %struct.in_addr** %5
%11 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %10, i32 0, i32 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 255
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %17
16: ; preds = %2
store i32 1, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.in_addr = type { i8 }
define i32 @inet_aton(i8* %0, %struct.in_addr* nocapture writeonly %1) {
%3 = tail call zeroext i8 @inet_addr(i8* %0)
%4 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %1, i64 0, i32 0
store i8 %3, i8* %4
%5 = icmp ne i8 %3, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct rGPIO {
  int dummy;
};

/* Variables and functions */
scalar_t__ GetMmap_(int);
struct rGPIO *GetGPIOB() {
  return (struct rGPIO *)GetMmap_(0xC0010000 + 0xB000);
}


x86 assembly (clang, -O0):
<GetGPIOB>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc001b000,%edi
call   1030 <GetMmap_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetGPIOB>:
mov    $0xc001b000,%edi
jmp    1030 <GetMmap_@plt>

LLVM IR (-O0):
%struct.rGPIO = type { i32 }
define %struct.rGPIO* @GetGPIOB() {
%1 = call i64 @GetMmap_(i32 -1073631232)
%2 = inttoptr i64 %1 to %struct.rGPIO*
ret %struct.rGPIO* %2
}

LLVM IR (-O2):
%struct.rGPIO = type { i32 }
define %struct.rGPIO* @GetGPIOB() {
%1 = tail call i64 @GetMmap_(i32 -1073631232)
%2 = inttoptr i64 %1 to %struct.rGPIO*
ret %struct.rGPIO* %2
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strcoll(int /*<<< orphan*/, int /*<<< orphan*/);
int versionsort(const void *_a, const void *_b) {
  struct dirent **a = (struct dirent **)_a;
  struct dirent **b = (struct dirent **)_b;
  return strcoll((*a)->d_name, (*b)->d_name);
}


x86 assembly (clang, -O0):
<versionsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
call   1030 <strcoll@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<versionsort>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcoll@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @versionsort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.dirent**
%6 = alloca %struct.dirent**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.dirent**
store %struct.dirent** %8, %struct.dirent*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.dirent**
store %struct.dirent** %10, %struct.dirent*** %6
%11 = load %struct.dirent**, %struct.dirent*** %5
%12 = load %struct.dirent*, %struct.dirent** %11
%13 = getelementptr inbounds %struct.dirent, %struct.dirent* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = load %struct.dirent**, %struct.dirent*** %6
%16 = load %struct.dirent*, %struct.dirent** %15
%17 = getelementptr inbounds %struct.dirent, %struct.dirent* %16, i32 0, i32 0
%18 = load i32, i32* %17
%19 = call i32 @strcoll(i32 %14, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @versionsort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to %struct.dirent**
%4 = bitcast i8* %1 to %struct.dirent**
%5 = load %struct.dirent*, %struct.dirent** %3
%6 = getelementptr inbounds %struct.dirent, %struct.dirent* %5, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.dirent*, %struct.dirent** %4
%9 = getelementptr inbounds %struct.dirent, %struct.dirent* %8, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 @strcoll(i32 %7, i32 %10)
ret i32 %11
}
int is_operation(char c) {
  if (c == '+' || c == '-' || c == '*' || c == '/' || c == '^')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_operation>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     114b <is_operation+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     114b <is_operation+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     114b <is_operation+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     114b <is_operation+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x5e,%eax
jne    1157 <is_operation+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <is_operation+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_operation>:
add    $0xd6,%dil
cmp    $0x34,%dil
ja     1124 <is_operation+0x24>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x1000000000002b,%rdx
bt     %rcx,%rdx
jae    1124 <is_operation+0x24>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_operation(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 43
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 42
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 47
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 94
br i1 %22, label %23, label %24
23: ; preds = %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %25
24: ; preds = %19
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_operation(i8 signext %0) {
switch i8 %0, label %2 [
i8 94, label %3
i8 47, label %3
i8 45, label %3
i8 43, label %3
i8 42, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_str(char *);
int main() {
  char *mystr = "Hello";
  print_str(mystr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <print_str@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @print_str(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AT_SYMLINK_NOFOLLOW;
int fstatat(int, char const *, struct stat *, int /*<<< orphan*/);
int lstatat(int fd, char const *name, struct stat *st) {
  return fstatat(fd, name, st, AT_SYMLINK_NOFOLLOW);
}


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

x86 assembly (clang, -O2):
<lstatat>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <fstatat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @lstatat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.stat*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.stat* %2, %struct.stat** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load %struct.stat*, %struct.stat** %6
%10 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%11 = call i32 @fstatat(i32 %7, i8* %8, %struct.stat* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @lstatat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%5 = tail call i32 @fstatat(i32 %0, i8* %1, %struct.stat* %2, i32 %4)
ret i32 %5
}
int nosys(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nosys() {
ret i32 0
}
/* Variables and functions */
scalar_t__ __stdio_outs(char const *, int);
int strlen(char const *);
int puts(const char *s) {
  return (__stdio_outs(s, strlen(s)) && __stdio_outs("\n", 1)) ? 0 : -1;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <__stdio_outs@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1175 <puts+0x55>
lea    0xe9f(%rip),%rdi
mov    $0x1,%esi
call   1040 <__stdio_outs@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0xffffffff,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <__stdio_outs@plt>
test   %rax,%rax
je     1151 <puts+0x31>
lea    0xec1(%rip),%rdi
mov    $0x1,%esi
call   1040 <__stdio_outs@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i64 @__stdio_outs(i8* %3, i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i64 @__stdio_outs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %1
%12 = phi i1 [ false, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 0, i32 -1
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i64 @__stdio_outs(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i64 @__stdio_outs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = icmp eq i64 %6, 0
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ -1, %1 ], [ %8, %5 ]
ret i32 %10
}
int trchar(unsigned char *tr, char c) {
  if (tr != (unsigned char *)(0)) {
    return (int)tr[(unsigned)(c & 0xff)];
  }
  return (int)((unsigned)(c & 0xff));
}


x86 assembly (clang, -O0):
<trchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1135 <trchar+0x35>
mov    -0x10(%rbp),%rax
movsbl -0x11(%rbp),%ecx
and    $0xff,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <trchar+0x41>
movsbl -0x11(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trchar>:
test   %rdi,%rdi
je     110d <trchar+0xd>
movzbl %sil,%eax
mov    (%rdi,%rax,1),%sil
movzbl %sil,%eax
ret

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

LLVM IR (-O2):
define i32 @trchar(i8* %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = zext i8 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
br label %8
8: ; preds = %2, %4
%9 = phi i8 [ %7, %4 ], [ %1, %2 ]
%10 = zext i8 %9 to i32
ret i32 %10
}
int fn8(int a, int b, int m) {
  int tem1 = b & m;
  int tem2 = ~m & a;
  return tem1 | tem2;
}


x86 assembly (clang, -O0):
<fn8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn8>:
mov    %esi,%eax
xor    %edi,%eax
and    %edx,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn8(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* %5
%10 = load i32, i32* %6
%11 = and i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = xor i32 %12, -1
%14 = load i32, i32* %4
%15 = and i32 %13, %14
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = or i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @fn8(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, %1
%5 = xor i32 %2, -1
%6 = and i32 %5, %0
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int EXIT_FAILURE;
scalar_t__ EXIT_SUCCESS;
scalar_t__ ft_putchar(char);
int ft_putstr(char const *);
int ft_putendl(char const *s) {
  int ret;
  ret = ft_putstr(s);
  ret = ft_putchar('\n') == EXIT_SUCCESS ? ret : EXIT_FAILURE;
  return (ret);
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_putstr@plt>
mov    %eax,-0xc(%rbp)
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%rax
jne    115d <ft_putendl+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <ft_putendl+0x49>
mov    0x2e7c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
push   %rbx
call   1040 <ft_putstr@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%rax
je     1147 <ft_putendl+0x27>
mov    0x2e9b(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i64 0
@EXIT_FAILURE = global i32 0
define i32 @ft_putendl(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ft_putstr(i8* %4)
store i32 %5, i32* %3
%6 = call i64 @ft_putchar(i8 signext 10)
%7 = load i64, i64* @EXIT_SUCCESS
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %3
br label %13
11: ; preds = %1
%12 = load i32, i32* @EXIT_FAILURE
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i64 0
@EXIT_FAILURE = global i32 0
define i32 @ft_putendl(i8* %0) {
%2 = tail call i32 @ft_putstr(i8* %0)
%3 = tail call i64 @ft_putchar(i8 signext 10)
%4 = load i64, i64* @EXIT_SUCCESS
%5 = icmp eq i64 %3, %4
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %5, i32 %2, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num, total;
  double price = 123.123;
  char a = 'a', abc;
  float x = 3.2, y = 3.0, z = 0.75;
  char ch1 = 'K', ch2 = 'P';
  num = 10;
  total = num * 30;
  printf("total=%d\n", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movb   $0x61,-0x19(%rbp)
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  0xeae(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movb   $0x4b,-0x29(%rbp)
movb   $0x50,-0x2a(%rbp)
movl   $0xa,-0x8(%rbp)
imul   $0x1e,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"total=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca i8
%6 = alloca i8
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i8
%11 = alloca i8
store i32 0, i32* %1
store double 1.231230e+02, double* %4
store i8 97, i8* %5
store float 0x40099999A0000000, float* %7
store float 3.000000e+00, float* %8
store float 7.500000e-01, float* %9
store i8 75, i8* %10
store i8 80, i8* %11
store i32 10, i32* %2
%12 = load i32, i32* %2
%13 = mul nsw i32 %12, 30
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"total=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 300)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
__attribute__((always_)) uint16_t bswap_16(uint16_t x) {
  x = (x >> 8) | (x << 8);
  return x;
}


x86 assembly (clang, -O0):
<bswap_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_16>:
mov    %edi,%eax
sar    $0x8,%eax
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bswap_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @bswap_16(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void test11111(int p, int q, int r) {
  int l = 53;
  while (p < r) {
    if ((67 + l - 25) != 95)
      link_error();
    p -= q;
  }
}


x86 assembly (clang, -O0):
<test11111>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x35,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <test11111+0x4d>
mov    -0x10(%rbp),%eax
add    $0x43,%eax
sub    $0x19,%eax
cmp    $0x5f,%eax
je     114d <test11111+0x3d>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <test11111+0x18>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test11111(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 53, i32* %7
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %4
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32, i32* %7
%14 = add nsw i32 67, %13
%15 = sub nsw i32 %14, 25
%16 = icmp ne i32 %15, 95
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = call i32 (...) @link_error()
br label %19
19: ; preds = %17, %12
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, %20
store i32 %22, i32* %4
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @test11111(i32 %0, i32 %1, i32 %2) {
ret void
}
int dull(int n) { return n / (1.5); }


x86 assembly (clang, -O0):
<dull>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dull>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @dull(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.500000e+00
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @dull(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 1.500000e+00
%4 = fptosi double %3 to i32
ret i32 %4
}
/* Type definitions */
struct surface {
  int dummy;
};

/* Variables and functions */
double polyhedron_subtends(struct surface *, double *);
int point_in_polyhedron(struct surface *msphn, double pnt[3]) {
  int is_inside;
  double solid;
  solid = polyhedron_subtends(msphn, pnt);
  is_inside = (solid > 2 * 3.14159265358979323846);
  return (is_inside);
}


x86 assembly (clang, -O0):
<point_in_polyhedron>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <polyhedron_subtends@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_in_polyhedron>:
push   %rax
call   1030 <polyhedron_subtends@plt>
xor    %eax,%eax
ucomisd 0xee0(%rip),%xmm0
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.surface = type { i32 }
define i32 @point_in_polyhedron(%struct.surface* %0, double* %1) {
%3 = alloca %struct.surface*
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
store %struct.surface* %0, %struct.surface** %3
store double* %1, double** %4
%7 = load %struct.surface*, %struct.surface** %3
%8 = load double*, double** %4
%9 = call double @polyhedron_subtends(%struct.surface* %7, double* %8)
store double %9, double* %6
%10 = load double, double* %6
%11 = fcmp ogt double %10, 0x401921FB54442D18
%12 = zext i1 %11 to i32
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
%struct.surface = type { i32 }
define i32 @point_in_polyhedron(%struct.surface* %0, double* %1) {
%3 = tail call double @polyhedron_subtends(%struct.surface* %0, double* %1)
%4 = fcmp ogt double %3, 0x401921FB54442D18
%5 = zext i1 %4 to i32
ret i32 %5
}
void drain_empty(void) {}


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

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

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

LLVM IR (-O2):
define void @drain_empty() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((constructor)) libx2_loaded(void) {
  printf("Libx2: loaded\n");
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Libx2: loaded\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @libx2_loaded, i8* null }]
define void @libx2_loaded() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @libx2_loaded, i8* null }]
@str = [14 x i8] c"Libx2: loaded\00"
define void @libx2_loaded() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler1(int sig) {
  int esp;
  printf("\nHandler 1: sig = %d\n", sig);
  return;
}


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

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"\0AHandler 1: sig = %d\0A\00"
define void @handler1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tock();
void tick(int sig) { tock(); }


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

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

LLVM IR (-O0):
define void @tick(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @tock()
ret void
}

LLVM IR (-O2):
define void @tick(i32 %0) {
%2 = tail call i32 (...) @tock()
ret void
}
fputs(s, fp) char *s;
struct _buf *fp;
{
  char c;
  while (c = *s++) {
    if (fputc(c, fp) == -1)
      return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
cmp    $0x0,%al
je     1165 <fputs+0x55>
movsbl -0x19(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <fputc@plt>
cmp    $0xffffffff,%eax
jne    1160 <fputs+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <fputs+0x5c>
jmp    1120 <fputs+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %r14d,%r14d
nopl   (%rax)
movsbl 0x0(%rbp),%edi
test   %edi,%edi
je     1141 <fputs+0x31>
add    $0x1,%rbp
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fputc@plt>
cmp    $0xffffffff,%eax
jne    1120 <fputs+0x10>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct._buf = type opaque
define i32 @fputs(i8* %0, %struct._buf* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct._buf*
%6 = alloca i8
store i8* %0, i8** %4
store %struct._buf* %1, %struct._buf** %5
br label %7
7: ; preds = %19, %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
store i8 %10, i8* %6
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %7
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = load %struct._buf*, %struct._buf** %5
%16 = call i32 (i32, %struct._buf*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %struct._buf*, ...)*)(i32 %14, %struct._buf* %15)
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 -1, i32* %3
br label %21
19: ; preds = %12
br label %7
20: ; preds = %7
store i32 0, i32* %3
br label %21
21: ; preds = %20, %18
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
%struct._buf = type opaque
define i32 @fputs(i8* nocapture %0, %struct._buf* %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = sext i8 %5 to i32
%10 = tail call i32 (i32, %struct._buf*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %struct._buf*, ...)*)(i32 %9, %struct._buf* %1)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %3
12: ; preds = %3, %7
%13 = phi i32 [ -1, %7 ], [ 0, %3 ]
ret i32 %13
}
void simgot_init() {
  asm("\tR0.H = _simgot;");
  asm("\tR0.L = _simgot;");
  asm("\tM2 = R0;");
}


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

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

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

LLVM IR (-O2):
define void @simgot_init() {
tail call void asm sideeffect "\09R0.H = _simgot;", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "\09R0.L = _simgot;", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "\09M2 = R0;", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef unsigned long long int64_t;

/* Variables and functions */
int imul_hi_op_32(int a, int b) {
  int64_t res = 0;
  res = (int64_t)a * (int64_t)b;
  return (int)(res >> 32ULL);
}


x86 assembly (clang, -O0):
<imul_hi_op_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x20,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imul_hi_op_32>:
movslq %edi,%rcx
movslq %esi,%rax
imul   %rcx,%rax
shr    $0x20,%rax
ret

LLVM IR (-O0):
define i32 @imul_hi_op_32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
store i64 0, i64* %5
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = mul i64 %7, %9
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = lshr i64 %11, 32
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @imul_hi_op_32(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = mul nsw i64 %4, %3
%6 = lshr i64 %5, 32
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cliprint_nl(void) { printf("\n"); }


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

x86 assembly (clang, -O2):
<cliprint_nl>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @cliprint_nl() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
float gammp(float a, float x) {}


x86 assembly (clang, -O0):
<gammp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @gammp(float %0, float %1) {
ret float undef
}