xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int i;
  i = 4;
  switch (i) {
  case 1:
    printf("vale uno \n");
    break;
  case 2:
    printf("vale due \n");
    break;
  default:
    printf("non uno non due\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     1152 <main+0x42>
jmp    1141 <main+0x31>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     1163 <main+0x53>
jmp    1174 <main+0x64>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x70>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x70>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [16 x i8] c"non uno non due\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void taskstats_tgid_init(struct signal_struct *sig) {}


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

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

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

LLVM IR (-O2):
%struct.signal_struct = type opaque
define void @taskstats_tgid_init(%struct.signal_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char **argv) {
  printf("Usage: %s RATE\n"
         "Throttles data flow through a pipe (stdin -> stdout)\n\n"
         "RATE may be a float followed by (case-insensitive): K, M, G, T\n",
         argv[0]);
}


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

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

LLVM IR (-O0):
@.str = [133 x i8] c"Usage: %s RATE\0AThrottles data flow through a pipe (stdin -> stdout)\0A\0ARATE may be a float followed by (case-insensitive): K, M, G, T\0A\00"
define void @print_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [133 x i8] c"Usage: %s RATE\0AThrottles data flow through a pipe (stdin -> stdout)\0A\0ARATE may be a float followed by (case-insensitive): K, M, G, T\0A\00"
define void @print_usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
struct RNA2Dfold_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct RNA2Dfold_args_info *);
int /*<<< orphan*/ clear_given(struct RNA2Dfold_args_info *);
int /*<<< orphan*/ init_args_info(struct RNA2Dfold_args_info *);
void RNA2Dfold_cmdline_parser_init(struct RNA2Dfold_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<RNA2Dfold_cmdline_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNA2Dfold_cmdline_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.RNA2Dfold_args_info = type { i32 }
define void @RNA2Dfold_cmdline_parser_init(%struct.RNA2Dfold_args_info* %0) {
%2 = alloca %struct.RNA2Dfold_args_info*
store %struct.RNA2Dfold_args_info* %0, %struct.RNA2Dfold_args_info** %2
%3 = load %struct.RNA2Dfold_args_info*, %struct.RNA2Dfold_args_info** %2
%4 = call i32 @clear_given(%struct.RNA2Dfold_args_info* %3)
%5 = load %struct.RNA2Dfold_args_info*, %struct.RNA2Dfold_args_info** %2
%6 = call i32 @clear_args(%struct.RNA2Dfold_args_info* %5)
%7 = load %struct.RNA2Dfold_args_info*, %struct.RNA2Dfold_args_info** %2
%8 = call i32 @init_args_info(%struct.RNA2Dfold_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.RNA2Dfold_args_info = type { i32 }
define void @RNA2Dfold_cmdline_parser_init(%struct.RNA2Dfold_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.RNA2Dfold_args_info* %0)
%3 = tail call i32 @clear_args(%struct.RNA2Dfold_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.RNA2Dfold_args_info* %0)
ret void
}
float obdConvert_0D(unsigned int A, unsigned int B, unsigned int C,
                    unsigned int D) {
  return (float)A;
}


x86 assembly (clang, -O0):
<obdConvert_0D>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_0D>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_0D(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @obdConvert_0D(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
ret float %5
}
/* Variables and functions */
float __ieee754_lgammaf_r(float, int *);
float lgammaf(float x) {
  int sign;
  return __ieee754_lgammaf_r(x, &sign);
}


x86 assembly (clang, -O0):
<lgammaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x8(%rbp),%rdi
call   1030 <__ieee754_lgammaf_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgammaf>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <__ieee754_lgammaf_r@plt>
pop    %rax
ret

LLVM IR (-O0):
define float @lgammaf(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @__ieee754_lgammaf_r(float %4, i32* %3)
ret float %5
}

LLVM IR (-O2):
define float @lgammaf(float %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call float @__ieee754_lgammaf_r(float %0, i32* %2)
ret float %4
}
int c035(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c035() {
ret i32 0
}
int main() {
  int a, b, c;
  if (b = a) {
    b = 0;
    c = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1128 <main+0x28>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-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
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %3
store i32 0, i32* %4
br label %8
8: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ writen(int, int /*<<< orphan*/ *, int);
ssize_t write_pid(int fd, pid_t v) { return writen(fd, &v, sizeof(pid_t)); }


x86 assembly (clang, -O0):
<write_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <writen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pid>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <writen@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @write_pid(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @writen(i32 %0, i32* %3, i32 4)
ret i32 %4
}
int test_trueFiveEighths(int x) {
  long long int x5 = (long long int)x * 5;
  return (int)(x5 / 8);
}


x86 assembly (clang, -O0):
<test_trueFiveEighths>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
imul   $0x5,%rax,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_trueFiveEighths>:
movslq %edi,%rax
lea    (%rax,%rax,4),%rcx
lea    (%rax,%rax,4),%rax
add    $0x7,%rax
test   %rcx,%rcx
cmovns %rcx,%rax
shr    $0x3,%rax
ret

LLVM IR (-O0):
define i32 @test_trueFiveEighths(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul nsw i64 %5, 5
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = sdiv i64 %7, 8
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_trueFiveEighths(i32 %0) {
%2 = sext i32 %0 to i64
%3 = mul nsw i64 %2, 5
%4 = sdiv i64 %3, 8
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ sleep(int);
int main(void) {
  FILE *xbee = fopen("/dev/ttyUSB1", "r+");
  while (1) {
    fprintf(xbee, "Testing\n");
    sleep(1);
  }
  fclose(xbee);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1156 <main+0x26>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,%rbx
lea    0xebf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/ttyUSB1\00"
@.str.1 = [3 x i8] c"r+\00"
@.str.2 = [9 x i8] c"Testing\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
br label %4
4: ; preds = %0, %4
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @sleep(i32 1)
br label %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/ttyUSB1\00"
@.str.1 = [3 x i8] c"r+\00"
@.str.2 = [9 x i8] c"Testing\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 8, i64 1, i32* %1)
%4 = tail call i32 @sleep(i32 1)
br label %2
}
/* Type definitions */
typedef int uint_least64_t;

/* Variables and functions */
uint_least64_t vc_get_insecureccaps() {
  return ~(0x00000001ull | 0x00000100ull | 0x00004000ull);
}


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

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

LLVM IR (-O0):
define i32 @vc_get_insecureccaps() {
ret i32 -16642
}

LLVM IR (-O2):
define i32 @vc_get_insecureccaps() {
ret i32 -16642
}
void ub_init_io(struct kmem_cache *pb_cachep) {}


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

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

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

LLVM IR (-O2):
%struct.kmem_cache = type opaque
define void @ub_init_io(%struct.kmem_cache* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int rand();
int main(void) {
  int i;
  for (i = 0; i < (rand() % 65536); i++)
    foo();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x10000,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
cmp    %edx,%eax
jge    116b <main+0x4b>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
test   $0x8000ffff,%eax
jle    1168 <main+0x48>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <foo@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffff0000,%ecx
sub    %ecx,%eax
cmp    %eax,%ebx
jl     1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, -2147418113
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ 0, %0 ]
%6 = tail call i32 (...) @foo()
%7 = add nuw nsw i32 %5, 1
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 65536
%10 = icmp slt i32 %7, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %0
ret i32 0
}
char *get(void) {
  char p[] = "hello";
  return p;
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xef0(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x6(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
lea    -0x6(%rsp),%rax
ret

LLVM IR (-O0):
@__const.get.p = [6 x i8] c"hello\00"
define i8* @get() {
%1 = alloca [6 x i8]
%2 = bitcast [6 x i8]* %1 to i8*
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @get() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G26_f(char *s) {
  debug("G26_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G26_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G26_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G26_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G26_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G26_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G26_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void printPtr(void *ptr) { printf("%p", ptr); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define void @printPtr(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr, "DEMO semigroup DCT convolution  \n");
  fprintf(stderr, "gaussconv_dct in sigma N out  \n");
  fprintf(stderr, "N - number of iterations \n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xee9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xef4(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef3(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf05(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"DEMO semigroup DCT convolution \0A\00"
@.str.1 = [32 x i8] c"gaussconv_dct in sigma N out \0A\00"
@.str.2 = [27 x i8] c"N - number of iterations \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"DEMO semigroup DCT convolution \0A\00"
@.str.1 = [32 x i8] c"gaussconv_dct in sigma N out \0A\00"
@.str.2 = [27 x i8] c"N - number of iterations \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t mp2vseq_get_vertical(const uint8_t *p_mp2vseq) {
  return ((p_mp2vseq[5] & 0xf) << 8) | p_mp2vseq[6] >> 4;
}


x86 assembly (clang, -O0):
<mp2vseq_get_vertical>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
and    $0xf,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseq_get_vertical>:
mov    0x14(%rdi),%ecx
mov    0x18(%rdi),%eax
and    $0xf,%ecx
shl    $0x8,%ecx
sar    $0x4,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mp2vseq_get_vertical(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = and i32 %5, 15
%7 = shl i32 %6, 8
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 6
%10 = load i32, i32* %9
%11 = ashr i32 %10, 4
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @mp2vseq_get_vertical(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, 3840
%6 = getelementptr inbounds i32, i32* %0, i64 6
%7 = load i32, i32* %6
%8 = ashr i32 %7, 4
%9 = or i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_hashed(void *name, void *data) { free(name); }


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

x86 assembly (clang, -O2):
<free_hashed>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_hashed(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
size_t next_array_cap(size_t previous_cap) {
  size_t cap = 2 * previous_cap - 1;
  while (cap & (cap - 1))
    cap = cap & (cap - 1);
  return cap;
}


x86 assembly (clang, -O0):
<next_array_cap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
sub    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1149 <next_array_cap+0x49>
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <next_array_cap+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_array_cap>:
lea    (%rdi,%rdi,1),%rcx
add    $0xffffffffffffffff,%rcx
nopl   0x0(%rax,%rax,1)
mov    %rcx,%rax
add    $0xffffffffffffffff,%rcx
and    %rax,%rcx
jne    1110 <next_array_cap+0x10>
ret

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

LLVM IR (-O2):
define i64 @next_array_cap(i64 %0) {
%2 = shl i64 %0, 1
%3 = add i64 %2, -1
br label %4
4: ; preds = %4, %1
%5 = phi i64 [ %3, %1 ], [ %7, %4 ]
%6 = add i64 %5, -1
%7 = and i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ cpu_set_irq_pending();
void mapper_assert_irq() { cpu_set_irq_pending(); }


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

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

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

LLVM IR (-O2):
define void @mapper_assert_irq() {
%1 = tail call i32 (...) @cpu_set_irq_pending()
ret void
}
/* Variables and functions */
bool nrf52_errata_151(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_151() {
ret i32 0
}
int fib(n)
int n;
{
  if (n < 2)
    return n;
  else
    return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <fib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib+0x10>
mov    %ebx,%ecx
jmp    1144 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, double *);
double read_double(FILE *fp) {
  double f;
  fscanf(fp, "%lf", &f);
  return f;
}


x86 assembly (clang, -O0):
<read_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <fscanf@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_double>:
push   %rax
lea    0xee8(%rip),%rsi
mov    %rsp,%rdx
call   1030 <fscanf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define double @read_double(i32* nocapture %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = load double, double* %2
ret double %5
}
/* Variables and functions */
scalar_t__ malloc(size_t);
double *dvector(int nl, int nh) {
  double *v;
  v = (double *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(double)));
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %rbx
mov    %edi,%ebx
sub    %edi,%esi
add    $0x2,%esi
movslq %esi,%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
movslq %ebx,%rcx
shl    $0x3,%rcx
neg    %rcx
add    %rcx,%rax
add    $0x8,%rax
pop    %rbx
ret

LLVM IR (-O0):
define double* @dvector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = add nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 8
%13 = call i64 @malloc(i64 %12)
%14 = inttoptr i64 %13 to double*
store double* %14, double** %5
%15 = load double*, double** %5
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = sub i64 0, %17
%19 = getelementptr inbounds double, double* %15, i64 %18
%20 = getelementptr inbounds double, double* %19, i64 1
ret double* %20
}

LLVM IR (-O2):
define double* @dvector(i32 %0, i32 %1) {
%3 = sub i32 2, %0
%4 = add i32 %3, %1
%5 = sext i32 %4 to i64
%6 = shl nsw i64 %5, 3
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to double*
%9 = sext i32 %0 to i64
%10 = sub nsw i64 0, %9
%11 = getelementptr inbounds double, double* %8, i64 %10
%12 = getelementptr inbounds double, double* %11, i64 1
ret double* %12
}
int bad4(const char *x) { return __builtin_constant_p(x); }


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

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

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

LLVM IR (-O2):
define i32 @bad4(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
bool nrf52_errata_231(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_231() {
ret i32 0
}
unsigned f(unsigned a) {
  unsigned b = a >> 31;
  return b & 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 31
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
int execute_pwrite64() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_pwrite64() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f();
void call_f(void) { f(); }


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

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

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

LLVM IR (-O2):
define void @call_f() {
%1 = tail call i32 (...) @f()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t I(uint32_t x, uint32_t y, uint32_t z) { return y ^ (x | ~z); }


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

x86 assembly (clang, -O2):
<I>:
mov    %edx,%eax
not    %eax
or     %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @I(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* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = xor i32 %9, -1
%11 = or i32 %8, %10
%12 = xor i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @I(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = or i32 %4, %0
%6 = xor i32 %5, %1
ret i32 %6
}
int hello() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hello() {
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t get_uint16(unsigned char *buf, int start) {
  return (uint16_t)buf[start] << 8 | (uint16_t)buf[start + 1];
}


x86 assembly (clang, -O0):
<get_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint16>:
movslq %esi,%rax
movzwl (%rdi,%rax,1),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @get_uint16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %11, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_uint16(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = add nsw i32 %1, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %7, %12
ret i32 %13
}
/* Type definitions */
typedef unsigned char uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void ADI8RegWrite(uint32_t ui32Base, uint32_t ui32Reg, uint8_t ui8Val) {
  ;
  ;
  (*((volatile unsigned char *)(ui32Base + ui32Reg))) = ui8Val;
}


x86 assembly (clang, -O0):
<ADI8RegWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADI8RegWrite>:
mov    %dl,(%rsi,%rdi,1)
ret

LLVM IR (-O0):
define void @ADI8RegWrite(i64 %0, i64 %1, i8 zeroext %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = add nsw i64 %8, %9
%11 = inttoptr i64 %10 to i8*
store volatile i8 %7, i8* %11
ret void
}

LLVM IR (-O2):
define void @ADI8RegWrite(i64 %0, i64 %1, i8 zeroext %2) {
%4 = add nsw i64 %1, %0
%5 = inttoptr i64 %4 to i8*
store volatile i8 %2, i8* %5
ret void
}
/* Type definitions */
struct dns_resolv_conf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dns_resconf_release(struct dns_resolv_conf *);
struct dns_resolv_conf *dns_resconf_mortal(struct dns_resolv_conf *resconf) {
  if (resconf)
    dns_resconf_release(resconf);
  return resconf;
}


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

x86 assembly (clang, -O2):
<dns_resconf_mortal>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1121 <dns_resconf_mortal+0x11>
mov    %rbx,%rdi
call   1030 <dns_resconf_release@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.dns_resolv_conf = type { i32 }
define %struct.dns_resolv_conf* @dns_resconf_mortal(%struct.dns_resolv_conf* %0) {
%2 = alloca %struct.dns_resolv_conf*
store %struct.dns_resolv_conf* %0, %struct.dns_resolv_conf** %2
%3 = load %struct.dns_resolv_conf*, %struct.dns_resolv_conf** %2
%4 = icmp ne %struct.dns_resolv_conf* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.dns_resolv_conf*, %struct.dns_resolv_conf** %2
%7 = call i32 @dns_resconf_release(%struct.dns_resolv_conf* %6)
br label %8
8: ; preds = %5, %1
%9 = load %struct.dns_resolv_conf*, %struct.dns_resolv_conf** %2
ret %struct.dns_resolv_conf* %9
}

LLVM IR (-O2):
%struct.dns_resolv_conf = type { i32 }
define %struct.dns_resolv_conf* @dns_resconf_mortal(%struct.dns_resolv_conf* returned %0) {
%2 = icmp eq %struct.dns_resolv_conf* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @dns_resconf_release(%struct.dns_resolv_conf* %0)
br label %5
5: ; preds = %3, %1
ret %struct.dns_resolv_conf* %0
}
/* Variables and functions */
int /*<<< orphan*/ Internal_heap_unlink(char *, int, void *);
void Heap_unlink(char *file, int line, void *p) {
  Internal_heap_unlink(file, line, p);
}


x86 assembly (clang, -O0):
<Heap_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <Internal_heap_unlink@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Heap_unlink>:
jmp    1030 <Internal_heap_unlink@plt>

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

LLVM IR (-O2):
define void @Heap_unlink(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @Internal_heap_unlink(i8* %0, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ json_oom();
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *json_strdup(const char *str) {
  char *ret = (char *)malloc(strlen(str) + 1);
  if (ret == NULL)
    json_oom();
  strcpy(ret, str);
  return ret;
}


x86 assembly (clang, -O0):
<json_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <json_strdup+0x37>
mov    $0x0,%al
call   1060 <json_oom@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1164 <json_strdup+0x24>
xor    %eax,%eax
call   1060 <json_oom@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @json_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 (...) @json_oom()
br label %13
13: ; preds = %11, %1
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @json_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 (...) @json_oom()
br label %9
9: ; preds = %7, %1
%10 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
size_t strspn(const char *str1, const char *str2) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @strspn(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ system(char *);
int main() {
  int a = 10;
  int b = 20;
  int sum = 0;
  system("clear");
  sum = a + b;
  printf("Hello World!\n");
  printf("Sum: %d", sum);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
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    0xeb8(%rip),%rdi
call   1040 <system@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xea6(%rip),%rdi
mov    $0x1e,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [14 x i8] c"Hello World!\0A\00"
@.str.2 = [8 x i8] c"Sum: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 10, i32* %1
store i32 20, i32* %2
store i32 0, i32* %3
%4 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
store i32 %7, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.2 = [8 x i8] c"Sum: %d\00"
@str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 30)
%4 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("flite -voice slt -f \"speech.txt\" ");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"flite -voice slt -f \22speech.txt\22 \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"flite -voice slt -f \22speech.txt\22 \00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t send(int, char *, size_t, int /*<<< orphan*/);
size_t raw_send(int sockd, char *data, size_t n) {
  return send(sockd, data, n, 0);
}


x86 assembly (clang, -O0):
<raw_send>:
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
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_send>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define i64 @raw_send(i32 %0, i8* %1, i64 %2) {
%4 = tail call i64 @send(i32 %0, i8* %1, i64 %2, i32 0)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int f(int, int);
int main() {
  int i;
  i = 1;
  i = f(1, 2);
  assert(i == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 @f(i32 1, i32 2)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}