xunge/DecIR huggingface dataset:
int test_imm_B3uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xB3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B3uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 179
%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_B3uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 179
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void decode(char *s) {
  while (*s) {
    (*s)--;
    s++;
  }
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1131 <decode+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
add    $0xff,%cl
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <decode+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
mov    (%rdi),%al
test   %al,%al
je     1120 <decode+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
add    $0xff,%al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <decode+0x10>
ret

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

LLVM IR (-O2):
define void @decode(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 i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add i8 %5, -1
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float num = 66.667f;
  printf("Num = %6.3f", num);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Num = %6.3f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float 0x4050AAB020000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ showMacroWithCode();
int /*<<< orphan*/ showMacrosFromCommandLine();
int /*<<< orphan*/ showMacrosWithValues();
int /*<<< orphan*/ showMacrosWithoutDefinition();
int main() {
  showMacrosWithoutDefinition();
  showMacrosWithValues();
  showMacrosFromCommandLine();
  showMacroWithCode();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <showMacrosWithoutDefinition@plt>
mov    $0x0,%al
call   1040 <showMacrosWithValues@plt>
mov    $0x0,%al
call   1060 <showMacrosFromCommandLine@plt>
mov    $0x0,%al
call   1050 <showMacroWithCode@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <showMacrosWithoutDefinition@plt>
xor    %eax,%eax
call   1040 <showMacrosWithValues@plt>
xor    %eax,%eax
call   1060 <showMacrosFromCommandLine@plt>
xor    %eax,%eax
call   1050 <showMacroWithCode@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @showMacrosWithoutDefinition()
%3 = call i32 (...) @showMacrosWithValues()
%4 = call i32 (...) @showMacrosFromCommandLine()
%5 = call i32 (...) @showMacroWithCode()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @showMacrosWithoutDefinition()
%2 = tail call i32 (...) @showMacrosWithValues()
%3 = tail call i32 (...) @showMacrosFromCommandLine()
%4 = tail call i32 (...) @showMacroWithCode()
ret i32 0
}
/* Type definitions */
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int pci_read_long(struct pci_dev *, int);
int via_init_spi(int);
int enable_flash_vt8237s_spi(struct pci_dev *dev, const char *name) {
  return via_init_spi(pci_read_long(dev, 0xbc) << 8);
}


x86 assembly (clang, -O0):
<enable_flash_vt8237s_spi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xbc,%esi
call   1040 <pci_read_long@plt>
mov    %eax,%edi
shl    $0x8,%edi
call   1030 <via_init_spi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_flash_vt8237s_spi>:
push   %rax
mov    $0xbc,%esi
call   1040 <pci_read_long@plt>
shl    $0x8,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <via_init_spi@plt>

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
define i32 @enable_flash_vt8237s_spi(%struct.pci_dev* %0, i8* %1) {
%3 = alloca %struct.pci_dev*
%4 = alloca i8*
store %struct.pci_dev* %0, %struct.pci_dev** %3
store i8* %1, i8** %4
%5 = load %struct.pci_dev*, %struct.pci_dev** %3
%6 = call i32 @pci_read_long(%struct.pci_dev* %5, i32 188)
%7 = shl i32 %6, 8
%8 = call i32 @via_init_spi(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
define i32 @enable_flash_vt8237s_spi(%struct.pci_dev* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @pci_read_long(%struct.pci_dev* %0, i32 188)
%4 = shl i32 %3, 8
%5 = tail call i32 @via_init_spi(i32 %4)
ret i32 %5
}
int int_cmp(const void *a, const void *b) {
  const int *ia = (const int *)a;
  const int *ib = (const int *)b;
  return *ia - *ib;
}


x86 assembly (clang, -O0):
<int_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @int_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
__attribute__((always_)) void flush_cache_range(struct vm_area_struct *vma,
                                                unsigned long start,
                                                unsigned long end) {}


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

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

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
define void @flush_cache_range(%struct.vm_area_struct* %0, i64 %1, i64 %2) {
%4 = alloca %struct.vm_area_struct*
%5 = alloca i64
%6 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
define void @flush_cache_range(%struct.vm_area_struct* nocapture %0, i64 %1, i64 %2) {
ret void
}
/* Variables and functions */
int euclid(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  printf("Enter the values for A and B:\n");
  scanf("%d %d", &a, &b);
  printf("Greatest common divisor is %d", euclid(a, b));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <euclid@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Enter the values for A and B:\0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [30 x i8] c"Greatest common divisor is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @euclid(i32 %6, i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [30 x i8] c"Greatest common divisor is %d\00"
@str = [30 x i8] c"Enter the values for A and B:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @euclid(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
int num_matches_id(const unsigned int num, const unsigned int id) {
  return num == id || num == -1U;
}


x86 assembly (clang, -O0):
<num_matches_id>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
cmp    -0x8(%rbp),%ecx
mov    %al,-0x9(%rbp)
je     1125 <num_matches_id+0x25>
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_matches_id>:
cmp    %esi,%edi
sete   %al
cmp    $0xffffffff,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @num_matches_id(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, -1
br label %11
11: ; preds = %8, %2
%12 = phi i1 [ true, %2 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @num_matches_id(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp eq i32 %0, -1
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
void WaitForAllThreadsFinished(void) {}


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

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

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

LLVM IR (-O2):
define void @WaitForAllThreadsFinished() {
ret void
}
/* Variables and functions */
int __send_to_ppe(int, int, char **);
int mkstemp(char *template) { return __send_to_ppe(0x2101, 53, &template); }


x86 assembly (clang, -O0):
<mkstemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2101,%edi
mov    $0x35,%esi
lea    -0x8(%rbp),%rdx
call   1030 <__send_to_ppe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkstemp>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdx
mov    $0x2101,%edi
mov    $0x35,%esi
call   1030 <__send_to_ppe@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mkstemp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 53, i8** %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @mkstemp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 53, i8** %2)
ret i32 %3
}
void ARGBToAR30Row_AVX2() {}


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

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

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

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

/* Variables and functions */
int fseeko(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int octave_fseeko_wrapper(FILE *fp, off_t offset, int whence) {
  return fseeko(fp, offset, whence);
}


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

x86 assembly (clang, -O2):
<octave_fseeko_wrapper>:
jmp    1030 <fseeko@plt>

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

LLVM IR (-O2):
define i32 @octave_fseeko_wrapper(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @fseeko(i32* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int _inetAtonDetail(int /*<<< orphan*/, size_t *, char const *,
                    struct in_addr *);
int inet_aton(const char *cp, struct in_addr *inp) {
  size_t numBytes;
  return _inetAtonDetail(0, &numBytes, cp, inp);
}


x86 assembly (clang, -O0):
<inet_aton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %edi,%edi
lea    -0x18(%rbp),%rsi
call   1030 <_inetAtonDetail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_aton>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <_inetAtonDetail@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @inet_aton(i8* %0, %struct.in_addr* %1) {
%3 = alloca i8*
%4 = alloca %struct.in_addr*
%5 = alloca i64
store i8* %0, i8** %3
store %struct.in_addr* %1, %struct.in_addr** %4
%6 = load i8*, i8** %3
%7 = load %struct.in_addr*, %struct.in_addr** %4
%8 = call i32 @_inetAtonDetail(i32 0, i64* %5, i8* %6, %struct.in_addr* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @inet_aton(i8* %0, %struct.in_addr* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @_inetAtonDetail(i32 0, i64* %3, i8* %0, %struct.in_addr* %1)
ret i32 %5
}
/* Variables and functions */
float sqrtf(int /*<<< orphan*/);
int /*<<< orphan*/ vec_sdot(unsigned int, float const *, float const *);
float vec_norm(unsigned int N, const float x[N]) {
  return sqrtf(vec_sdot(N, x, x));
}


x86 assembly (clang, -O0):
<vec_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <vec_sdot@plt>
mov    %eax,%edi
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_norm>:
push   %rax
mov    %rsi,%rdx
call   1040 <vec_sdot@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @vec_norm(i32 %0, float* %1) {
%3 = alloca i32
%4 = alloca float*
store i32 %0, i32* %3
store float* %1, float** %4
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = load i32, i32* %3
%8 = load float*, float** %4
%9 = load float*, float** %4
%10 = call i32 @vec_sdot(i32 %7, float* %8, float* %9)
%11 = call float @sqrtf(i32 %10)
ret float %11
}

LLVM IR (-O2):
define float @vec_norm(i32 %0, float* %1) {
%3 = tail call i32 @vec_sdot(i32 %0, float* %1, float* %1)
%4 = tail call float @sqrtf(i32 %3)
ret float %4
}
__attribute__((always_)) void patch_CAS_2_1_0_631_extra(void) {}


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

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

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

LLVM IR (-O2):
define void @patch_CAS_2_1_0_631_extra() {
ret void
}
/* Variables and functions */
int bar(char *, int);
int foo() {
  char c[100];
  return (bar(c, 1));
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
mov    $0x1,%esi
call   1030 <bar@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x68,%rsp
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <bar@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @bar(i8* %2, i32 1)
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @bar(i8* %2, i32 1)
ret i32 %3
}
unsigned char GetAKey() {
  unsigned char c;
  return (c);
}


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

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

LLVM IR (-O0):
define zeroext i8 @GetAKey() {
%1 = alloca i8
%2 = load i8, i8* %1
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @GetAKey() {
ret i8 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("MAIN\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"MAIN\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
long __syscall1(long n, long a1) {
  unsigned long ret;
  __asm__ __volatile__("syscall"
                       : "=a"(ret)
                       : "a"(n), "D"(a1)
                       : "rcx", "r11", "memory");
  return ret;
}


x86 assembly (clang, -O0):
<__syscall1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
syscall
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @__syscall1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @__syscall1(i64 %0, i64 %1) {
%3 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int EXIT_FAILURE;
int h_exit_failure(void) { return EXIT_FAILURE; }


x86 assembly (clang, -O0):
<h_exit_failure>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_exit_failure>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @h_exit_failure() {
%1 = load i32, i32* @EXIT_FAILURE
ret i32 %1
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @h_exit_failure() {
%1 = load i32, i32* @EXIT_FAILURE
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void txt_close_file(FILE *file) { fclose(file); }


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

x86 assembly (clang, -O2):
<txt_close_file>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @txt_close_file(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void line(int k) {
  for (int l = 1; l <= k; l++)
    printf("%d", k);
  printf("\n");
}


x86 assembly (clang, -O0):
<line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114d <line+0x3d>
mov    -0x4(%rbp),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <line+0x12>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1151 <line+0x31>
mov    %edi,%ebx
lea    0xecf(%rip),%r14
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1140 <line+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @line(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %5, %1
%4 = tail call i32 @putchar(i32 10)
ret void
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 1, %1 ]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = add nuw i32 %6, 1
%9 = icmp eq i32 %6, %0
br i1 %9, label %3, label %5
}
unsigned int getlength(unsigned char *input) {
  unsigned int count = 0;
  while (input[count] != '\0') {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<getlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1131 <getlength+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getlength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getlength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int ft_strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void print_error(char *propose, char *message) {
  write(2, "ft_cat: ", 8);
  write(2, propose, ft_strlen(propose));
  write(2, message, ft_strlen(message));
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
lea    0xec4(%rip),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
mov    $0x2,%edi
mov    $0x8,%edx
call   1030 <write@plt>
mov    %rbx,%rdi
call   1040 <ft_strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %r14,%rdi
call   1040 <ft_strlen@plt>
mov    $0x2,%edi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"ft_cat: \00"
define void @print_error(i8* %0, i8* %1) {
%3 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = tail call i32 @write(i32 2, i8* %0, i32 %4)
%6 = tail call i32 @ft_strlen(i8* %1)
%7 = tail call i32 @write(i32 2, i8* %1, i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ecc_ec_mult(int /*<<< orphan*/ const *,
                               int /*<<< orphan*/ const *,
                               int /*<<< orphan*/ const *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void ecc_ecdh(const uint32_t *px, const uint32_t *py, const uint32_t *secret,
              uint32_t *resultx, uint32_t *resulty) {
  ecc_ec_mult(px, py, secret, resultx, resulty);
}


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

x86 assembly (clang, -O2):
<ecc_ecdh>:
jmp    1030 <ecc_ec_mult@plt>

LLVM IR (-O0):
define void @ecc_ecdh(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @ecc_ec_mult(i32* %11, i32* %12, i32* %13, i32* %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @ecc_ecdh(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @ecc_ec_mult(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct syslog_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vsyslog(int, char const *, int /*<<< orphan*/);
void vsyslog_r(int priority, struct syslog_data *data, const char *fmt,
               va_list ap) {
  vsyslog(priority, fmt, ap);
}


x86 assembly (clang, -O0):
<vsyslog_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <vsyslog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsyslog_r>:
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <vsyslog@plt>

LLVM IR (-O0):
%struct.syslog_data = type { i32 }
define void @vsyslog_r(i32 %0, %struct.syslog_data* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.syslog_data*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store %struct.syslog_data* %1, %struct.syslog_data** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @vsyslog(i32 %9, i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.syslog_data = type { i32 }
define void @vsyslog_r(i32 %0, %struct.syslog_data* nocapture readnone %1, i8* %2, i32 %3) {
%5 = tail call i32 @vsyslog(i32 %0, i8* %2, i32 %3)
ret void
}
void test2() { 22; }


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

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

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

LLVM IR (-O2):
define void @test2() {
ret void
}
void userPanic(void) { return; }


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

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

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

LLVM IR (-O2):
define void @userPanic() {
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int func_as_param_test() {
  int sum, a = 1, b = 2, c;
  sum = add(c = add(a, b), add(1, 2));
  printf("sum = %d\n", sum);
}


x86 assembly (clang, -O0):
<func_as_param_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <add@plt>
mov    %eax,-0x18(%rbp)
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   1030 <add@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_as_param_test>:
push   %rbx
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
mov    %eax,%ebx
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <add@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"sum = %d\0A\00"
define i32 @func_as_param_test() {
%1 = tail call i32 @add(i32 1, i32 2)
%2 = tail call i32 @add(i32 1, i32 2)
%3 = tail call i32 @add(i32 %1, i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 undef
}
/* Variables and functions */
double libt_timetointerval4(int /*<<< orphan*/, double, double, double);
int /*<<< orphan*/ libt_walltime();
double libt_timetointerval2(double interval, double offset) {
  return libt_timetointerval4(libt_walltime(), interval, offset,
                              interval * 0.05);
}


x86 assembly (clang, -O0):
<libt_timetointerval2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <libt_walltime@plt>
mov    %eax,%edi
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xeb3(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
call   1040 <libt_timetointerval4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libt_timetointerval2>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <libt_walltime@plt>
movsd  0xec1(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm2
mov    %eax,%edi
movsd  0x10(%rsp),%xmm1
add    $0x18,%rsp
jmp    1040 <libt_timetointerval4@plt>

LLVM IR (-O0):
define double @libt_timetointerval2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 (...) @libt_walltime()
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fmul double %8, 5.000000e-02
%10 = call double @libt_timetointerval4(i32 %5, double %6, double %7, double %9)
ret double %10
}

LLVM IR (-O2):
define double @libt_timetointerval2(double %0, double %1) {
%3 = tail call i32 (...) @libt_walltime()
%4 = fmul double %0, 5.000000e-02
%5 = tail call double @libt_timetointerval4(i32 %3, double %0, double %1, double %4)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ isal_deflate_hash_base(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/ *,
                                          int /*<<< orphan*/);
void isal_deflate_hash_lvl1(uint16_t *hash_table, uint32_t hash_mask,
                            uint32_t current_index, uint8_t *dict,
                            uint32_t dict_len) {
  isal_deflate_hash_base(hash_table, hash_mask, current_index, dict, dict_len);
}


x86 assembly (clang, -O0):
<isal_deflate_hash_lvl1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <isal_deflate_hash_base@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isal_deflate_hash_lvl1>:
jmp    1030 <isal_deflate_hash_base@plt>

LLVM IR (-O0):
define void @isal_deflate_hash_lvl1(i32* %0, i32 %1, i32 %2, i32* %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32*, i32** %9
%15 = load i32, i32* %10
%16 = call i32 @isal_deflate_hash_base(i32* %11, i32 %12, i32 %13, i32* %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @isal_deflate_hash_lvl1(i32* %0, i32 %1, i32 %2, i32* %3, i32 %4) {
%6 = tail call i32 @isal_deflate_hash_base(i32* %0, i32 %1, i32 %2, i32* %3, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
void read_cstring(FILE *f, char *buff) {
  int i = 0;
  do {
    fread(buff + i, 1, 1, f);
  } while (buff[i++]);
}


x86 assembly (clang, -O0):
<read_cstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
jne    1127 <read_cstring+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_cstring>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <read_cstring+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @read_cstring(i32* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %7, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = tail call i32 @fread(i8* %5, i32 1, i32 1, i32* %0)
%7 = add nuw i64 %4, 1
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
void init_debug_settings() {}


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

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

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

LLVM IR (-O2):
define void @init_debug_settings() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *xrealloc(void *ptr, size_t size) {
  void *ret = realloc(ptr, size);
  if (ret == NULL && size != 0) {
    fprintf(stderr, "Allocation of memory of size %ld failed, exiting...",
            (long int)size);
    exit(-1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118a <xrealloc+0x5a>
cmpq   $0x0,-0x10(%rbp)
je     118a <xrealloc+0x5a>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe85(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <realloc@plt>
test   %rbx,%rbx
je     1143 <xrealloc+0x13>
test   %rax,%rax
je     1145 <xrealloc+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Allocation of memory of size %ld failed, exiting...\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i64, i64* %4
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* @stderr
%16 = load i64, i64* %4
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i64 %16)
%18 = call i32 @exit(i32 -1)
unreachable
19: ; preds = %11, %2
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Allocation of memory of size %ld failed, exiting...\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i64 %1)
%10 = tail call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int doMainCTE(int, char **);
int main(int argc, char **argv) { return doMainCTE(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <doMainCTE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <doMainCTE@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @doMainCTE(i32 %0, i8** %1)
ret i32 %3
}
char *strcat(s1, s2)
register char *s1, *s2;
{
  char *original = s1;
  while (*s1++ != 0)
    ;
  s1--;
  while (*s1++ = *s2++)
    ;
  return (original);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1134 <strcat+0x34>
jmp    1114 <strcat+0x14>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     116f <strcat+0x6f>
jmp    1140 <strcat+0x40>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
int ft_isalpha(int c) {
  int retour;
  retour = 0;
  if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
    retour = 1;
  return (retour);
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1122 <ft_isalpha+0x22>
cmpl   $0x7a,-0x4(%rbp)
jle    1136 <ft_isalpha+0x36>
cmpl   $0x41,-0x4(%rbp)
jl     113d <ft_isalpha+0x3d>
cmpl   $0x5a,-0x4(%rbp)
jg     113d <ft_isalpha+0x3d>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 122
br i1 %8, label %15, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
%11 = icmp sge i32 %10, 65
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp sle i32 %13, 90
br i1 %14, label %15, label %16
15: ; preds = %12, %6
store i32 1, i32* %3
br label %16
16: ; preds = %15, %12, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}