xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getCurrentProcessTerminal();
unsigned int getParameter(unsigned int, int /*<<< orphan*/);
int /*<<< orphan*/ sConsoleWrite(int /*<<< orphan*/, unsigned char *);
unsigned int wrapper_terminal_write(unsigned int pc, unsigned int sp,
                                    unsigned int spsr) {
  unsigned int addr = getParameter(sp, 0);
  sConsoleWrite(getCurrentProcessTerminal(), (unsigned char *)addr);
  return sp;
}


x86 assembly (clang, -O0):
<wrapper_terminal_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <getParameter@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getCurrentProcessTerminal@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%eax
mov    %eax,%esi
call   1050 <sConsoleWrite@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapper_terminal_write>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %esi,%edi
xor    %esi,%esi
call   1030 <getParameter@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <getCurrentProcessTerminal@plt>
mov    %ebp,%esi
mov    %eax,%edi
call   1050 <sConsoleWrite@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @wrapper_terminal_write(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
%8 = load i32, i32* %5
%9 = call i32 @getParameter(i32 %8, i32 0)
store i32 %9, i32* %7
%10 = call i32 (...) @getCurrentProcessTerminal()
%11 = load i32, i32* %7
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = call i32 @sConsoleWrite(i32 %10, i8* %13)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @wrapper_terminal_write(i32 %0, i32 returned %1, i32 %2) {
%4 = tail call i32 @getParameter(i32 %1, i32 0)
%5 = tail call i32 (...) @getCurrentProcessTerminal()
%6 = zext i32 %4 to i64
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @sConsoleWrite(i32 %5, i8* %7)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int s;
  for (s = 0; s <= 255; s++) {
    printf("\nNum: %d --> Sym: %c", s, s);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"\0ANum: %d --> Sym: %c\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
void *input_null_init(const char *joypad_driver) { return (void *)-1; }


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

x86 assembly (clang, -O2):
<input_null_init>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i8* @input_null_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* inttoptr (i64 -1 to i8*)
}

LLVM IR (-O2):
define i8* @input_null_init(i8* nocapture readnone %0) {
ret i8* inttoptr (i64 -1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char get_mode() {
  char mode;
  do {
    printf("Enter the desired mode (e/d): ");
    scanf("%c", &mode);
  } while ((mode != 'e') && (mode != 'd'));
  return mode;
}


x86 assembly (clang, -O0):
<get_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x65,%ecx
mov    %al,-0x2(%rbp)
je     1163 <get_mode+0x43>
movsbl -0x1(%rbp),%eax
cmp    $0x64,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1128 <get_mode+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mode>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0xee8(%rip),%r15
lea    0xf(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movzbl 0xf(%rsp),%eax
mov    %eax,%ecx
and    $0xfe,%cl
cmp    $0x64,%cl
jne    1140 <get_mode+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Enter the desired mode (e/d): \00"
@.str.1 = [3 x i8] c"%c\00"
define signext i8 @get_mode() {
%1 = alloca i8
br label %2
2: ; preds = %13, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %5
5: ; preds = %2
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 101
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 100
br label %13
13: ; preds = %9, %5
%14 = phi i1 [ false, %5 ], [ %12, %9 ]
br i1 %14, label %2, label %15
15: ; preds = %13
%16 = load i8, i8* %1
ret i8 %16
}

LLVM IR (-O2):
@.str = [31 x i8] c"Enter the desired mode (e/d): \00"
@.str.1 = [3 x i8] c"%c\00"
define signext i8 @get_mode() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = load i8, i8* %1
%6 = and i8 %5, -2
%7 = icmp eq i8 %6, 100
br i1 %7, label %8, label %2
8: ; preds = %2
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_pwm(int /*<<< orphan*/, int, int /*<<< orphan*/);
void set_servo(int us_value, uint8_t channel) {
  int off_time = (us_value * 4096) / 20000;
  set_pwm(0, off_time, channel);
}


x86 assembly (clang, -O0):
<set_servo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xc,%eax
mov    $0x4e20,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
xor    %edi,%edi
call   1030 <set_pwm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_servo>:
mov    %esi,%edx
shl    $0xc,%edi
movslq %edi,%rax
imul   $0x68db8bad,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x2d,%rsi
add    %eax,%esi
xor    %edi,%edi
jmp    1030 <set_pwm@plt>

LLVM IR (-O0):
define void @set_servo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 4096
%8 = sdiv i32 %7, 20000
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @set_pwm(i32 0, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @set_servo(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 12
%4 = sdiv i32 %3, 20000
%5 = tail call i32 @set_pwm(i32 0, i32 %4, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sm_init();
int /*<<< orphan*/ sm_run();
int main(int argc, char **argv) {
  sm_init();
  while (1) {
    sm_run();
  }
  return (0);
}


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    $0x0,%al
call   1030 <sm_init@plt>
mov    $0x0,%al
call   1040 <sm_run@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sm_init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <sm_run@plt>
jmp    1130 <main+0x10>

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 = call i32 (...) @sm_init()
br label %7
7: ; preds = %2, %7
%8 = call i32 (...) @sm_run()
br label %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sm_init()
br label %4
4: ; preds = %2, %4
%5 = tail call i32 (...) @sm_run()
br label %4
}
int test_00(unsigned char *a) { return a[0] < 128; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x80,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    (%rdi),%al
not    %al
shr    $0x7,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @test_00(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp slt i32 %6, 128
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_00(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = xor i8 %2, -1
%4 = lshr i8 %3, 7
%5 = zext i8 %4 to i32
ret i32 %5
}
int recalc_spacing(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @recalc_spacing() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ work(int);
void hard() { work(1000 * 1000 * 1000); }


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

x86 assembly (clang, -O2):
<hard>:
mov    $0x3b9aca00,%edi
jmp    1030 <work@plt>

LLVM IR (-O0):
define void @hard() {
%1 = call i32 @work(i32 1000000000)
ret void
}

LLVM IR (-O2):
define void @hard() {
%1 = tail call i32 @work(i32 1000000000)
ret void
}
double hour_angle(int time) {
  double omega = 0;
  omega = 3.1415926 * (1.0 - ((double)time) / 43200.0);
  omega *= 180.0 / 3.1415926;
  return omega;
}


x86 assembly (clang, -O0):
<hour_angle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xefc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0xed4(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebb(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hour_angle>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @hour_angle(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 4.320000e+04
%7 = fsub double 1.000000e+00, %6
%8 = fmul double 0x400921FB4D12D84A, %7
store double %8, double* %3
%9 = load double, double* %3
%10 = fmul double %9, 0x404CA5DC22969FAA
store double %10, double* %3
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
define double @hour_angle(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 4.320000e+04
%4 = fsub double 1.000000e+00, %3
%5 = fmul double %4, 0x400921FB4D12D84A
%6 = fmul double %5, 0x404CA5DC22969FAA
ret double %6
}
/* Variables and functions */
void *calloc(int, int);
int main(void) {
  void *foo = calloc(42, 43);
  return (foo != NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%edi
mov    $0x2b,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @calloc(i32 42, i32 43)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

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

/* Variables and functions */
int /*<<< orphan*/ _mm_storeu_si128(int /*<<< orphan*/ *,
                                    int /*<<< orphan*/ const);
void xx_storeu_128(void *const a, const __m128i v) {
  _mm_storeu_si128((__m128i *)a, v);
}


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

x86 assembly (clang, -O2):
<xx_storeu_128>:
jmp    1030 <_mm_storeu_si128@plt>

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

LLVM IR (-O2):
define void @xx_storeu_128(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @_mm_storeu_si128(i32* %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_tokenlist(int argnum, char **args) {
  int i = 0;
  for (; i < argnum; i++) {
    printf("[%s]\n", args[i]);
  }
}


x86 assembly (clang, -O0):
<print_tokenlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <print_tokenlist+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_tokenlist+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tokenlist>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <print_tokenlist+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_tokenlist+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"[%s]\0A\00"
define void @print_tokenlist(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"[%s]\0A\00"
define void @print_tokenlist(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int at_hex_get_byte(char const *, int);
unsigned int at_hex_get_word(const char *line, int i) {
  return at_hex_get_byte(line, i) * 256 + at_hex_get_byte(line, i + 1);
}


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

x86 assembly (clang, -O2):
<at_hex_get_word>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <at_hex_get_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <at_hex_get_byte@plt>
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @at_hex_get_word(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @at_hex_get_byte(i8* %5, i32 %6)
%8 = mul nsw i32 %7, 256
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
%12 = call i32 @at_hex_get_byte(i8* %9, i32 %11)
%13 = add nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @at_hex_get_word(i8* %0, i32 %1) {
%3 = tail call i32 @at_hex_get_byte(i8* %0, i32 %1)
%4 = shl nsw i32 %3, 8
%5 = add nsw i32 %1, 1
%6 = tail call i32 @at_hex_get_byte(i8* %0, i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
char *strerror(int);
int main(int args, char *argv[]) {
  const int MAX_ERRORES = 255;
  for (int i = 0; i < MAX_ERRORES; i++) {
    printf("El error numero %d es: %s\n", i, strerror(i));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xff,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xff,-0x18(%rbp)
jge    117f <main+0x5f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x1c(%rbp),%esi
mov    %rax,%rdx
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1144 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <strerror@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xff,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"El error numero %d es: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %4
3: ; preds = %4
ret i32 0
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %8, %4 ]
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 255
br i1 %9, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void pauseProgram() {
  printf("Press any key to continue...");
  getchar();
  printf("\n");
}


x86 assembly (clang, -O0):
<pauseProgram>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pauseProgram>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Press any key to continue...\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @pauseProgram() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Press any key to continue...\00"
define void @pauseProgram() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ errl(char *, struct obj *);
void gc_fatal_error(void) { errl("ran out of storage", ((struct obj *)0)); }


x86 assembly (clang, -O0):
<gc_fatal_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <errl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gc_fatal_error>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <errl@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [19 x i8] c"ran out of storage\00"
define void @gc_fatal_error() {
%1 = call i32 @errl(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [19 x i8] c"ran out of storage\00"
define void @gc_fatal_error() {
%1 = tail call i32 @errl(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.obj* null)
ret void
}
/* Variables and functions */
int sum(int, int);
void main() {
  int a = 1;
  int b = 3;
  int c = sum(a, b);
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x3,%esi
jmp    1030 <sum@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %1
store i32 3, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @sum(i32 %4, i32 %5)
store i32 %6, i32* %3
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @sum(i32 1, i32 3)
ret void
}
int test_imm_07uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x07 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_07uint64_midword_reg>:
test   $0x70000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_07uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 458752
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ area(double);
int /*<<< orphan*/ calcularcomprimento(double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
main() {
  double raio;
  printf("Digite o raio: ");
  scanf("%lf", &raio);
  calcularcomprimento(raio);
  area(raio);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <calcularcomprimento@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <area@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <calcularcomprimento@plt>
movsd  (%rsp),%xmm0
call   1040 <area@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Digite o raio: \00"
@.str.1 = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call i32 @calcularcomprimento(double %5)
%7 = load double, double* %2
%8 = call i32 @area(double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Digite o raio: \00"
@.str.1 = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call i32 @calcularcomprimento(double %5)
%7 = load double, double* %1
%8 = call i32 @area(double %7)
ret i32 0
}
int test_imm_A6int64_lowword_mem(long long *val) {
  return ((*val) & (0xA6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A6int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 166
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
extern uint8_t HighBits(uint16_t word) { return (word >> 8) & 0xFF; }


x86 assembly (clang, -O0):
<HighBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @HighBits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @HighBits(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
void gtk_radio_menu_item_new_with_label_from_widget() {}


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

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

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

LLVM IR (-O2):
define void @gtk_radio_menu_item_new_with_label_from_widget() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int main() {
  int *a = (int *)malloc(16);
  a[0] = 0;
  a[0] = 1;
  a[0] = 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x10,%edi
call   1030 <malloc@plt>
movl   $0x2,(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 16)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 0, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 1, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 2, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 16)
%2 = inttoptr i64 %1 to i32*
store i32 2, i32* %2
ret i32 0
}
/* Variables and functions */
int BRRunTests();
main(int argc, const char *argv[]) {
  int r = BRRunTests();
  return (r) ? 0 : 1;
}


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    $0x0,%al
call   1030 <BRRunTests@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <BRRunTests@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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 = call i32 (...) @BRRunTests()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @BRRunTests()
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
double truncQuad(double epsilon, double thr) {
  if (thr == 0) {
    return 0;
  }
  if (epsilon >= thr * 9 / 4) {
    return 0;
  }
  return 1 - (epsilon / (thr * 9 / 4));
}


x86 assembly (clang, -O0):
<truncQuad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1133 <truncQuad+0x33>
jp     1133 <truncQuad+0x33>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119b <truncQuad+0x9b>
movsd  -0x10(%rbp),%xmm0
movsd  0xec8(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xeb3(%rip),%xmm2
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     1168 <truncQuad+0x68>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119b <truncQuad+0x9b>
movsd  -0x10(%rbp),%xmm1
movsd  0xe93(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe7e(%rip),%xmm2
divsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xe7e(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncQuad>:
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1111 <truncQuad+0x11>
jp     1111 <truncQuad+0x11>
ret
mulsd  0xee7(%rip),%xmm1
mulsd  0xee7(%rip),%xmm1
ucomisd %xmm1,%xmm2
jae    1110 <truncQuad+0x10>
divsd  %xmm1,%xmm2
movsd  0xedd(%rip),%xmm0
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @truncQuad(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store double 0.000000e+00, double* %3
br label %23
9: ; preds = %2
%10 = load double, double* %4
%11 = load double, double* %5
%12 = fmul double %11, 9.000000e+00
%13 = fdiv double %12, 4.000000e+00
%14 = fcmp oge double %10, %13
br i1 %14, label %15, label %16
15: ; preds = %9
store double 0.000000e+00, double* %3
br label %23
16: ; preds = %9
%17 = load double, double* %4
%18 = load double, double* %5
%19 = fmul double %18, 9.000000e+00
%20 = fdiv double %19, 4.000000e+00
%21 = fdiv double %17, %20
%22 = fsub double 1.000000e+00, %21
store double %22, double* %3
br label %23
23: ; preds = %16, %15, %8
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @truncQuad(double %0, double %1) {
%3 = fcmp oeq double %1, 0.000000e+00
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = fmul double %1, 9.000000e+00
%6 = fmul double %5, 2.500000e-01
%7 = fcmp ugt double %6, %0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = fdiv double %0, %6
%10 = fsub double 1.000000e+00, %9
br label %11
11: ; preds = %4, %2, %8
%12 = phi double [ %10, %8 ], [ 0.000000e+00, %2 ], [ 0.000000e+00, %4 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xea() {
  Assert_real((isalpha(234) == 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_isalpha.c",
              1175, ("isalpha should be 0 for 0xea"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xea>:
push   %rax
mov    $0xea,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x497,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xea\00"
define void @t_isalpha_0xea() {
%1 = call i64 @isalpha(i32 234)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xea\00"
define void @t_isalpha_0xea() {
%1 = tail call i64 @isalpha(i32 234)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void temperature_statistics(double *T, int N, double *mean, double *std) {}


x86 assembly (clang, -O0):
<temperature_statistics>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @temperature_statistics(double* %0, i32 %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
store double* %0, double** %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
ret void
}

LLVM IR (-O2):
define void @temperature_statistics(double* nocapture %0, i32 %1, double* nocapture %2, double* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void reset_bitarray(register int *vector, register int dim) {
  memset(vector, 0, dim * sizeof(int));
}


x86 assembly (clang, -O0):
<reset_bitarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_bitarray>:
lea    0x0(,%rsi,4),%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @reset_bitarray(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 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = trunc i64 %8 to i32
%10 = call i32 @memset(i32* %5, i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @reset_bitarray(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32 @memset(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
char *gettext(char *);
double log10(double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double LogB10(double a) {
  printf(gettext("Enter a number: "));
  scanf("%lf", &a);
  return (log10(a));
}


x86 assembly (clang, -O0):
<LogB10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1060 <log10@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LogB10>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xeb3(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1060 <log10@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @LogB10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @log10(double %6)
ret double %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @LogB10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @log10(double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void showUsage(const char *progname) {
  printf("Usage:   ");
  printf("%s 'input file' 'output file'\n", progname);
}


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

x86 assembly (clang, -O2):
<showUsage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Usage: \00"
@.str.1 = [31 x i8] c"%s 'input file' 'output file'\0A\00"
define void @showUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Usage: \00"
@.str.1 = [31 x i8] c"%s 'input file' 'output file'\0A\00"
define void @showUsage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_B9int16_reg(short val) {
  return ((val) & (-0xB9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B9int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff47,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B9int16_reg>:
test   $0xff47,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B9int16_reg(i16 signext %0) {
%2 = and i16 %0, -185
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr(char const *s) {
  int i;
  i = 0;
  while (s[i] != '\0') {
    i++;
  }
  write(1, s, i);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1146 <ft_putstr+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
mov    %rdi,%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putstr+0x10>
add    $0xffffffff,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @ft_putstr(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext 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 nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = call i32 @write(i32 1, i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = tail call i32 @write(i32 1, i8* %0, i32 %9)
ret void
}
int g(int b) { return (b >> 5) << 5; }


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

x86 assembly (clang, -O2):
<g>:
mov    %edi,%eax
and    $0xffffffe0,%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = and i32 %0, -32
ret i32 %2
}
int test4() {
  int y = 3;
  while (y > 0) {
    if (y < 3) {
      while (y > 0)
        y++;
    } else {
      while (y < 10)
        y++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1168 <test4+0x68>
cmpl   $0x3,-0x4(%rbp)
jge    1141 <test4+0x41>
jmp    1124 <test4+0x24>
cmpl   $0x0,-0x4(%rbp)
jle    113c <test4+0x3c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <test4+0x24>
jmp    1163 <test4+0x63>
jmp    1146 <test4+0x46>
cmpl   $0xa,-0x4(%rbp)
jge    115e <test4+0x5e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <test4+0x46>
jmp    1163 <test4+0x63>
jmp    110b <test4+0xb>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @test4() {
%1 = alloca i32
store i32 3, i32* %1
br label %2
2: ; preds = %24, %0
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %25
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %16
8: ; preds = %5
br label %9
9: ; preds = %12, %8
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %9
15: ; preds = %9
br label %24
16: ; preds = %5
br label %17
17: ; preds = %20, %16
%18 = load i32, i32* %1
%19 = icmp slt i32 %18, 10
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %1
%22 = add nsw i32 %21, 1
store i32 %22, i32* %1
br label %17
23: ; preds = %17
br label %24
24: ; preds = %23, %15
br label %2
25: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
int test_imm_06int64_lowword_mem(long long *val) {
  return ((*val) & (0x06 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_06int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double __nv_cyl_bessel_i1(double);
double cyl_bessel_i1(double __a) { return __nv_cyl_bessel_i1(__a); }


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

x86 assembly (clang, -O2):
<cyl_bessel_i1>:
jmp    1030 <__nv_cyl_bessel_i1@plt>

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

LLVM IR (-O2):
define double @cyl_bessel_i1(double %0) {
%2 = tail call double @__nv_cyl_bessel_i1(double %0)
ret double %2
}