xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ puts(char *);
void printData(char *data) {
  int i;
  for (i = 0; i < (512 * 2); i++) {
    printf("%d ", data[i]);
  }
  puts("----");
}


x86 assembly (clang, -O0):
<printData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    1166 <printData+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xeb1(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <printData+0x13>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printData>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    1140 <printData+0x20>
lea    0xea3(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [5 x i8] c"----\00"
define void @printData(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1024
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %12)
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
%18 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.1 = [5 x i8] c"----\00"
define void @printData(i8* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = add nuw nsw i64 %3, 1
%8 = icmp eq i64 %7, 1024
br i1 %8, label %9, label %2
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((no, noclone)) unsigned __int128 t153_2add(unsigned __int128 y) {
  unsigned __int128 x = (1);
  unsigned __int128 r;
  if (__builtin_add_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t153_2add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
add    %rsi,%rdx
adc    %rax,%rcx
setb   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t153_2add+0x5e>
jmp    1175 <t153_2add+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t153_2add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
adc    $0x0,%r14
jae    112b <t153_2add+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t153_2add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 1, i128* %6
%12 = load i128, i128* %6
%13 = load i128, i128* %5
%14 = call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t153_2add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %6, i128 1)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
void outop0str(s) char *s;
{
  ;
  outstr(s);
}


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

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

LLVM IR (-O0):
define void @outop0str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %3)
ret void
}

LLVM IR (-O2):
define void @outop0str(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ fprintf(char *, char *);
char *stderr;
int closedir(DIR *dirp) {
  fprintf("closedir\n", stderr);
  return 0;
}


x86 assembly (clang, -O0):
<closedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%rsi
lea    0xed3(%rip),%rdi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closedir>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%rsi
lea    0xede(%rip),%rdi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"closedir\0A\00"
@stderr = global i8* null
define i32 @closedir(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i8*, i8** @stderr
%4 = call i32 @fprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"closedir\0A\00"
@stderr = global i8* null
define i32 @closedir(i32* nocapture readnone %0) {
%2 = load i8*, i8** @stderr
%3 = tail call i32 @fprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int mpop();
int /*<<< orphan*/ mpush(int);
void shr() { mpush(mpop() >> 1); }


x86 assembly (clang, -O0):
<shr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mpop@plt>
mov    %eax,%edi
sar    $0x1,%edi
call   1040 <mpush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shr>:
push   %rax
xor    %eax,%eax
call   1030 <mpop@plt>
sar    %eax
mov    %eax,%edi
pop    %rax
jmp    1040 <mpush@plt>

LLVM IR (-O0):
define void @shr() {
%1 = call i32 (...) @mpop()
%2 = ashr i32 %1, 1
%3 = call i32 @mpush(i32 %2)
ret void
}

LLVM IR (-O2):
define void @shr() {
%1 = tail call i32 (...) @mpop()
%2 = ashr i32 %1, 1
%3 = tail call i32 @mpush(i32 %2)
ret void
}
int execute_lstat64() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_lstat64() {
ret i32 0
}
int test_imm_D4uint16_mem(unsigned short *val) {
  return ((*val) & (0xD4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D4uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 212
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ct_signal_callback_do_nothing(int signal,
                                   struct ct_section *signaled_section,
                                   struct ct_section *section,
                                   struct ct_section *target_section) {}


x86 assembly (clang, -O0):
<ct_signal_callback_do_nothing>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ct_section = type opaque
define void @ct_signal_callback_do_nothing(i32 %0, %struct.ct_section* %1, %struct.ct_section* %2, %struct.ct_section* %3) {
%5 = alloca i32
%6 = alloca %struct.ct_section*
%7 = alloca %struct.ct_section*
%8 = alloca %struct.ct_section*
store i32 %0, i32* %5
store %struct.ct_section* %1, %struct.ct_section** %6
store %struct.ct_section* %2, %struct.ct_section** %7
store %struct.ct_section* %3, %struct.ct_section** %8
ret void
}

LLVM IR (-O2):
%struct.ct_section = type opaque
define void @ct_signal_callback_do_nothing(i32 %0, %struct.ct_section* nocapture %1, %struct.ct_section* nocapture %2, %struct.ct_section* nocapture %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  FILE *arquivo;
  int c;
  arquivo = fopen("lerbyte1", "r");
  int i;
  for (i = 0; i < 10; i++)
    ;
  c = getc(arquivo);
  printf("%i %c %x\n", c, c, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    117a <main+0x4a>
jmp    116c <main+0x3c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115d <main+0x2d>
mov    -0x10(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
call   1050 <getc@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
mov    %eax,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"lerbyte1\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"%i %c %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %5, i32** %2
store i32 0, i32* %4
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %13
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %6
13: ; preds = %6
%14 = load i32*, i32** %2
%15 = call i32 @getc(i32* %14)
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = load i32, i32* %3
%18 = load i32, i32* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %16, i32 %17, i32 %18)
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [9 x i8] c"lerbyte1\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"%i %c %x\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @getc(i32* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %2, i32 %2, i32 %2)
ret i32 0
}
/* Type definitions */
struct VmStatistics {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct VmStatistics *);
int DestroyVmStatStruct(struct VmStatistics *pStruct) {
  int nStatus = -1;
  if (pStruct != NULL) {
    free(pStruct);
    pStruct = NULL;
    nStatus = 0;
  }
  return (nStatus);
}


x86 assembly (clang, -O0):
<DestroyVmStatStruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <DestroyVmStatStruct+0x36>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DestroyVmStatStruct>:
test   %rdi,%rdi
je     1122 <DestroyVmStatStruct+0x12>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.VmStatistics = type { i32 }
define i32 @DestroyVmStatStruct(%struct.VmStatistics* %0) {
%2 = icmp eq %struct.VmStatistics* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.VmStatistics* %0)
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ id_t;

/* Variables and functions */
int syscall(int, int, int /*<<< orphan*/);
int getpriority(int which, id_t who) {
  int ret = syscall(96, which, who);
  if (ret < 0)
    return ret;
  return 20 - ret;
}


x86 assembly (clang, -O0):
<getpriority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x60,%edi
call   1030 <syscall@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1146 <getpriority+0x36>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <getpriority+0x41>
mov    $0x14,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpriority>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
mov    $0x60,%edi
call   1030 <syscall@plt>
mov    $0x14,%ecx
sub    %eax,%ecx
test   %eax,%eax
cmovns %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getpriority(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 96, i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
%5 = sub nsw i32 20, %3
%6 = select i1 %4, i32 %3, i32 %5
ret i32 %6
}
void g_io_channel_seek_position() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_seek_position() {
ret void
}
int test_imm_63int64_lowword_reg(long long val) {
  return ((val) & (0x63 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_63int64_lowword_reg>:
test   $0x63,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_63int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 99
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glColor3bv(char *);
void Color3bv(signed char v[3]) { glColor3bv(v); }


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

x86 assembly (clang, -O2):
<Color3bv>:
jmp    1030 <glColor3bv@plt>

LLVM IR (-O0):
define void @Color3bv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @glColor3bv(i8* %3)
ret void
}

LLVM IR (-O2):
define void @Color3bv(i8* %0) {
%2 = tail call i32 @glColor3bv(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fgcolor(int c) { printf("\x1b[[3%dm", c); }


x86 assembly (clang, -O0):
<fgcolor>:
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):
<fgcolor>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[[3%dm\00"
define void @fgcolor(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t fil_sreadU16(uint8_t *in) {
  uint16_t ret;
  ret = *((uint16_t *)in);
  return ret;
}


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

x86 assembly (clang, -O2):
<fil_sreadU16>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @fil_sreadU16(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ multiply(int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int t = 10;
  printf("address of t: %p\n", &t);
  multiply(&t);
  printf("%d\n", t);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <multiply@plt>
mov    0xc(%rsp),%esi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"address of t: %p\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 10, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = call i32 @multiply(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"address of t: %p\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @multiply(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, int /*<<< orphan*/ *);
int child_procedure(void) {
  execlp("."
         "/daemond-resurrectd",
         "daemond-resurrectd", NULL);
  return 1;
}


x86 assembly (clang, -O0):
<child_procedure>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee0(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execlp@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_procedure>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee3(%rip),%rsi
xor    %edx,%edx
call   1030 <execlp@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"./daemond-resurrectd\00"
@.str.1 = [19 x i8] c"daemond-resurrectd\00"
define i32 @child_procedure() {
%1 = call i32 @execlp(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret i32 1
}

LLVM IR (-O2):
@.str = [21 x i8] c"./daemond-resurrectd\00"
@.str.1 = [19 x i8] c"daemond-resurrectd\00"
define i32 @child_procedure() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret i32 1
}
void __relax() { asm volatile("pause" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @__relax() {
tail call void asm sideeffect "pause", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int __check_is_bitmap(const unsigned long *bitmap) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @__check_is_bitmap(i64* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double);
void Temperatures(double temperature) {
  double celsius, kelvin, fahrenheit = temperature;
  celsius = 1.8 * fahrenheit + 32;
  kelvin = 273.16 + celsius;
  printf("celsius = %.2f, kelvin = %.2f, fahrenheit = %.2f", celsius, kelvin,
         fahrenheit);
}


x86 assembly (clang, -O0):
<Temperatures>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xed4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeaf(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Temperatures>:
movapd %xmm0,%xmm2
movsd  0xee4(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
addsd  %xmm0,%xmm1
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"celsius = %.2f, kelvin = %.2f, fahrenheit = %.2f\00"
define void @Temperatures(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
store double %6, double* %5
%7 = load double, double* %5
%8 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %7, double 3.200000e+01)
store double %8, double* %3
%9 = load double, double* %3
%10 = fadd double 2.731600e+02, %9
store double %10, double* %4
%11 = load double, double* %3
%12 = load double, double* %4
%13 = load double, double* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), double %11, double %12, double %13)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"celsius = %.2f, kelvin = %.2f, fahrenheit = %.2f\00"
define void @Temperatures(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.800000e+00, double 3.200000e+01)
%3 = fadd double %2, 2.731600e+02
%4 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), double %2, double %3, double %0)
ret void
}
/* Variables and functions */
int strlen(const char *s) {
  int l;
  l = 0;
  while (*s++)
    l++;
  return l;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int main() {
  chdir(".");
  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 <chdir@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
void *find_bl_verify_shsh_5_6_7(struct iboot_img *);
void *find_bl_verify_shsh_generic(struct iboot_img *);
int get_os_version(struct iboot_img *);
void *find_bl_verify_shsh(struct iboot_img *iboot_in) {
  int os_vers = get_os_version(iboot_in);
  if (os_vers >= 5 && os_vers <= 7) {
    return find_bl_verify_shsh_5_6_7(iboot_in);
  }
  return find_bl_verify_shsh_generic(iboot_in);
}


x86 assembly (clang, -O0):
<find_bl_verify_shsh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <get_os_version@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jl     116e <find_bl_verify_shsh+0x3e>
cmpl   $0x7,-0x14(%rbp)
jg     116e <find_bl_verify_shsh+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <find_bl_verify_shsh_5_6_7@plt>
mov    %rax,-0x8(%rbp)
jmp    117b <find_bl_verify_shsh+0x4b>
mov    -0x10(%rbp),%rdi
call   1050 <find_bl_verify_shsh_generic@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_bl_verify_shsh>:
push   %rbx
mov    %rdi,%rbx
call   1040 <get_os_version@plt>
add    $0xfffffffb,%eax
mov    %rbx,%rdi
cmp    $0x2,%eax
ja     114a <find_bl_verify_shsh+0x1a>
pop    %rbx
jmp    1030 <find_bl_verify_shsh_5_6_7@plt>
pop    %rbx
jmp    1050 <find_bl_verify_shsh_generic@plt>

LLVM IR (-O0):
%struct.iboot_img = type { i32 }
define i8* @find_bl_verify_shsh(%struct.iboot_img* %0) {
%2 = alloca i8*
%3 = alloca %struct.iboot_img*
%4 = alloca i32
store %struct.iboot_img* %0, %struct.iboot_img** %3
%5 = load %struct.iboot_img*, %struct.iboot_img** %3
%6 = call i32 @get_os_version(%struct.iboot_img* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 5
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 7
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load %struct.iboot_img*, %struct.iboot_img** %3
%14 = call i8* @find_bl_verify_shsh_5_6_7(%struct.iboot_img* %13)
store i8* %14, i8** %2
br label %18
15: ; preds = %9, %1
%16 = load %struct.iboot_img*, %struct.iboot_img** %3
%17 = call i8* @find_bl_verify_shsh_generic(%struct.iboot_img* %16)
store i8* %17, i8** %2
br label %18
18: ; preds = %15, %12
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
%struct.iboot_img = type { i32 }
define i8* @find_bl_verify_shsh(%struct.iboot_img* %0) {
%2 = tail call i32 @get_os_version(%struct.iboot_img* %0)
%3 = add i32 %2, -5
%4 = icmp ult i32 %3, 3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i8* @find_bl_verify_shsh_5_6_7(%struct.iboot_img* %0)
br label %9
7: ; preds = %1
%8 = tail call i8* @find_bl_verify_shsh_generic(%struct.iboot_img* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ %8, %7 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ list_of_numbers;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int sum(int *, int);
int main(void) {
  int list_of_numbers[] = {10, 20, 30, 40, 50};
  printf("[main()] array size: %zu byte\n", sizeof(list_of_numbers));
  int result = sum(list_of_numbers, 5);
  printf("sum of each array element: %d\n", result);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    0xebf(%rip),%rdi
mov    $0x14,%esi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <sum@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed4(%rip),%rdi
mov    $0x14,%esi
call   1030 <printf@plt>
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <sum@plt>
lea    0xed5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.list_of_numbers = [5 x i32] [i32 10, i32 20, i32 30, i32 40, i32 50]
@.str = [31 x i8] c"[main()] array size: %zu byte\0A\00"
@.str.1 = [31 x i8] c"sum of each array element: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 20)
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = call i32 @sum(i32* %6, i32 5)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@__const.main.list_of_numbers = [5 x i32] [i32 10, i32 20, i32 30, i32 40, i32 50]
@.str = [31 x i8] c"[main()] array size: %zu byte\0A\00"
@.str.1 = [31 x i8] c"sum of each array element: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 20)
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @sum(i32* %4, i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
int test_imm_C9int8_mem(signed char *val) {
  return ((*val) & (0xC9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C9int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -55
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int helper_ret_6() { return 6; }


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

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

LLVM IR (-O0):
define i32 @helper_ret_6() {
ret i32 6
}

LLVM IR (-O2):
define i32 @helper_ret_6() {
ret i32 6
}
void ff_hevc_put_hevc_uni_w_epel_h24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_h24_8_sse4() {
ret void
}
/* Variables and functions */
scalar_t__ _copysign(int, double);
int signbit(double d) { return _copysign(1, d) < 0; }


x86 assembly (clang, -O0):
<signbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <_copysign@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signbit>:
push   %rax
mov    $0x1,%edi
call   1030 <_copysign@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @signbit(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @_copysign(i32 1, double %3)
%5 = icmp slt i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @signbit(double %0) {
%2 = tail call i64 @_copysign(i32 1, double %0)
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
void scrittura_matrice(int **matrice, int riga, int colonna, int valore) {
  matrice[riga][colonna] = valore;
  return;
}


x86 assembly (clang, -O0):
<scrittura_matrice>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrittura_matrice>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
movslq %edx,%rdx
mov    %ecx,(%rax,%rdx,4)
ret

LLVM IR (-O0):
define void @scrittura_matrice(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* %8
%10 = load i32**, i32*** %5
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32*, i32** %10, i64 %12
%14 = load i32*, i32** %13
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 %9, i32* %17
ret void
}

LLVM IR (-O2):
define void @scrittura_matrice(i32** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32*, i32** %0, i64 %5
%7 = load i32*, i32** %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i32, i32* %7, i64 %8
store i32 %3, i32* %9
ret void
}
void dos2unix(char *source) {
  char *dest = source;
  while (*source) {
    if (*source != '\015' && *source != '\032') {
      *dest = *source;
      dest++;
    }
    source++;
  }
  *dest = '\0';
}


x86 assembly (clang, -O0):
<dos2unix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1166 <dos2unix+0x66>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1155 <dos2unix+0x55>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1a,%eax
je     1155 <dos2unix+0x55>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <dos2unix+0x10>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dos2unix>:
mov    %rdi,%rax
jmp    1114 <dos2unix+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0xd,%cl
je     1110 <dos2unix+0x10>
cmp    $0x1a,%cl
je     1110 <dos2unix+0x10>
test   %cl,%cl
je     112d <dos2unix+0x2d>
mov    %cl,(%rax)
add    $0x1,%rax
jmp    1110 <dos2unix+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define void @dos2unix(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 0, label %11
i8 13, label %8
i8 26, label %8
]
6: ; preds = %2
store i8 %5, i8* %4
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %8
8: ; preds = %2, %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
store i8 0, i8* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int vdb_label(char *);
__attribute__((weak)) int vdb_label_i(int i) {
  char buf[128];
  snprintf(buf, 128, "%d", i);
  return vdb_label(buf);
}


x86 assembly (clang, -O0):
<vdb_label_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x80,%esi
lea    0xebc(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <vdb_label@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdb_label_i>:
push   %rbx
sub    $0x80,%rsp
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <vdb_label@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define weak i32 @vdb_label_i(i32 %0) {
%2 = alloca i32
%3 = alloca [128 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i32 @vdb_label(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define weak i32 @vdb_label_i(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @vdb_label(i8* %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_to_be16(int /*<<< orphan*/);
void cpu_to_be16w(uint16_t *p, uint16_t v) { *p = cpu_to_be16(v); }


x86 assembly (clang, -O0):
<cpu_to_be16w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <cpu_to_be16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_to_be16w>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <cpu_to_be16@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cpu_to_be16w(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @cpu_to_be16(i32 %1)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ mem_combine(unsigned char const *, scalar_t__, unsigned char const *,
                       scalar_t__);
scalar_t__ strlen(char const *);
char *str_combine(const char *src1, const char *src2) {
  return (char *)mem_combine((const unsigned char *)src1, strlen(src1),
                             (const unsigned char *)src2, strlen(src2) + 1);
}


x86 assembly (clang, -O0):
<str_combine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
add    $0x1,%rcx
call   1030 <mem_combine@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_combine>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rcx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <mem_combine@plt>

LLVM IR (-O0):
define i8* @str_combine(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = call i64 @mem_combine(i8* %5, i64 %7, i8* %8, i64 %11)
%13 = inttoptr i64 %12 to i8*
ret i8* %13
}

LLVM IR (-O2):
define i8* @str_combine(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @mem_combine(i8* %0, i64 %3, i8* %1, i64 %5)
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
unsigned int alarm(unsigned int);
unsigned int Alarm(unsigned int seconds) { return alarm(seconds); }


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

x86 assembly (clang, -O2):
<Alarm>:
jmp    1030 <alarm@plt>

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

LLVM IR (-O2):
define i32 @Alarm(i32 %0) {
%2 = tail call i32 @alarm(i32 %0)
ret i32 %2
}
/* Type definitions */
struct cli_def {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int verbose_validator(struct cli_def *cli, const char *name,
                      const char *value) {
  printf("verbose_validator called\n");
  return 0;
}


x86 assembly (clang, -O0):
<verbose_validator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cli_def = type { i32 }
@.str = [26 x i8] c"verbose_validator called\0A\00"
define i32 @verbose_validator(%struct.cli_def* %0, i8* %1, i8* %2) {
%4 = alloca %struct.cli_def*
%5 = alloca i8*
%6 = alloca i8*
store %struct.cli_def* %0, %struct.cli_def** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.cli_def = type { i32 }
@str = [25 x i8] c"verbose_validator called\00"
define i32 @verbose_validator(%struct.cli_def* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}