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


x86 assembly (clang, -O0):
<test_imm_A2uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xa2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_A2uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 162
%5 = icmp ne i32 %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_A2uint32_reg(i32 %0) {
%2 = and i32 %0, 162
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gtk_main_iteration_do() {}


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

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

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

LLVM IR (-O2):
define void @gtk_main_iteration_do() {
ret void
}
/* Variables and functions */
int is_cpu_feature_present(int, int, int);
int /*<<< orphan*/ is_cpu_genuine_intel();
int is_cpu_clwb_present(void) {
  if (!is_cpu_genuine_intel())
    return 0;
  int ret = is_cpu_feature_present(0x7, 1, (1 << 24));
  return ret;
}


x86 assembly (clang, -O0):
<is_cpu_clwb_present>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <is_cpu_genuine_intel@plt>
cmp    $0x0,%eax
jne    1144 <is_cpu_clwb_present+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1161 <is_cpu_clwb_present+0x41>
mov    $0x7,%edi
mov    $0x1,%esi
mov    $0x1000000,%edx
call   1030 <is_cpu_feature_present@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_cpu_clwb_present>:
push   %rax
xor    %eax,%eax
call   1040 <is_cpu_genuine_intel@plt>
test   %eax,%eax
je     1141 <is_cpu_clwb_present+0x21>
mov    $0x7,%edi
mov    $0x1,%esi
mov    $0x1000000,%edx
pop    %rax
jmp    1030 <is_cpu_feature_present@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_cpu_clwb_present() {
%1 = tail call i32 (...) @is_cpu_genuine_intel()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @is_cpu_feature_present(i32 7, i32 1, i32 16777216)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sx_single_write(int, int);
void sx_clear_irq() { sx_single_write(0x12, 0xff); }


x86 assembly (clang, -O0):
<sx_clear_irq>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12,%edi
mov    $0xff,%esi
call   1030 <sx_single_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sx_clear_irq>:
mov    $0x12,%edi
mov    $0xff,%esi
jmp    1030 <sx_single_write@plt>

LLVM IR (-O0):
define void @sx_clear_irq() {
%1 = call i32 @sx_single_write(i32 18, i32 255)
ret void
}

LLVM IR (-O2):
define void @sx_clear_irq() {
%1 = tail call i32 @sx_single_write(i32 18, i32 255)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int get_H(uint64_t x) {
  if (((x >> 63) & 0x01) != 0x01)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<get_H>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3f,%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x1,%eax
je     1129 <get_H+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1130 <get_H+0x30>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_H(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 63
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_H(i32 %0) {
ret i32 1
}
/* Variables and functions */
double pow(double, double);
double compute(double x, double y) { return (pow((double)x, (double)y)); }


x86 assembly (clang, -O0):
<compute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @compute(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @compute(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int _mm_cvtsd_si32(int /*<<< orphan*/);
int test_mm_cvtsd_si32(__m128d A) { return _mm_cvtsd_si32(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvtsd_si32>:
jmp    1030 <_mm_cvtsd_si32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvtsd_si32(i32 %0) {
%2 = tail call i32 @_mm_cvtsd_si32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ h(int);
int identImplicit(int);
void testImplicit() {
  int res = identImplicit(6);
  clang_analyzer_eval(res == 6);
  int uninitialized;
  h(uninitialized);
}


x86 assembly (clang, -O0):
<testImplicit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6,%edi
call   1030 <identImplicit@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x6,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
mov    -0x8(%rbp),%edi
call   1040 <h@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testImplicit>:
push   %rax
mov    $0x6,%edi
call   1030 <identImplicit@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
call   1050 <clang_analyzer_eval@plt>
pop    %rax
jmp    1040 <h@plt>

LLVM IR (-O0):
define void @testImplicit() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @identImplicit(i32 6)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 6
%6 = zext i1 %5 to i32
%7 = call i32 @clang_analyzer_eval(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @h(i32 %8)
ret void
}

LLVM IR (-O2):
define void @testImplicit() {
%1 = tail call i32 @identImplicit(i32 6)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
%5 = tail call i32 @h(i32 undef)
ret void
}
void halt() {
  asm volatile("movq (%%r9), %%rax\n\t"
               "movq $0x0, %%rdi\n\t"
               "movq %%rsp, %%r13\n\t"
               "movq %%r15, %%rsp\n\t"
               "callq *%%r12\n\t"
               "movq %%rsp, %%r15\n\t"
               "movq %%r13, %%rsp\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
mov    (%r9),%rax
mov    $0x0,%rdi
mov    %rsp,%r13
mov    %r15,%rsp
call   *%r12
mov    %rsp,%r15
mov    %r13,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<halt>:
mov    (%r9),%rax
mov    $0x0,%rdi
mov    %rsp,%r13
mov    %r15,%rsp
call   *%r12
mov    %rsp,%r15
mov    %r13,%rsp
ret

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

LLVM IR (-O2):
define void @halt() {
tail call void asm sideeffect "movq (%r9), %rax\0A\09movq $$0x0, %rdi\0A\09movq %rsp, %r13\0A\09movq %r15, %rsp\0A\09callq *%r12\0A\09movq %rsp, %r15\0A\09movq %r13, %rsp\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void foo494(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo494(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isprime(int);
int nextprime(int number) {
  for (; !isprime(number); number++)
    ;
  return number;
}


x86 assembly (clang, -O0):
<nextprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isprime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <nextprime+0x28>
jmp    114b <nextprime+0x3b>
jmp    113d <nextprime+0x2d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <nextprime+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextprime>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <isprime@plt>
add    $0x1,%ebx
test   %eax,%eax
je     1120 <nextprime+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @nextprime(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 @isprime(i32 %3)
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
void ARGBPolynomial() {}


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

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

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

LLVM IR (-O2):
define void @ARGBPolynomial() {
ret void
}
int foo(char c, int i) {
  int s = 0;
  while (i--)
    s += c;
  return s;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1137 <foo+0x37>
movsbl -0x1(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <foo+0x14>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = mul i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int arch_audio_codec_write_mask(int, int, int);
int arch_audio_power_write_mask(int reg, int val, int mask) {
  int ret = 0;
  ret = arch_audio_codec_write_mask(reg, val, mask);
  return ret;
}


x86 assembly (clang, -O0):
<arch_audio_power_write_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <arch_audio_codec_write_mask@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_audio_power_write_mask>:
jmp    1030 <arch_audio_codec_write_mask@plt>

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

LLVM IR (-O2):
define i32 @arch_audio_power_write_mask(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @arch_audio_codec_write_mask(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int execute_option(int, int, char **);
int parse_option(int, char **);
int main(int argc, char *argv[]) {
  int type = parse_option(argc, argv);
  return execute_option(type, argc, argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <parse_option@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <execute_option@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <parse_option@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <execute_option@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @parse_option(i32 %7, i8** %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @execute_option(i32 %10, i32 %11, i8** %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_option(i32 %0, i8** %1)
%4 = tail call i32 @execute_option(i32 %3, i32 %0, i8** %1)
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ print_ophead(int, char const *, int);
int /*<<< orphan*/ printf(char *, int);
void print_addr(uint16_t op, const char *name, int index) {
  print_ophead(op, name, index);
  printf("%X\n", op & 0x0FFF);
}


x86 assembly (clang, -O0):
<print_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <print_ophead@plt>
mov    -0x4(%rbp),%esi
and    $0xfff,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_addr>:
push   %rbx
mov    %edi,%ebx
call   1040 <print_ophead@plt>
and    $0xfff,%ebx
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%X\0A\00"
define void @print_addr(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @print_ophead(i32 %0, i8* %1, i32 %2)
%5 = and i32 %0, 4095
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ vet;

/* Variables and functions */
int /*<<< orphan*/ imprimeVetorInt(int *, int);
int *retiraNum(int *, int, int /*<<< orphan*/);
int main() {
  int vet[7] = {-1, 0, 1, 0, -3, 6, 4};
  int tamVet = sizeof(vet) / sizeof(int);
  imprimeVetorInt(vet, tamVet);
  imprimeVetorInt(retiraNum(vet, tamVet, 0), tamVet);
  return 0;
}


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    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <imprimeVetorInt@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
xor    %edx,%edx
call   1030 <retiraNum@plt>
mov    %rax,%rdi
mov    -0x24(%rbp),%esi
call   1040 <imprimeVetorInt@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <imprimeVetorInt@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %edx,%edx
call   1030 <retiraNum@plt>
mov    %rax,%rdi
mov    $0x7,%esi
call   1040 <imprimeVetorInt@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.vet = [7 x i32] [i32 -1, i32 0, i32 1, i32 0, i32 -3, i32 6, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [7 x i32]* %2 to i8*
store i32 7, i32* %3
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @imprimeVetorInt(i32* %5, i32 %6)
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32* @retiraNum(i32* %8, i32 %9, i32 0)
%11 = load i32, i32* %3
%12 = call i32 @imprimeVetorInt(i32* %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vet = [7 x i32] [i32 -1, i32 0, i32 1, i32 0, i32 -3, i32 6, i32 4]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @imprimeVetorInt(i32* %3, i32 7)
%5 = call i32* @retiraNum(i32* %3, i32 7, i32 0)
%6 = call i32 @imprimeVetorInt(i32* %5, i32 7)
ret i32 0
}
int do_367() { return 367; }


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

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

LLVM IR (-O0):
define i32 @do_367() {
ret i32 367
}

LLVM IR (-O2):
define i32 @do_367() {
ret i32 367
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void new_lines(int n) {
  int i;
  for (i = 0; i < n; ++i) {
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<new_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <new_lines+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <new_lines+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_lines>:
push   %rbx
test   %edi,%edi
jle    112f <new_lines+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <new_lines+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @new_lines(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 10)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
void addfd(fd_set *set, int fd, int *nfds) {
  if (fd + 1 > *nfds)
    *nfds = fd + 1;
  FD_SET(fd, set);
}


x86 assembly (clang, -O0):
<addfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    1141 <addfd+0x31>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <FD_SET@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addfd>:
mov    %esi,%eax
mov    %rdi,%rsi
cmp    %eax,(%rdx)
jg     111e <addfd+0xe>
lea    0x1(%rax),%ecx
mov    %ecx,(%rdx)
mov    %eax,%edi
jmp    1030 <FD_SET@plt>

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

LLVM IR (-O2):
define void @addfd(i32* %0, i32 %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = add nsw i32 %1, 1
store i32 %7, i32* %2
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @FD_SET(i32 %1, i32* %0)
ret void
}
void mov_s(float *source, float *target) { *target = *source; }


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

x86 assembly (clang, -O2):
<mov_s>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
ret

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

LLVM IR (-O2):
define void @mov_s(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
ret void
}
void run_compiler_etc() {}


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

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

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

LLVM IR (-O2):
define void @run_compiler_etc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ reverse(char *, int);
int /*<<< orphan*/ test_reverse();
int main() {
  test_reverse();
  printf("reverse() works!\n");
  char str[] = "Hello there";
  reverse(str, 11);
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_reverse@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0xeb7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0xb,%esi
call   1030 <reverse@plt>
lea    -0x10(%rbp),%rsi
lea    0xe9d(%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
xor    %eax,%eax
call   1050 <test_reverse@plt>
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
movabs $0x6874206f6c6c6548,%rax
20 74 68
mov    %rax,(%rsp)
movl   $0x657265,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <reverse@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"reverse() works!\0A\00"
@__const.main.str = [12 x i8] c"Hello there\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
store i32 0, i32* %1
%3 = call i32 (...) @test_reverse()
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = bitcast [12 x i8]* %2 to i8*
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%7 = call i32 @reverse(i8* %6, i32 11)
%8 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [12 x i8] c"Hello there\00"
@str = [17 x i8] c"reverse() works!\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = tail call i32 (...) @test_reverse()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%5 = call i32 @reverse(i8* %4, i32 11)
%6 = call i32 @puts(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int mod(int x, int y) {
  assert(0 != y);
  return x % y;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
test   %esi,%esi
setne  %dil
call   1030 <assert@plt>
mov    %ebp,%eax
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mod(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 = icmp ne i32 0, %5
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = srem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = srem i32 %0, %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ testQueryPlanning();
int main(int argc, char **argv) {
  testQueryPlanning();
  printf("All Query Planning Tests Executed.\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"All Query Planning Tests Executed.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @testQueryPlanning()
%6 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"All Query Planning Tests Executed.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testQueryPlanning()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_create(scalar_t__ *, int /*<<< orphan*/ *,
                                  void *(*)(void *), void *);
void *thread_create(void (*threadfunc)(void *), void *u) {
  pthread_t id;
  pthread_create(&id, NULL, (void *(*)(void *))threadfunc, u);
  return (void *)id;
}


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

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

LLVM IR (-O0):
define i8* @thread_create(void (i8*)* %0, i8* %1) {
%3 = alloca void (i8*)*
%4 = alloca i8*
%5 = alloca i64
store void (i8*)* %0, void (i8*)** %3
store i8* %1, i8** %4
%6 = load void (i8*)*, void (i8*)** %3
%7 = bitcast void (i8*)* %6 to i8* (i8*)*
%8 = load i8*, i8** %4
%9 = call i32 @pthread_create(i64* %5, i32* null, i8* (i8*)* %7, i8* %8)
%10 = load i64, i64* %5
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @thread_create(void (i8*)* %0, i8* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = bitcast void (i8*)* %0 to i8* (i8*)*
%6 = call i32 @pthread_create(i64* %3, i32* null, i8* (i8*)* %5, i8* %1)
%7 = load i64, i64* %3
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
int main() {
  int i = 4;
  char myStr[] = "This is stored on a stack.";
  short s = 2;
  short s1 = 7;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xee4(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%ax
mov    %ax,-0x18(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x16(%rbp)
movw   $0x2,-0x32(%rbp)
movw   $0x7,-0x34(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.myStr = [27 x i8] c"This is stored on a stack.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [27 x i8]
%4 = alloca i16
%5 = alloca i16
store i32 0, i32* %1
store i32 4, i32* %2
%6 = bitcast [27 x i8]* %3 to i8*
store i16 2, i16* %4
store i16 7, i16* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void stopCounter(void) {
  int volatile *IO = (int *)(0x3c000000 + 5 * 0x00000020);
  int value;
  value = *IO;
  *IO = value & 0xbfffffff;
}


x86 assembly (clang, -O0):
<stopCounter>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c0000a0,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xbfffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopCounter>:
andl   $0xbfffffff,0x3c0000a0
ff ff ff bf
ret

LLVM IR (-O0):
define void @stopCounter() {
%1 = alloca i32*
%2 = alloca i32
store i32* inttoptr (i64 1006633120 to i32*), i32** %1
%3 = load i32*, i32** %1
%4 = load volatile i32, i32* %3
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, -1073741825
%7 = load i32*, i32** %1
store volatile i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @stopCounter() {
%1 = load volatile i32, i32* inttoptr (i64 1006633120 to i32*)
%2 = and i32 %1, -1073741825
store volatile i32 %2, i32* inttoptr (i64 1006633120 to i32*)
ret void
}
int mult(unsigned x, unsigned y) {
  if (x != 0)
    if (y != 0) {
      unsigned z = x * y;
      if (z != 0)
        return 1;
    }
  return 0;
}


x86 assembly (clang, -O0):
<mult>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1148 <mult+0x48>
cmpl   $0x0,-0xc(%rbp)
je     1143 <mult+0x43>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     113e <mult+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    114f <mult+0x4f>
jmp    1143 <mult+0x43>
jmp    1148 <mult+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult>:
test   %edi,%edi
setne  %al
test   %esi,%esi
setne  %cl
and    %al,%cl
imul   %edi,%esi
test   %esi,%esi
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @mult(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 = icmp ne i32 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = mul i32 %13, %14
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 1, i32* %3
br label %22
19: ; preds = %12
br label %20
20: ; preds = %19, %9
br label %21
21: ; preds = %20, %2
store i32 0, i32* %3
br label %22
22: ; preds = %21, %18
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @mult(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
%6 = mul i32 %1, %0
%7 = icmp eq i32 %6, 0
%8 = or i1 %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}
char hexdig(int num) {
  static char digs[] = "0123456789ABCDEF";
  return num < 16 ? digs[num] : '?';
}


x86 assembly (clang, -O0):
<hexdig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <hexdig+0x28>
movslq -0x4(%rbp),%rcx
lea    0x2f14(%rip),%rax
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <hexdig+0x35>
mov    $0x3f,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <hexdig+0x35>
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdig>:
mov    $0x3f,%al
cmp    $0xf,%edi
jg     1114 <hexdig+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@hexdig.digs = internal global [17 x i8] c"0123456789ABCDEF\00"
define signext i8 @hexdig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 16
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [17 x i8], [17 x i8]* @hexdig.digs, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %5
%13 = phi i32 [ %10, %5 ], [ 63, %11 ]
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
@hexdig.digs = internal unnamed_addr constant [17 x i8] c"0123456789ABCDEF\00"
define signext i8 @hexdig(i32 %0) {
%2 = icmp slt i32 %0, 16
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @hexdig.digs, i64 0, i64 %4
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ 63, %1 ]
ret i8 %8
}
/* Variables and functions */
int gpiotools_gets(char const *, unsigned int *, int, unsigned int *);
int gpiotools_get(const char *device_name, unsigned int line) {
  int ret;
  unsigned int value;
  unsigned int lines[] = {line};
  ret = gpiotools_gets(device_name, lines, 1, &value);
  if (ret)
    return ret;
  return value;
}


x86 assembly (clang, -O0):
<gpiotools_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
lea    -0x1c(%rbp),%rcx
call   1030 <gpiotools_gets@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1153 <gpiotools_get+0x43>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <gpiotools_get+0x49>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpiotools_get>:
push   %rax
mov    %esi,(%rsp)
mov    %rsp,%rsi
lea    0x4(%rsp),%rcx
mov    $0x1,%edx
call   1030 <gpiotools_gets@plt>
test   %eax,%eax
jne    112e <gpiotools_get+0x1e>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gpiotools_get(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca [1 x i32]
%5 = bitcast i32* %3 to i8*
%6 = bitcast [1 x i32]* %4 to i8*
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
store i32 %1, i32* %7
%8 = call i32 @gpiotools_gets(i8* %0, i32* %7, i32 1, i32* %3)
%9 = icmp eq i32 %8, 0
%10 = load i32, i32* %3
%11 = select i1 %9, i32 %10, i32 %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x1d() {
  Assert_real((isodigit(29) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              150, ("isodigit should be 0 for 0x1d"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x1d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1d,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x96,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x1d>:
push   %rax
mov    $0x1d,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x96,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x1d\00"
define void @t_isodigit_0x1d() {
%1 = call i64 @isodigit(i32 29)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 150, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x1d\00"
define void @t_isodigit_0x1d() {
%1 = tail call i64 @isodigit(i32 29)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 150, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/ *, char *);
int main() {
  char buffer[BUFSIZ];
  FILE *file;
  file = fopen("test.txt", "w");
  setbuf(file, buffer);
  fclose(file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
lea    0xe8e(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1050 <fopen@plt>
mov    -0x28(%rbp),%rsi
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <setbuf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xea8(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <setbuf@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32*
store i32 0, i32* %1
%5 = load i32, i32* @BUFSIZ
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i8, i64 %6
store i64 %6, i64* %3
%9 = 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* %9, i32** %4
%10 = load i32*, i32** %4
%11 = call i32 @setbuf(i32* %10, i8* %8)
%12 = load i32*, i32** %4
%13 = call i32 @fclose(i32* %12)
store i32 0, i32* %1
%14 = load i8*, i8** %2
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @main() {
%1 = load i32, i32* @BUFSIZ
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = 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))
%5 = call i32 @setbuf(i32* %4, i8* %3)
%6 = call i32 @fclose(i32* %4)
ret i32 0
}
/* Variables and functions */
int printf(char *, int);
int main() {
  int x = 1, y = 0, z = 3;
  x > y ? printf("%d", z) : z;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1154 <main+0x44>
mov    -0x10(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1157 <main+0x47>
mov    -0x10(%rbp),%eax
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
void single_n() {
  register int out0 = 0;
  asm("foo %1,%0" : "=r"(out0) : "n"(1));
}


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

LLVM IR (-O0):
LLVM IR (-O2):
define void @single_n() {
%1 = tail call i32 asm "foo $1,$0", "=r,n,~{dirflag},~{fpsr},~{flags}"(i32 1)
ret void
}
double get_dynamical_diff_sh2(double JD) {
  double TD, t;
  t = (JD - 2396758.5) / 36525.0;
  TD = 22.5 * t * t;
  return TD;
}


x86 assembly (clang, -O0):
<get_dynamical_diff_sh2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecd(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dynamical_diff_sh2>:
addsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @get_dynamical_diff_sh2(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fsub double %5, 0x4142492B40000000
%7 = fdiv double %6, 3.652500e+04
store double %7, double* %4
%8 = load double, double* %4
%9 = fmul double 2.250000e+01, %8
%10 = load double, double* %4
%11 = fmul double %9, %10
store double %11, double* %3
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @get_dynamical_diff_sh2(double %0) {
%2 = fadd double %0, 0xC142492B40000000
%3 = fdiv double %2, 3.652500e+04
%4 = fmul double %3, 2.250000e+01
%5 = fmul double %3, %4
ret double %5
}
/* Variables and functions */
void cwk_path_terminate_output(char *buffer, size_t buffer_size, size_t pos) {
  if (buffer_size > 0) {
    if (pos >= buffer_size) {
      buffer[buffer_size - 1] = '\0';
    } else {
      buffer[pos] = '\0';
    }
  }
}


x86 assembly (clang, -O0):
<cwk_path_terminate_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    114f <cwk_path_terminate_output+0x4f>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     113e <cwk_path_terminate_output+0x3e>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    114a <cwk_path_terminate_output+0x4a>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    114f <cwk_path_terminate_output+0x4f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwk_path_terminate_output>:
test   %rsi,%rsi
je     1114 <cwk_path_terminate_output+0x14>
lea    -0x1(%rsi),%rax
cmp    %rsi,%rdx
cmovb  %rdx,%rax
movb   $0x0,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @cwk_path_terminate_output(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = icmp ugt i64 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %3
%10 = load i64, i64* %6
%11 = load i64, i64* %5
%12 = icmp uge i64 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = load i64, i64* %5
%16 = sub i64 %15, 1
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
br label %22
18: ; preds = %9
%19 = load i8*, i8** %4
%20 = load i64, i64* %6
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8 0, i8* %21
br label %22
22: ; preds = %18, %13
br label %23
23: ; preds = %22, %3
ret void
}

LLVM IR (-O2):
define void @cwk_path_terminate_output(i8* nocapture writeonly %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i64 %2, %1
%7 = add i64 %1, -1
%8 = select i1 %6, i64 %2, i64 %7
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %5, %3
ret void
}
void XtCloseDisplay() {}


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

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

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

LLVM IR (-O2):
define void @XtCloseDisplay() {
ret void
}
unsigned int phy_get_mtu(void) { return 256 - 2; }


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

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

LLVM IR (-O0):
define i32 @phy_get_mtu() {
ret i32 254
}

LLVM IR (-O2):
define i32 @phy_get_mtu() {
ret i32 254
}