xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, bit;
  scanf("%d", &a);
  scanf("%d", &b);
  bit = (b >> a) & 1;
  printf("%d", bit);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%cl
shr    %cl,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
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
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = ashr i32 %7, %8
%10 = and i32 %9, 1
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = lshr i32 %7, %8
%10 = and i32 %9, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ printf(char *, int);
int hlp_int_max(void) {
  printf("%d\n", INT_MAX);
  return 0;
}


x86 assembly (clang, -O0):
<hlp_int_max>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@INT_MAX = global i32 0
define i32 @hlp_int_max() {
%1 = load i32, i32* @INT_MAX
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@INT_MAX = global i32 0
define i32 @hlp_int_max() {
%1 = load i32, i32* @INT_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void EC_GROUP_get0_generator(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_get0_generator() {
ret void
}
void swap(int *p, int *q) {
  int temp;
  temp = *p;
  *p = *q;
  *q = temp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_sbc(int /*<<< orphan*/);
int /*<<< orphan*/ t16_data_rdn3_op();
void t16_sbc_rdn3() { arm_arith_sbc(t16_data_rdn3_op()); }


x86 assembly (clang, -O0):
<t16_sbc_rdn3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <t16_data_rdn3_op@plt>
mov    %eax,%edi
call   1030 <arm_arith_sbc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_sbc_rdn3>:
push   %rax
xor    %eax,%eax
call   1040 <t16_data_rdn3_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_arith_sbc@plt>

LLVM IR (-O0):
define void @t16_sbc_rdn3() {
%1 = call i32 (...) @t16_data_rdn3_op()
%2 = call i32 @arm_arith_sbc(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_sbc_rdn3() {
%1 = tail call i32 (...) @t16_data_rdn3_op()
%2 = tail call i32 @arm_arith_sbc(i32 %1)
ret void
}
void sortNumReviews() {}


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

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

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

LLVM IR (-O2):
define void @sortNumReviews() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ suggest(char const *);
void invalid(const char *prog, char arg) {
  fprintf(stderr, "%s: invalid option \"-%c\"\n", prog, arg);
  suggest(prog);
}


x86 assembly (clang, -O0):
<invalid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeba(%rip),%rsi
movsbl -0x9(%rbp),%ecx
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <suggest@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalid>:
push   %rbx
mov    %esi,%ecx
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <suggest@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"%s: invalid option \22-%c\22\0A\00"
define void @invalid(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6, i8 signext %7)
%9 = load i8*, i8** %3
%10 = call i32 @suggest(i8* %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"%s: invalid option \22-%c\22\0A\00"
define void @invalid(i8* %0, i8 signext %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8 signext %1)
%5 = tail call i32 @suggest(i8* %0)
ret void
}
int test_imm_54uint8_reg(unsigned char val) {
  return ((val) & (-0x54 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_54uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffac,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_54uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -84
%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_54uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -84
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int main(int argc, char *argv[]) {
  int i, j;
  i = 0;
  j = 0;
  while (i < 10) {
    j += ++i;
  }
  return i + j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    113e <main+0x3e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1120 <main+0x20>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
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 0, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
store i32 %13, i32* %6
%14 = load i32, i32* %7
%15 = add nsw i32 %14, %13
store i32 %15, i32* %7
br label %8
16: ; preds = %8
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 65
}
/* Type definitions */
typedef int uint8_t;
typedef int int16_t;

/* Variables and functions */
int16_t mcnet_read_int16(uint8_t *in) { return (in[0] << 8) + in[1]; }


x86 assembly (clang, -O0):
<mcnet_read_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcnet_read_int16>:
mov    (%rdi),%eax
shl    $0x8,%eax
add    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @mcnet_read_int16(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @mcnet_read_int16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f() { printf("Function f\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"Function f\00"
define void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
extern __attribute__((visibility("default"))) float call_f(float (*func)(float),
                                                           float arg) {
  return func(arg);
}


x86 assembly (clang, -O0):
<call_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_f>:
jmp    *%rdi

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

LLVM IR (-O2):
define float @call_f(float (float)* nocapture %0, float %1) {
%3 = tail call float %0(float %1)
ret float %3
}
/* Variables and functions */
int rndu();
double rnduM0V1(void) { return 1.732050807568877 * (-1 + rndu() * 2); }


x86 assembly (clang, -O0):
<rnduM0V1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rndu@plt>
shl    $0x1,%eax
add    $0xffffffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xed1(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnduM0V1>:
push   %rax
xor    %eax,%eax
call   1030 <rndu@plt>
add    %eax,%eax
add    $0xffffffff,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xed7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rnduM0V1() {
%1 = call i32 (...) @rndu()
%2 = mul nsw i32 %1, 2
%3 = add nsw i32 -1, %2
%4 = sitofp i32 %3 to double
%5 = fmul double 0x3FFBB67AE8584CA9, %4
ret double %5
}

LLVM IR (-O2):
define double @rnduM0V1() {
%1 = tail call i32 (...) @rndu()
%2 = shl nsw i32 %1, 1
%3 = add nsw i32 %2, -1
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 0x3FFBB67AE8584CA9
ret double %5
}
/* Variables and functions */
int smc_in(int /*<<< orphan*/);
unsigned char MAC_NoResponse() { return ((smc_in(0) >> 1) ^ 1) & 1; }


x86 assembly (clang, -O0):
<MAC_NoResponse>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <smc_in@plt>
sar    $0x1,%eax
xor    $0x1,%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAC_NoResponse>:
push   %rax
xor    %edi,%edi
call   1030 <smc_in@plt>
test   $0x2,%al
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @MAC_NoResponse() {
%1 = call i32 @smc_in(i32 0)
%2 = ashr i32 %1, 1
%3 = xor i32 %2, 1
%4 = and i32 %3, 1
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @MAC_NoResponse() {
%1 = tail call i32 @smc_in(i32 0)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 1
%4 = and i8 %3, 1
%5 = xor i8 %4, 1
ret i8 %5
}
ansihello() {}


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

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

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

LLVM IR (-O2):
define i32 @ansihello() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int math;
  int physics;
  int check;
  math = 5;
  physics = 5;
  check = math == 6 || physics == 5;
  printf("%d", check);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x6,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1146 <main+0x36>
cmpl   $0x5,-0xc(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%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 5, i32* %2
store i32 5, i32* %3
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 6
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 5
br label %10
10: ; preds = %7, %0
%11 = phi i1 [ true, %0 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
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 1)
ret i32 0
}
/* Variables and functions */
long double __qsqrt(long double);
long double intr_wrap_073(long double p1) { return __qsqrt(p1); }


x86 assembly (clang, -O0):
<intr_wrap_073>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qsqrt@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_073>:
jmp    1030 <__qsqrt@plt>

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

LLVM IR (-O2):
define x86_fp80 @intr_wrap_073(x86_fp80 %0) {
%2 = tail call x86_fp80 @__qsqrt(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ e_abs();
int /*<<< orphan*/ e_cpy();
void e_cpy_abs() {
  e_abs();
  e_cpy();
}


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

x86 assembly (clang, -O2):
<e_cpy_abs>:
push   %rax
xor    %eax,%eax
call   1040 <e_abs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_cpy@plt>

LLVM IR (-O0):
define void @e_cpy_abs() {
%1 = call i32 (...) @e_abs()
%2 = call i32 (...) @e_cpy()
ret void
}

LLVM IR (-O2):
define void @e_cpy_abs() {
%1 = tail call i32 (...) @e_abs()
%2 = tail call i32 (...) @e_cpy()
ret void
}
/* Variables and functions */
int htoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", htoi("0xAB"));
  printf("%d\n", htoi("0xAbabA"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <htoi@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
call   1040 <htoi@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xedc(%rip),%rdi
call   1040 <htoi@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
call   1040 <htoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"0xAB\00"
@.str.2 = [8 x i8] c"0xAbabA\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @htoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @htoi(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"0xAB\00"
@.str.2 = [8 x i8] c"0xAbabA\00"
define i32 @main() {
%1 = tail call i32 @htoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @htoi(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
unsigned long long __native_read_tsc();
unsigned long long ft_timestamp(void) { return __native_read_tsc(); }


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

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

LLVM IR (-O0):
define i64 @ft_timestamp() {
%1 = call i64 (...) @__native_read_tsc()
ret i64 %1
}

LLVM IR (-O2):
define i64 @ft_timestamp() {
%1 = tail call i64 (...) @__native_read_tsc()
ret i64 %1
}
int main() {
  int x, *y;
  y = &x;
  scanf("%d", &x);
  printf("Value of y is   : %x\n", y);
  printf("Value of x is   : %d\n", x);
  printf("Address of x is : %x", &x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [22 x i8] c"Value of y is : %x\0A\00"
@.str.2 = [22 x i8] c"Value of x is : %d\0A\00"
@.str.3 = [21 x i8] c"Address of x is : %x\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32* %2, i32** %3
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32*, i32** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [22 x i8] c"Value of y is : %x\0A\00"
@.str.2 = [22 x i8] c"Value of x is : %d\0A\00"
@.str.3 = [21 x i8] c"Address of x is : %x\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int __cgo_topofstack();
int _cgo_topofstack(void) { return __cgo_topofstack(); }


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

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

LLVM IR (-O0):
define i32 @_cgo_topofstack() {
%1 = call i32 (...) @__cgo_topofstack()
ret i32 %1
}

LLVM IR (-O2):
define i32 @_cgo_topofstack() {
%1 = tail call i32 (...) @__cgo_topofstack()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Absolute(int);
int /*<<< orphan*/ TRB8(int /*<<< orphan*/);
void Op1CM1(void) { TRB8(Absolute(3)); }


x86 assembly (clang, -O0):
<Op1CM1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
call   1030 <TRB8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op1CM1>:
push   %rax
mov    $0x3,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <TRB8@plt>

LLVM IR (-O0):
define void @Op1CM1() {
%1 = call i32 @Absolute(i32 3)
%2 = call i32 @TRB8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op1CM1() {
%1 = tail call i32 @Absolute(i32 3)
%2 = tail call i32 @TRB8(i32 %1)
ret void
}
/* Variables and functions */
int dal_reg_tbl_read(unsigned int, unsigned int, unsigned int *, unsigned int);
int emac1_reg_tbl_get(unsigned int dev_id, unsigned int reg_addr,
                      unsigned int *pvalue, unsigned int width) {
  return dal_reg_tbl_read(dev_id, reg_addr + 0x8000, pvalue, width);
}


x86 assembly (clang, -O0):
<emac1_reg_tbl_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x8000,%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <dal_reg_tbl_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emac1_reg_tbl_get>:
add    $0x8000,%esi
jmp    1030 <dal_reg_tbl_read@plt>

LLVM IR (-O0):
define i32 @emac1_reg_tbl_get(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add i32 %10, 32768
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = call i32 @dal_reg_tbl_read(i32 %9, i32 %11, i32* %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @emac1_reg_tbl_get(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = add i32 %1, 32768
%6 = tail call i32 @dal_reg_tbl_read(i32 %0, i32 %5, i32* %2, i32 %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc1(void) {
  printf("Executing exitfunc"
         "1"
         ".\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Executing exitfunc1.\0A\00"
define void @exitfunc1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc1.\00"
define void @exitfunc1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __wrap_free(int *);
int *__wrap_malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int *a = __wrap_malloc(sizeof(int));
  *a = 5;
  printf("%d\n", *a);
  __wrap_free(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <__wrap_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <__wrap_free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1030 <__wrap_malloc@plt>
mov    %rax,%rbx
movl   $0x5,(%rax)
lea    0xeb5(%rip),%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <__wrap_free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32* @__wrap_malloc(i32 4)
store i32 5, i32* %1
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = tail call i32 @__wrap_free(i32* %1)
ret i32 0
}
/* Type definitions */
struct can_frame {
  int *data;
};

/* Variables and functions */
int sdo_get_cs(const struct can_frame *frame) { return frame->data[0] >> 5; }


x86 assembly (clang, -O0):
<sdo_get_cs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
sar    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdo_get_cs>:
mov    (%rdi),%rax
mov    (%rax),%eax
sar    $0x5,%eax
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define i32 @sdo_get_cs(%struct.can_frame* %0) {
%2 = alloca %struct.can_frame*
store %struct.can_frame* %0, %struct.can_frame** %2
%3 = load %struct.can_frame*, %struct.can_frame** %2
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = ashr i32 %7, 5
ret i32 %8
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
define i32 @sdo_get_cs(%struct.can_frame* nocapture %0) {
%2 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = ashr i32 %4, 5
ret i32 %5
}
char *ot_strchrnul(const char *s, int c) {
  for (; *s != c && *s != '\0'; ++s)
    ;
  return (char *)s;
}


x86 assembly (clang, -O0):
<ot_strchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
je     1130 <ot_strchrnul+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <ot_strchrnul+0x40>
jmp    1156 <ot_strchrnul+0x56>
jmp    1145 <ot_strchrnul+0x45>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <ot_strchrnul+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ot_strchrnul>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <ot_strchrnul+0x20>
cmp    %esi,%ecx
jne    1110 <ot_strchrnul+0x10>
ret

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

LLVM IR (-O2):
define i8* @ot_strchrnul(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, %1
%8 = icmp eq i8 %5, 0
%9 = or i1 %8, %7
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
ret i8* %4
}
mod3(signed char x, signed char y) { return x % y; }


x86 assembly (clang, -O0):
<mod3>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod3>:
mov    %edi,%eax
cwtd
idiv   %si
movswl %dx,%eax
ret

LLVM IR (-O0):
define i32 @mod3(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = srem i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @mod3(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i16
%4 = sext i8 %1 to i16
%5 = srem i16 %3, %4
%6 = sext i16 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ b(int);
int main(void) {
  a();
  b(7);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <a@plt>
mov    $0x7,%edi
call   1030 <b@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <a@plt>
mov    $0x7,%edi
call   1030 <b@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @a()
%2 = call i32 @b(i32 7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 @b(i32 7)
ret i32 0
}
void gtk_button_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_button_new() {
ret void
}
int test_imm_A8int16_mem(short *val) {
  return ((*val) & (0xA8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A8int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 168
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *addColor(char *, char *);
char *bgRed(char *str) { return addColor("41", str); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"41\00"
define i8* @bgRed(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
void EC_POINT_set_to_infinity(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_set_to_infinity() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t make_vgaentry(char character, uint8_t color) {
  uint16_t character_to_16_bytes = character;
  uint16_t color_to_16_bytes = color;
  return character_to_16_bytes | (color_to_16_bytes << 8);
}


x86 assembly (clang, -O0):
<make_vgaentry>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_vgaentry>:
mov    %esi,%eax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @make_vgaentry(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = shl i32 %11, 8
%13 = or i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @make_vgaentry(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = shl i32 %1, 8
%5 = or i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int recv(int, char *, int, int /*<<< orphan*/);
char *ReadFromSocket(int SockFD) {
  int Length = 256;
  char *Result = (char *)malloc(Length);
  Length = recv(SockFD, Result, Length, 0);
  if (Length > 0) {
    Result[Length] = '\0';
  } else {
    free(Result);
    Result = NULL;
  }
  return Result;
}


x86 assembly (clang, -O0):
<ReadFromSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x100,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
xor    %ecx,%ecx
call   1040 <recv@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    117d <ReadFromSocket+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    118e <ReadFromSocket+0x5e>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadFromSocket>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
mov    $0x100,%edx
xor    %ecx,%ecx
call   1040 <recv@plt>
test   %eax,%eax
jle    115f <ReadFromSocket+0x2f>
mov    %eax,%eax
movb   $0x0,(%rbx,%rax,1)
jmp    1169 <ReadFromSocket+0x39>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ReadFromSocket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
store i32 256, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %4
%8 = load i32, i32* %2
%9 = load i8*, i8** %4
%10 = load i32, i32* %3
%11 = call i32 @recv(i32 %8, i8* %9, i32 %10, i32 0)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %1
%15 = load i8*, i8** %4
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
br label %22
19: ; preds = %1
%20 = load i8*, i8** %4
%21 = call i32 @free(i8* %20)
store i8* null, i8** %4
br label %22
22: ; preds = %19, %14
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @ReadFromSocket(i32 %0) {
%2 = tail call i64 @malloc(i32 256)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @recv(i32 %0, i8* %3, i32 256, i32 0)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = zext i32 %4 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
store i8 0, i8* %8
br label %11
9: ; preds = %1
%10 = tail call i32 @free(i8* %3)
br label %11
11: ; preds = %9, %6
%12 = phi i8* [ %3, %6 ], [ null, %9 ]
ret i8* %12
}
int secure_storage_spi_write(char *buf, unsigned int len) { return -1; }


x86 assembly (clang, -O0):
<secure_storage_spi_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @secure_storage_spi_write(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ begin_tests();
int /*<<< orphan*/ finish_tests();
void task(void) {
  begin_tests();
  finish_tests();
}


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

x86 assembly (clang, -O2):
<task>:
push   %rax
xor    %eax,%eax
call   1030 <begin_tests@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <finish_tests@plt>

LLVM IR (-O0):
define void @task() {
%1 = call i32 (...) @begin_tests()
%2 = call i32 (...) @finish_tests()
ret void
}

LLVM IR (-O2):
define void @task() {
%1 = tail call i32 (...) @begin_tests()
%2 = tail call i32 (...) @finish_tests()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ stderr;
void Hello(int thread_count) {
  int my_rank = 0;
  int actual_thread_count = 1;
  if (my_rank == 0 && thread_count != actual_thread_count)
    fprintf(stderr, "Number of threads started != %d\n", thread_count);
  printf("Hello from thread %d of %d\n", my_rank, actual_thread_count);
}


x86 assembly (clang, -O0):
<Hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1167 <Hello+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1167 <Hello+0x47>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hello>:
cmp    $0x1,%edi
je     1141 <Hello+0x21>
push   %rax
mov    %edi,%edx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x8,%rsp
lea    0xed9(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Number of threads started != %d\0A\00"
@.str.1 = [28 x i8] c"Hello from thread %d of %d\0A\00"
define void @Hello(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i32, i32* %2
%9 = load i32, i32* %4
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* @stderr
%13 = load i32, i32* %2
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %7, %1
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Number of threads started != %d\0A\00"
@.str.1 = [28 x i8] c"Hello from thread %d of %d\0A\00"
define void @Hello(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %3, %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() { printf("((3*4)/2+9-7)%9=%d\n", ((3 * 4) / 2 + 9 - 7) % 9); }


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"((3*4)/2+9-7)%9=%d\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"((3*4)/2+9-7)%9=%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}
int rab(char *pt, int *pti) {
  pt[2] = 0;
  pti[3] = 0;
}


x86 assembly (clang, -O0):
<rab>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0xc(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rab>:
movb   $0x0,0x2(%rdi)
movl   $0x0,0xc(%rsi)
ret

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

LLVM IR (-O2):
define i32 @rab(i8* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 0, i8* %3
%4 = getelementptr inbounds i32, i32* %1, i64 3
store i32 0, i32* %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_numbers_construct();
int /*<<< orphan*/ test_numbers_destruct();
int /*<<< orphan*/ test_numbers_mean();
int /*<<< orphan*/ test_numbers_random();
int /*<<< orphan*/ test_numbers_sd();
int /*<<< orphan*/ test_numbers_sort();
int /*<<< orphan*/ test_numbers_variance();
void test_all(void) {
  test_numbers_construct();
  test_numbers_destruct();
  test_numbers_sort();
  test_numbers_mean();
  test_numbers_variance();
  test_numbers_sd();
  test_numbers_random();
}


x86 assembly (clang, -O0):
<test_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_numbers_construct@plt>
mov    $0x0,%al
call   1070 <test_numbers_destruct@plt>
mov    $0x0,%al
call   1030 <test_numbers_sort@plt>
mov    $0x0,%al
call   1090 <test_numbers_mean@plt>
mov    $0x0,%al
call   1050 <test_numbers_variance@plt>
mov    $0x0,%al
call   1080 <test_numbers_sd@plt>
mov    $0x0,%al
call   1060 <test_numbers_random@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all>:
push   %rax
xor    %eax,%eax
call   1040 <test_numbers_construct@plt>
xor    %eax,%eax
call   1070 <test_numbers_destruct@plt>
xor    %eax,%eax
call   1030 <test_numbers_sort@plt>
xor    %eax,%eax
call   1090 <test_numbers_mean@plt>
xor    %eax,%eax
call   1050 <test_numbers_variance@plt>
xor    %eax,%eax
call   1080 <test_numbers_sd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <test_numbers_random@plt>

LLVM IR (-O0):
define void @test_all() {
%1 = call i32 (...) @test_numbers_construct()
%2 = call i32 (...) @test_numbers_destruct()
%3 = call i32 (...) @test_numbers_sort()
%4 = call i32 (...) @test_numbers_mean()
%5 = call i32 (...) @test_numbers_variance()
%6 = call i32 (...) @test_numbers_sd()
%7 = call i32 (...) @test_numbers_random()
ret void
}

LLVM IR (-O2):
define void @test_all() {
%1 = tail call i32 (...) @test_numbers_construct()
%2 = tail call i32 (...) @test_numbers_destruct()
%3 = tail call i32 (...) @test_numbers_sort()
%4 = tail call i32 (...) @test_numbers_mean()
%5 = tail call i32 (...) @test_numbers_variance()
%6 = tail call i32 (...) @test_numbers_sd()
%7 = tail call i32 (...) @test_numbers_random()
ret void
}
void mutate_longlong(long long *x) { *x *= 2; }


x86 assembly (clang, -O0):
<mutate_longlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
shl    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutate_longlong>:
shlq   (%rdi)
ret

LLVM IR (-O0):
define void @mutate_longlong(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 2
store i64 %5, i64* %3
ret void
}

LLVM IR (-O2):
define void @mutate_longlong(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = shl nsw i64 %2, 1
store i64 %3, i64* %0
ret void
}